-
Notifications
You must be signed in to change notification settings - Fork 7
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 of Activity Directives between Plans #1627
base: develop
Are you sure you want to change the base?
Conversation
fab1cfa
to
e5c2ec1
Compare
<ContextMenuItem on:click={pasteActivityDirectives}>{getPasteActivityDirectivesText()}</ContextMenuItem> | ||
<ContextMenuSeparator></ContextMenuSeparator> | ||
{/if} | ||
{#await canPasteActivityDirectives() then howMany} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep this option always visible, but disabled if they don't have anything to paste in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to do this without the await
wrapping the menu item?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@duranb it doesn't hide the single Paste menu item, but i found that it would await until that is done to show the context menu altogether. I can spend time figuring this out, but if we paste 100,000 activities i think the context menu lag might be a small problem compared to handling that kind of operation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll see if I can test it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@duranb ok i tested, when you have around 20k activities in the clipboard context menu starts to lag. i started looking into caching this info, but the point of this feature is to work between plans so even if i cache the info on one instance, the other instance will be wrong. Let's tag up Monday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! I think I'm less worried about it taking a while to load and more that the user isn't presented with all the options. Can we maybe kick off the serialization when it opens and show a loading message where the option to paste would normally go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or are you saying that the process of serialization is the part that's lagging the UI?
e5c2ec1
to
258e0ba
Compare
258e0ba
to
3796dac
Compare
@duranb addressed feedback! and actually simplified it! Give it a look when you can. |
@@ -432,18 +428,35 @@ | |||
> | |||
Set Simulation End | |||
</ContextMenuItem> | |||
{#if canPasteActivityDirectives()} | |||
{#await getActivityDirectivesClipboardCount() then directivesInClipboard} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there still a chance that this menu item won't show while it's loading the count? Is it always quick to pop in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure there's still a chance if you're trying to copy/paste tens of thousands of activities
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that makes sense. Can we instead save the count to a variable and instead of await
ing to show the menu option, just show the option with a 0
count and disabling it to be consistent with always showing options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@duranb since we're using the system clipboard we first need to make sure the clipboard has activity directives and then we get how many there are. So keeping the count doesn't really help me because we still have to deserialize the clipboard to see if it's the right type of content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But my concern here is that we're hiding menu items from the user while waiting for the clipboard to deserialize. It's probably not likely that it would take long to deserialize, but I just want to make sure that the UX is consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my comment above, sorry we're having this chat in two different places where the same thing is happening 😄
3796dac
to
0f7ae85
Compare
0f7ae85
to
848dfbe
Compare
@@ -67,6 +68,12 @@ | |||
errorCounts: activityDirectiveErrorRollupsMap?.[activityDirective.id]?.errorCounts, | |||
})); | |||
|
|||
$: permissionErrorText = planReadOnly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind changing this to not have a nested ternary? It can be a little difficult to immediately grok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@duranb pushed a change to handle this
@@ -432,18 +428,35 @@ | |||
> | |||
Set Simulation End | |||
</ContextMenuItem> | |||
{#if canPasteActivityDirectives()} | |||
{#await getActivityDirectivesClipboardCount() then directivesInClipboard} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But my concern here is that we're hiding menu items from the user while waiting for the clipboard to deserialize. It's probably not likely that it would take long to deserialize, but I just want to make sure that the UX is consistent.
848dfbe
to
1207af9
Compare
|
Closes #1625
Extending the original Copy & Paste feature with a few things here...