feat(ux): add confirmation modal before loading sample template#868
feat(ux): add confirmation modal before loading sample template#868Anexus5919 wants to merge 1 commit intoaccordproject:mainfrom
Conversation
✅ Deploy Preview for ap-template-playground ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
62abd1f to
bebee63
Compare
|
@ekarademir @dselman @DianaLease Could you please review this PR when you get time? |
|
Hi @Anexus5919, I had already started working on this issue since I initially raised it. Could you please check with me (or whoever raised the issue) next time to confirm if it's already being worked on before picking it up? |
|
Also the modal UI isnt matching Playground theme. |
Hi @hemantch01, thanks for raising the issue - it's a great catch! I appreciate you flagging it Regarding checking before picking up an issue, the issue wasn't assigned to anyone and didn't have any comments or linked PRs indicating active work. In open-source, unassigned issues are generally open for anyone to contribute to. If you were already working on it, the common practice is to comment on the issue or ask to be assigned so others are aware. That said, I completely understand the situation and will make sure to check in the comments going forward as a courtesy. If you have a different or better approach in your implementation, feel free to open your PR as well - maintainers can always choose the one that fits best. Contributions in all forms are valuable! |
Could you clarify what you mean by "not matching the Playground theme"? The modal currently uses Ant Design's default Modal.confirm() styling, which is consistent with how other Ant Design components render across the app. I've also added scoped dark mode styles so the modal is readable in both light and dark themes. If there's a specific aspect that looks off, I'm happy to adjust - a screenshot would help! |
Thanks for telling me about open source rules, and by “not matching the Playground theme,” I meant that the button color was off from the overall Playground theme and the colors used for other buttons. |
|
Thanks for clarifying @hemantch01! That's a fair point, the playground uses |
bebee63 to
1131673
Compare
Closes accordproject#867 Signed-off-by: Adarsh Singh <anexus5919@gmail.com>
1131673 to
4936089
Compare
|
@hemantch01 Thanks for the feedback! I've addressed both points and tested locally. The fixes have been pushed. |
|
hi @Anexus5919 why are you force pushing to your branch every time?? , it changes the history and a bad practice to follow i had to forcefully fetch new changes in you pull request. |
Hi @hemantch01, force-pushing to a personal feature branch on a fork is standard practice especially when squashing commits to maintain a clean, single-commit PR, which is generally preferred by maintainers for easier review and a cleaner git history. It doesn't affect the base branch or anyone else's work. This PR is raised for the maintainers to review, so I prefer to keep the commit history clean and easy to review for them. |
|
@ekarademir @dselman @DianaLease |

Closes #867
Summary
Currently, selecting a new sample from the Load Sample dropdown instantly replaces the contents of all three editors (Concerto Model, TemplateMark, and JSON Data) without any warning causing users to lose unsaved work silently.
This PR adds a confirmation modal that intercepts the sample loading action when there are unsaved changes, giving users a clear warning and the choice to proceed or cancel. If the editors are unmodified, the sample loads directly without interruption.
Changes
src/components/SampleDropdown.tsxModal.confirm()from Ant Design as an interception layer inhandleMenuClickmaskClosable: true)performLoadSamplecallback for clean separation between confirmation and executionhandleMenuClickis now synchronous (returns immediately after showing modal), with the async load deferred toonOksrc/index.css.ant-modal-confirm) under the existinghtml[data-theme="dark"]pattern#19c6c7) for consistency with the rest of the UIScreenshots
Light Mode
(Modal renders with default Ant Design light styling - works out of the box)

Dark Mode
(Modal background, text, and cancel button styled to match the dark theme)

Test Plan