Skip to content

Add ⌘Z undo on desktop and web; trim success toasts - #229

Merged
MaplumeX merged 1 commit into
mainfrom
docs/toast-trigger-conditions
Oct 13, 2026
Merged

MaplumeX merged 1 commit into
mainfrom
docs/toast-trigger-conditions

Conversation

@MaplumeX

Copy link
Copy Markdown
Owner

Summary

  • ⌘Z / Ctrl+Z undo on desktop and web. Every shell now attaches the undo history (ADR-0024): shake-to-undo on Android, ⌘Z on desktop and web. Each desktop window and each web tab keeps its own in-memory history, wrapped around that window's TabEngine/Engine via undoHistory.attach. resetEngineBackends / resetBackends detach it on logout, and installUndoBoundaries() is installed in both entrypoints so one undo step still equals everything between two user inputs. The new undo shortcut (⌘Z / Ctrl+Z, interceptable on Web) is a no-op when focus is in a text field, where the native text undo wins.
  • Undo for writes outside the Engine. UndoHistory.record(action, run) lets a non-Engine write supply its own inverse and join the current step, exactly like an Engine write. Log Completed (advancing the account's loggedThrough watermark) now uses it, so the watermark rollback is a normal Undo step instead of a one-off toast action; when no Engine is attached (REST mode) it still runs, just unrecorded. logCompleted no longer returns an undo callback.
  • Success toasts removed. Drops the ubiquitous "success toast" pattern (profileSaved, passwordSaved, archiveSuccess, convertSuccess, skipOccurrenceDone, duplicateProjectDone, exportSuccess, assistantSaved/assistantTestOk, subscriptionAdded, emptyTrashSuccess, Review's doneTitle, MagicPlusInbox's placement toast, and the toast-based undo for Log Completed) along with the now-unused i18n keys in both en and zh. Failure toasts and inline feedback are unchanged; assistant connection test results stay inline next to the button.
  • Tag deletion is now a confirmation dialog. Deleting a tag (and promoting its children to the top level) cannot be undone, so the optimistic hide + undoable-toast flow is replaced by a Dialog that spells out the consequence (deleteDescription / deleteDescriptionWithChildren) and only commits on confirm. ushortcut_undo and undoActionLogCompleted labels added, and UndoPrompt maps the new logCompleted action.

Files of note

  • packages/api/src/undo/undo-history.ts (+ tests): custom inverse op, record(), action priority for custom ops.
  • packages/api/src/hooks/useLogging.ts: Log Completed recorded through undoHistory.
  • packages/desktop/... and packages/frontend/...: undo history attached to the per-window/tab engine.
  • packages/ui/src/components/keyboard/*: undo action, keymap entry, shortcut test.
  • packages/ui/src/pages/Tags.tsx (+ tests): confirm-before-delete dialog.

Docs

  • CONTEXT.md — Undo and Log Completed entries.
  • docs/adr/0024-undo-recorded-at-engine-writes.md — every shell attaches history; non-Engine writes via record.
  • docs/keyboard-shortcuts.md — new Undo section and updated Log Completed wording.

@MaplumeX
MaplumeX merged commit 33942ed into main Oct 13, 2026
4 checks passed
@MaplumeX
MaplumeX deleted the docs/toast-trigger-conditions branch October 13, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant