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

Angus/1508 snippets #1553

Merged
merged 28 commits into from
Jul 20, 2021
Merged

Angus/1508 snippets #1553

merged 28 commits into from
Jul 20, 2021

Conversation

veggiesaurus
Copy link
Collaborator

@veggiesaurus veggiesaurus commented Jul 8, 2021

Closes #1508. Code snippets feature is hidden behind the "enable code snippets" preference.

Additional tutorials will be handled in #1556.

Additional minor changes:

  • setActiveFrame(id: number) renamed setActiveFrameById. setActiveFrame(frame: FrameStore) introduced. @confluence, can you adjust the python scripting interface accordingly. Should be a one-liner.
  • interactive alerts now use async/await instead of callback functions.
  • Closes Better handling of situations where frontend javascript cannot be read #1551 with a bit of static HTML and embedded CSS that shows up while CARTA is loading (see below, emulating slow internet)
2021-07-19.12-55-59.mp4

@veggiesaurus veggiesaurus marked this pull request as draft July 8, 2021 20:32
@veggiesaurus veggiesaurus marked this pull request as ready for review July 9, 2021 07:12
@kswang1029
Copy link
Collaborator

suggestions for improvements:

  1. when we click the "New" button in the snippets dialog, we should ask users to save or discard the snippets in the current editor.
  2. the overwrite confirmation popup shows behind the save popup.
Screen.Recording.2021-07-12.at.1.49.14.PM.mov
  1. (no standard use case🙈) if we keep the enter key pressed to create new lines, at some point (~1000 lines with my laptop) we will see it slows down (ie not seeing each new line being created, instead it jumps every few lines)

questions:

  1. should we consider to use a widget instead of a dialog? with a widget it might be easier to write a script by referencing the GUI interactively. With a dialog, the rest of the GUI is blocked (for example, we cannot see what categories that have been created from the snippets menu. BUT if we do so, we can have multiple snippets widgets activated at the same time.
  2. what's the purpose of having "tag" and where to see it other than the save popup?

@veggiesaurus
Copy link
Collaborator Author

veggiesaurus commented Jul 12, 2021

  1. when we click the "New" button in the snippets dialog, we should ask users to save or discard the snippets in the current editor.

I'll add a confirmation if the current snippet has not been saved

  1. the overwrite confirmation popup shows behind the save popup.

will fix that 🙈

  1. (no standard use case🙈) if we keep the enter key pressed to create new lines, at some point (~1000 lines with my laptop) we will see it slows down (ie not seeing each new line being created, instead it jumps every few lines)

I think this is an issue with the react-simple-code-editor component. We can file an issue there, I guess.

  1. should we consider to use a widget instead of a dialog? with a widget it might be easier to write a script by referencing the GUI interactively. With a dialog, the rest of the GUI is blocked (for example, we cannot see what categories that have been created from the snippets menu. BUT if we do so, we can have multiple snippets widgets activated at the same time.

It's only blocked when you're in the save dialog. You can still interact with the rest of the GUI while writing code.

  1. what's the purpose of having "tag" and where to see it other than the save popup?

Future use. But I think we should remove this input until we're actually. making use of this field

@kswang1029 I can't reproduce (2) on mac (chrome, safari) or linux. What were using to test?

@kswang1029
Copy link
Collaborator

@kswang1029 I can't reproduce (2) on mac (chrome, safari) or linux. What were using to test?

Yes, it is mac+chrome. I tried to make a custom category, save a custom script, then modify it and try to save again with same name, tag, and category.

@veggiesaurus
Copy link
Collaborator Author

@kswang1029 I can't reproduce (2) on mac (chrome, safari) or linux. What were using to test?

Yes, it is mac+chrome. I tried to make a custom category, save a custom script, then modify it and try to save again with same name, tag, and category.

Ok, I can reproduce it now. I think I know what it is.. a z-index issue

@veggiesaurus
Copy link
Collaborator Author

@kswang1029 I've resolved (1) and (3) above, and removed the tag input from the save dialog. Please re-review.

@kswang1029
Copy link
Collaborator

@kswang1029 I've resolved (1) and (3) above, and removed the tag input from the save dialog. Please re-review.

Tested again with a4679bf
issue 1: fixed 👍
issue 2: remains. It appears that initially the z order is correct but later on it is not.

Screen.Recording.2021-07-15.at.10.11.56.AM.mov

issue 3: remains.

Screen.Recording.2021-07-15.at.10.13.27.AM.mov

@veggiesaurus
Copy link
Collaborator Author

veggiesaurus commented Jul 19, 2021

@kswang1029 (2) should be fixed now. (3) will need to be handled by an issue in the react-simple-code-editor repo. Doesn't seem urgent to me

Copy link
Collaborator

@YuHsuan-Hwang YuHsuan-Hwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just found one detail: preference Enable Code Snippets need to response to the Restore defaults button

@veggiesaurus
Copy link
Collaborator Author

Just found one detail: preference Enable Code Snippets need to response to the Restore defaults button

@YuHsuan-Hwang fixed, please re-review

@YuHsuan-Hwang YuHsuan-Hwang self-requested a review July 20, 2021 07:33
@veggiesaurus veggiesaurus merged commit 0e591f2 into dev Jul 20, 2021
@veggiesaurus veggiesaurus deleted the angus/1508_snippets branch July 20, 2021 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants