S011: file operation actions, inline rename, clipboard, jobs bridge and dialogs

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-18 14:56:03 -06:00
commit 23b6ea2568

View file

@ -108,5 +108,12 @@ One entry per session, newest last, ≤ 15 lines: done, verified how, not done,
- Not done: no real device (S036). Workspace-wide clippy/fmt currently fail only in S011's in-progress `crates/tunal/src/{smoke,actions,jobs_bridge}.rs`. Events only decoded, not acted on. I touched `crates/tunal-devices/src/lib.rs` (one `pub mod mtp;` line) and added `examples/`, outside `src/mtp/**`.
- Later: MTP class Cancel request (0x64) for aborting a running transfer; GetObjectPropsSupported checks; event-driven refresh (ObjectAdded/Removed) in S026.
## S011 — File operation actions
- Done: `actions.rs` registry `Action` (id, label, glyph, shortcut, `enabled(&Context)`), used by the key hook (`action-key`), the context menu (right click on a row or the empty area; default layout, Trash has its own) and the toolbar's ⋮ menu. **Action ids**: `cut` Ctrl+X, `copy` Ctrl+C, `paste` Ctrl+V, `copy-path` Ctrl+Shift+C (system clipboard through a hidden `TextInput`), `rename` F2, `new-folder` Ctrl+Shift+N, `trash` Del, `delete` Shift+Del (confirm), `restore`, `empty-trash` (confirm). Internal clipboard (`Clipboard { uris, cut }`; cut items dimmed in every pane through `FolderModel::set_cut`).
- Inline rename: `DetailRow.editing`, `FolderState.edit-row/edit-select`, `components/rename-field.slint` (base name preselected, Enter accepts, Esc cancels, moving the cursor ends it); new folder is made at once as `New folder (N)` and its name edited when it shows (`FolderModel::select_when_shown`). `jobs_bridge.rs` `Bridge`: progress toast after 300 ms (determinate, cancel), summary toast, conflict dialog (`dialogs/conflict.slint`: both sides' size/date, apply to all, Skip/Keep both/Replace or Merge), item error dialog (Retry/Skip/Skip all/Abort, Esc = Skip; marked `// S016` for the elevation hook), failure list after a job, confirm dialog; prompts queue one at a time; panes whose location can't watch (the Trash) list again after each job (`FolderModel::refresh`).
- Verified: workspace build, clippy -D warnings, fmt --check, literal grep empty. Temporary uncommitted harness (own event-loop platform on the software renderer, scratch dir, `XDG_DATA_HOME` in the scratchpad), real window callbacks: copy + paste onto a name → conflict dialog screenshot, Keep both → `file (2).txt`; cut dims; F2 → field screenshot, rename on disk; Ctrl+Shift+N → `New folder`, named; Del → Trash; `trash:///` screenshot and menu, Restore → back at its place; Shift+Del → confirm, delete on disk.
- 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.
## Later
-