massucattoj opened a new pull request, #40832: URL: https://github.com/apache/superset/pull/40832
### SUMMARY The Discard button in the dashboard edit toolbar was always enabled, even on a freshly opened new dashboard with no changes. Clicking it suggested "discard this dashboard", but the handler only strips `?edit` from the URL the dashboard itself stays persisted (the backend creates it eagerly at `/dashboard/new/`). **Scope note:** the ticket description also mentions "Discarding should abort creation and not persist a dashboard." That is **not addressed here** it would require changing how `/dashboard/new/` works (it currently eagerly inserts a `DashboardModel` before any user interaction). Maybe worth a separate ticket? ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF - Before <img width="1488" height="226" alt="Screenshot 2026-06-06 at 14 45 47" src="https://github.com/user-attachments/assets/083bfd08-f51f-4535-b69a-78000853ea18" /> - After <img width="1491" height="425" alt="Screenshot 2026-06-06 at 14 44 53" src="https://github.com/user-attachments/assets/c3d95e06-46b1-444e-9572-e979a45ff963" /> ### TESTING INSTRUCTIONS 1. Open Superset → Dashboards → click **+ Dashboard**. 2. Without making any changes, confirm the **Discard** button is disabled (greyed out, not clickable). 3. Edit the dashboard title (or drag in a chart). Confirm both **Discard** and **Save** become enabled. 4. Click **Discard** → URL drops `?edit`, returns to view mode. 5. Re-enter edit mode without making changes → Discard is disabled again. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [x] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
