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

Improve CodeEditor warning dialog #967

Merged
merged 8 commits into from
Jan 8, 2024
Merged

Improve CodeEditor warning dialog #967

merged 8 commits into from
Jan 8, 2024

Conversation

davidfig
Copy link
Collaborator

@davidfig davidfig commented Jan 6, 2024

  • fix bug with escape key not trigger CodeEditor save warning
  • add warning dialog when changing code cell to a different cell
    • double click
    • = from outside cell
    • = within CellInput
  • add escape anywhere in app to close code editor

The testing matrix is rather large:

Possible states

  1. Code Editor is open or closed
  2. Code Editor has changes or not
  3. Code Editor has focus or not

Triggers

  • Pressing escape (with states 2 and 3)
  • Pressing the close button on code editor (with states 2 and 3)
  • Double-clicking a code cell (with state 2)
  • Pressing equals or slash on a code cell (with state 2)
  • Pressing equals or slash on a non-code cell (with state 2)
  • Typing = as the first character while cell input is open (with state 2)

Save Dialog choice
Need to check all the triggers against the three results of the dialog: Save and Run, Discard, and Cancel.

  • Save and Run should save and run the cell and update it before performing the trigger
  • Cancel should revert the original code cell's contents before performing the trigger
  • Cancel should always leave the code cell the way it was with the unsaved change and cancel the triggering event

Copy link

vercel bot commented Jan 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
quadratic ✅ Ready (Inspect) Visit Preview Jan 8, 2024 4:45pm

@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-967 January 6, 2024 16:40 Inactive
@davidfig davidfig linked an issue Jan 6, 2024 that may be closed by this pull request
Copy link

codecov bot commented Jan 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f33d092) 88.52% compared to head (ce9e9a5) 88.52%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #967      +/-   ##
==========================================
- Coverage   88.52%   88.52%   -0.01%     
==========================================
  Files          99       99              
  Lines       17698    17764      +66     
==========================================
+ Hits        15668    15725      +57     
- Misses       2030     2039       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-967 January 7, 2024 13:40 Inactive
@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-967 January 8, 2024 16:40 Inactive
@davidfig davidfig merged commit 239cc7a into main Jan 8, 2024
8 of 9 checks passed
@davidfig davidfig deleted the fix-code-escape branch January 8, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants