feat: history/undo + menu bar popover — v0.5.1 - #8
Merged
Conversation
set/export/import now append to the shared history log; openwith history lists recent events (-n, --json), openwith undo reverts the most recent set with drift protection (--force to override).
Ports prototype variants 1d/2b: tray icon opens a popover (extension lookup with picker, Recent Changes with per-entry Undo, open-main/quit footer), global shortcut ⌥⌘O, hide on blur. Backend gains an apps cache so popover lookups skip the rescan, plus picker/recent-changes commands. 'Show in menu bar' (default on) and 'Launch at login' (autostart plugin) settings are now functional.
Menu bar icons should be template images so macOS recolors them for light/dark bars and the pressed state; the glyph is the logo's document-with-arrow motif simplified for 22pt (SVG source alongside). Popover shadow drops from the prototype's mock-scale 18/50 to a native-feeling 6/22.
Undo semantics per the prototype's dUndo: the reverted event is marked undone and the revert recorded as is_undo. Recent Changes (popover) is an undo stack — entries disappear when undone, nothing is appended; the Profiles HISTORY panel becomes the full ledger and now includes sets and reverts (fixing set-history being menu-bar-only). CLI undo skips consumed events. mark_undone matches on new-handler and undoable state so same-second timestamp collisions can't leave an event eternally re-undoable (regression test included).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 2 of the GUI plan: the shared history log becomes actionable, and the menu-bar quick-access popover (prototype variants 1d/2b) ships.
History & undo
set/export/importnow record into~/Library/Application Support/openwith/history.json(sourcecli); coreimport_associationsrecords each applied set (sourceimport), so every mutation path is loggedopenwith history(relative dates,-n,--json) andopenwith undo— reverts the most recent set, refuses if the default drifted since the event (--forceoverrides), and records the revert itselfMenu bar
AppsCacheshared across windows so popover lookups skip the multi-second rescanVerification
fmt --check/clippy -D warnings/ 21 tests /tsc && vite buildall greenopenwith set md TextEdit→openwith historyshows it →openwith undo→openwith current mdback to Typora