Add confirmation dialog when clicking "New" if model is dirty
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- accessibility, frontend
Research direction
Start at the toolbar's "New" action and compare its behavior with the existing confirmation dialogs referenced by issue #78. Verify the dirty-state condition, cancel and confirm outcomes, the stated message, and the alertdialog accessibility requirements; done means unsaved work is protected while clean models still open directly.
Written by the indexing model from the issue text.
Description
Currently, when a user clicks the "New" button in the toolbar, the canvas is cleared immediately. If the user has unsaved changes (the model is "dirty"), this leads to accidental data loss.
While the action can technically be reverted using Ctrl + Z, this is not a discoverable feature for new users, nor is it a standard pattern for destructive actions like clearing a project. A user who loses their work might not realize they can undo it and may end up restarting the project from scratch. (Like it happend to me that I had to do again the model).
Proposed Solution:
Implement a confirmation dialog that triggers only when the modeling section has unsaved changes.
-
Trigger: User clicks the "New" button.
-
Condition: Check if isDirty (or equivalent state) is true.
-
Message: "You have unsaved changes. Are you sure you want to create a new model? All current progress will be lost."
Actions:
Cancel: Closes the dialog and stays on the current model.
Confirm: Clears the canvas and starts a new model.
User Experience (UX):
This aligns with the behavior of existing confirmation dialogs (like issue #78 for field removal).
Prevents the "frustration factor" of losing complex schemas by a misclick.
Accesibilitie
Ensure the dialog follows ARIA patterns (role="alertdialog") and that focus is trapped within the modal when active.
- Dominant language
- TypeScript
- Stars
- 139
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Lemoncode/mongo-modeler
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Lemoncode/mongo-modeler#610 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Lemoncode/mongo-modeler#609 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Lemoncode/mongo-modeler#597 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
Lemoncode/mongo-modeler#591 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Lemoncode/mongo-modeler#590 ·
All issues in Lemoncode/mongo-modeler
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:tools bug good first issue help wanted priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
newrelic-experimental/preflight#793 · 1 comment ·
-
bug 🐞
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·