S013: settings dialog, editable context menus (menus.toml), menu editor

Shared files actions.rs, app.slint, main.rs, shell/mod.rs carry S012 hunks and are committed with S012.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-18 18:46:11 -06:00
commit f7af0f56b4

View file

@ -115,5 +115,12 @@ One entry per session, newest last, ≤ 15 lines: done, verified how, not done,
- Not done: no live window (pointer right click, Esc in the field, real typing, toast cancel, drag); Rename choice in the conflict dialog (only Skip/Keep both/Replace); the error dialog and failure list were not shown (no failing job triggered); system clipboard copy of files for other apps and drag and drop are later plans; a watch event while a name is edited rebuilds the field (typed text is lost).
- Later: accept on blur needs a way to tell focus loss from a row rebuild (rows rebuild on every pane change); Undo toast; a numbered-rename field in the conflict dialog; reveal row after paste.
## S013 — Settings dialog and editable context menus
- Done: `settings.rs` `SettingsUi` (dialog `dialogs/settings.slint`, pages General, View, Previews placeholder, Motion, Context menus; every change stored in `settings.toml` and applied at once: hidden/folders first to open panes, view/sort/group are defaults for new panes, Motion through `theme_bridge::set_motion`). `menus.rs` `Menus` (`menus.toml`, one id list per `Context::{File, Folder, Multiple, Empty, Trash}`, `-` = separator, missing context = default, unknown ids skipped). `dialogs/menu-editor.slint`: add (click), remove, reorder by grip drag or arrow buttons (animated slots, applied after settle), separator, reset. Context menus and the toolbar ⋮ menu are built from the model (`Actions::menu_items`; right click on empty area = Empty, ⋮ = by selection). Action `settings` (Ctrl+,) is in the registry, default in the Empty menu.
- Add an action: new `Action` variant in `actions.rs` (+ `ALL`, id/label/glyph/shortcut/enabled/run). It shows in the editor's "Add" list at once. To put it in a default menu add its id to `Context::defaults` in `menus.rs` (users with an edited menu add it themselves; a menu never edited gets it).
- Verified: build, fmt --check, literal grep empty; screenshots of View and Context menus pages; with a temporary hook (removed) moved `delete` to the top of File, `menus.toml` written, restart showed the new order in the context menu. Clippy: only S012's unused `smoke` methods fail.
- Not done: sidebar place menu still its own fixed list (Open in new tab, bookmark edit). No live drag run (pointer drag, motion); clippy not clean until S012 lands. `TUNAL_SETTINGS=<page>` opens the dialog in a screenshot. Shared files `actions.rs`, `app.slint`, `main.rs`, `shell/mod.rs` hold S012 hunks too: left uncommitted here.
- Later: autoscroll while dragging in a long menu; Previews page (S018); sidebar menu from the model.
## Later
-