Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy & Paste Activity Directives on Timeline #1544

Open
dandelany opened this issue Nov 8, 2024 · 1 comment
Open

Copy & Paste Activity Directives on Timeline #1544

dandelany opened this issue Nov 8, 2024 · 1 comment
Assignees
Labels
feature New feature or request

Comments

@dandelany
Copy link
Collaborator

dandelany commented Nov 8, 2024

Description

To improve usability of Aerie planning on the timeline, we'd like to allow users to copy the selected activity directive on the timeline, and paste it at a different point on the timeline - this would create a new copy of the activity directive, with the same set of arguments but starting at a different time.

In the future, we'd also like to enable copying activity directives to a different plan, or even a different Aerie venue. Also in a future iteration we'd like to support copying multiple directives simultaneously.

Requirements

  • When user right-clicks on an activity directive, there should be a new "copy" menu item in the context menu which copies the directive
  • When the user right-clicks on the timeline, there should be a "paste" menu item in the context menu which pastes the copied directive
    • (if the user has a directive in their clipboard - otherwise show error or grayed-out menu item)
  • Keyboard shortcuts
    • Cmd+C should copy the selected activity directive, if one is selected
    • Cmd+V should paste the copied directive wherever the cursor is currently placed on the timeline (or at plan start if no cursor)
  • Implementation details
    • While not a requirement for this round, we'd like to allow copying from Plan A and pasting on Plan B in the near future - so we should architect in a way that supports this as much as possible
    • This means potentially copying the entire JSON contents of the directive to the user's clipboard?
@dandelany dandelany added the feature New feature or request label Nov 8, 2024
@dandelany dandelany added this to Aerie Nov 8, 2024
@github-project-automation github-project-automation bot moved this to Todo in Aerie Nov 8, 2024
@ivydeliz
Copy link
Contributor

ivydeliz commented Nov 8, 2024

From my previous experience doing this, we can support copy/paste of multiple activity directives in the same plan and between plans in the same domain from the get-go.

Copy/Paste between Plans
The limitation of between plans is that the definition of the directives being copied need to be the same on both plans. We will need to find the comparison to verify that the definitions are the same between plans for all items in the clipboard. We could limit it to same model and version, I'm pretty sure those are not managed uniquely since we import the models from file, not reference a model in the cloud.

Copy/Paste between Venues
The limitation between venues is that if we use the localStorage as the clipboard, like i've done in the past, that is domain limited for security reasons. To support this we might need to figure out a way to use a different type of clipboard, maybe the computer's clipboard. I agree we should definitely handle this in the future 😆

I see some uses of navigator.clipboard to copy into the system clipboard in the Aerie code, but nowhere I see using that content back into the tool. This might make it all good to use between venues in the future, but it seems to be a pretty new NEW feature, might have compatibility issues with older browsers, since NASA forces us to be up to date i think that's ok.
Documentation https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard#browser_compatibility

@ivydeliz ivydeliz moved this from Todo to In Progress in Aerie Nov 14, 2024
@dandelany dandelany moved this from In Progress to In Review in Aerie Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Status: In Review
Development

No branches or pull requests

2 participants