Skip to content

dash: add discard to edit mode - #4367

Merged
purian23 merged 3 commits into
duxlabs-dev:masterfrom
Conava:dash-edit-discard
Nov 21, 2026
Merged

purian23 merged 3 commits into
duxlabs-dev:masterfrom
Conava:dash-edit-discard

Conversation

@Conava

@Conava Conava commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Description

The dash edit mode only had Reset to default and Finish, so when a layout went wrong it had to be rebuilt by hand or reset to default and then rebuilt. The edit header now has a Discard button that puts the dash back the way it was when edit mode was opened, like the Discard in the control center. This works in both the dash popout and the island dash.

Pressing Escape in edit mode now discards too, in the dash and in the control center, where it kept the changes before. Finish and every other way out of edit mode still keep the edits.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Refactor / internal cleanup
  • Documentation
  • Other

Related issues

Screenshots / video

screenshot_2026-11-21_01-24-58

Checklist

  • My code follows the conventions in CONTRIBUTING.md
  • I have tested my changes locally
  • New user-facing strings are wrapped in I18n.tr() with translator context, reusing existing terms where possible
  • Go changes: ran make fmt, added/updated tests, make test passes, and go mod tidy is clean
  • QML changes: ran make lint-qml with no new warnings
  • I have opened a corresponding pull request in dux-docs to document any new behaviors: dms: document escape discarding edit mode changes dux-docs#217

The dash edit mode only offered Reset to default and Finish, so a layout
that went wrong had to be rebuilt by hand. The edit header shared by the
dash popout and the island dash now has a Discard button that restores
the dash cards and options as they were when edit mode was entered, like
the Control Center's Discard.

Escape in edit mode now discards in the dash and in the Control Center,
where it used to keep the changes. Finish and every other way out of
edit mode still keep them.
@github-actions github-actions Bot added feature ui Quickshell UI under quickshell/ labels Nov 21, 2026
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Claude review

One fix needed before merge: the shared edit controls show a Discard button that does nothing in the desktop widget editor.

  • Discard is always visible, but WidgetEditorOverlay never handles discardRequested, so the button is dead there. quickshell/Modules/DDash/Overview/DashEditControls.qml:210

Checked: the snapshot and restore of dashCards/dashOptions (these hold all per-tab widget layouts, options and panel sizes), when the snapshot is taken in the popout Loader and the island face, Escape handling in DashKeyboard and the control center, and every consumer of DashEditControls. Model: claude-opus-5-5.

The desktop widget editor shares the dash edit controls but has no
discard, so the button did nothing there.
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Claude review

No issues found. The earlier dead Discard button in the desktop widget editor is fixed by canDiscard: false.

Checked: the dashCards/dashOptions snapshot covers every edit-mode write (card layout, per-tab widget layouts for built-in, weather and plugin tabs, tab options, panel sizes); the snapshot is taken in the synchronous popout Loader and in the always-present island DashPageActions; Escape order in DashKeyboard (options sheet and menu still go first); cancelEdit() in the control center; every DashEditControls consumer; and reuse of the existing "Discard" term. Model: claude-opus-5-5.

@purian23

purian23 commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Thanks Marlon! I haven't looked at this yet, but it's been needed for sure. One last thing you could add to enhance it a step further is Ctrl+Z like we have in the control center as dash already supports Ctrl+E I think we just missed it.

https://duxlabs.dev/docs/dms/keyboard-navigation#control-center

@Conava

Conava commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks Marlon! I haven't looked at this yet, but it's been needed for sure. One last thing you could add to enhance it a step further is Ctrl+Z like we have in the control center as dash already supports Ctrl+E I think we just missed it.

https://duxlabs.dev/docs/dms/keyboard-navigation#control-center

I already had this feature planned in for a different PR (im also doing some other changes to the dash edit mode) but I will rebase that commit and add it here instead.

Like the control center, dash edit mode keeps a history of the card
layout and page options and Ctrl+Z steps back one change at a time, in
the popout and the island dash. Writes that land together (reset to
default) count as one step. It is off while an options sheet, a menu or
a card or panel resize is active.

Option dropdowns now keep following the stored value after a pick, so
a sheet the island keeps alive shows the restored value after undo,
discard or reset instead of the last pick.
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Claude review

No issues found.

Checked: the new Ctrl+Z undo in DashPageActions (snapshot reset on entering and leaving edit mode, Qt.callLater grouping writes to both keys into one step, undo not adding a new step through undoBase, the Connections only enabled in edit mode); panel and card resize only write on commit, so a drag stays one step; the Ctrl+Z shortcut guards (menus, option sheets, card and panel resize) in the popout and island; panelResizer/canUndo wiring in both hosts; the Binding on DashOptionRow dropdown currentValue after undo, discard and reset; Escape calling cancelEdit() in the control center; canDiscard: false in the desktop widget editor. The dux-docs PR is linked. Model: claude-opus-5-5.

@Conava

Conava commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

done @purian23

@purian23
purian23 merged commit 4a9884b into duxlabs-dev:master Nov 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature ui Quickshell UI under quickshell/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants