fix(dashboard): offer Exit edit mode when there is nothing to discard#42208
fix(dashboard): offer Exit edit mode when there is nothing to discard#42208rusackas wants to merge 1 commit into
Conversation
Follow-up to apache#40832, which disabled the Discard button when a dashboard edit session has no unsaved changes. That fixed the misleading label but left the toolbar with no way back to view mode on a pristine session (Save and Discard both disabled, and the actions menu has no exit item). Keep the button always enabled instead, labeled Discard when there are unsaved changes and Exit edit mode when there are none. The handler is unchanged in both cases: it drops the ?edit param and returns to view mode. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Code Review Agent Run #03edc2Actionable Suggestions - 0Additional Suggestions - 1
Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #42208 +/- ##
==========================================
- Coverage 65.19% 65.18% -0.01%
==========================================
Files 2767 2767
Lines 156062 156064 +2
Branches 35717 35719 +2
==========================================
- Hits 101741 101737 -4
- Misses 52361 52367 +6
Partials 1960 1960
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
🎪 Showtime deployed environment on GHA for f898981 • Environment: http://34.220.202.197:8080 (admin/admin) |
SUMMARY
Follow-up to #40832, which disabled the Discard button when a dashboard edit session has no unsaved changes. That fixed the misleading affordance (Discard had nothing to discard), but as @sadpandajoe noted on that PR, it left the edit-mode toolbar with no way back to view mode on a pristine session: Save and Discard are both disabled, and the "..." menu has no exit item, so the only escape is a page refresh or navigating away.
This keeps the button always enabled, and swaps the label based on state: Discard when there are unsaved changes, Exit edit mode when there are none. The click handler is identical in both cases (drops the
?editparam and returns to view mode), so the label always describes what actually happens.If @yousoph / @kasiazjc would rather see a different treatment (a separate exit control, different wording, etc.), happy to iterate. This is meant as the smallest change that removes the dead end.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: on a pristine edit session, Discard is disabled and there is no toolbar path back to view mode.
After: the same button reads "Exit edit mode" and is clickable; with unsaved changes it reads "Discard" exactly as before.
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION
🤖 Generated with Claude Code