S010: tabs, split view, breadcrumb, history, places sidebar and config

Shell with one folder model per pane, back/forward/up history, editable
breadcrumb with folder completion, draggable pill tabs, places with
bookmarks in places.toml, session restore and a status bar.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-18 14:37:15 -06:00
commit a1647a662d
2 changed files with 2887 additions and 114 deletions

View file

@ -35,3 +35,4 @@ D-030 — 2026-11-18 — Playlist sort refined (supersedes D-021's details, keep
D-031 — 2026-11-18 — Floating surfaces don't use `PopupWindow` (it closes without exit motion): `Menu` and `Dialog` inherit `Overlay` and `ToastStack` is a plain layer, each placed last in the window at `width: 100%; height: 100%` in the order ToastStack, Dialog, Menu; they open with window coordinates and play exit motion by animating a `progress` that reverses mid-flight. Dialogs never close themselves (owner calls `close()` from `action`); toast models are owned outside (`closing` ends one, `removed(index)` drops it). Tooltips stay on `PopupWindow` (fade in, leave at once) — S005 — every UI plan with menus, dialogs or toasts (S010–S013, S018–S031).
D-032 — 2026-11-18 — Folder views use `folder::FolderModel` (one per view, `Rc`, a Slint `Model` of `DetailRow`s formatted on demand; worker results reach it through `upgrade_in_event_loop` + `as_any` downcast and carry a generation); selection is a set of raw names (`click`, `navigate`, `select_all`); sort menus are built in Rust as `[MenuItem]` and opened at window level (D-031); list rows set `StateLayer.focusable: false` and the view's `FocusScope` owns the keys; watch events are hints (unchanged stat is ignored: the local backend also reports reads) — S008 — S009–S015.
D-033 — 2026-11-18 — View mode and list motion: `ViewMode { details, grid }` (views/details-view.slint) lives in `folder::Settings::mode`, so one per `FolderModel` = per pane, carried over between folders like the sort, and reaches the views as `FolderState.mode` (`set_mode`); `.directory` view settings read and write that field. `FolderView` (views/view-switch.slint) stacks both views and cross-fades them; `ViewSwitch` is the segmented control. List changes (sort, filter, hidden, watch, playlist re-sort; not listing chunks) animate from Rust-computed per-row `from`/`to` offsets and leaving copies, drawn from one `MotionClock` (motion.slint, `animation-tick()` while running only), length `MotionPrefs.list-change` (0 under reduced motion = no transition); instant above 2000 rows. Opening with `open_travel(uri, Travel)` slides content from the right (into, forward) or left (up, back) — S009 — S010, S015, S018 (grid thumbnails in `GridCell`).
D-034 — 2026-11-18 — Window shell API: MainWindow holds `panes: [PaneData { rows, lines, folder, title, glyph }]` for the current tab and every folder-view callback takes the pane index first (`sort-by(int, SortColumn)`, `row-activated(int, int)`, `view-mode-selected(int, ViewMode)`, …); toolbar, breadcrumb, sort menu and status follow `active-pane`. Rust side: `shell::Shell` owns tabs/panes and binds those callbacks; one `FolderModel` per `shell::pane::Pane`, worker results routed by pane id; `folder::attach` is gone. Config goes through `config::{load, store}` (TOML in `$XDG_CONFIG_HOME/tunal/`), later settings are new fields on `config::Settings`; sidebar sections Devices/Network are filled with `Places::set_section` — S010 — S011–S015, S024–S029.

View file

@ -92,5 +92,12 @@ One entry per session, newest last, ≤ 15 lines: done, verified how, not done,
- Not done: navigation slide and live motion not watched (no event loop offscreen; S035); `tunal --screenshot` in the grid view shows one column until S010 keeps the Shell alive in its screenshot path. Screenshot env `TUNAL_VIEW=grid` added.
- Later: a live switch to reduced motion during a change leaves its leaving rows until the next change; entering rows interrupted mid-growth jump to full height; grid thumbnails (S018) go in `GridCell`.
## S010 — Tabs, split view, breadcrumbs, history and places
- Done: `config.rs` (`$XDG_CONFIG_HOME/tunal/<name>.toml`, `load` with defaults, atomic `save`/`store`; `Settings { restore_session, show_sidebar }`, `Session { tabs: [{ panes: [uri], active }], current }` saved on window close). `shell/`: `Shell::attach(ui, locations, tabs, blocking)` owns tabs (rows in opening order + `slot`), one `Pane` per view (`pane.rs`: own `FolderModel`, back/forward stacks, `open_travel` into/up/back/forward, deliver by pane id), split toggle (F3, new pane active), active pane header; `path.rs` crumbs (Home stands in for its path, `File system`, `Trash`), typed paths (`~`, `..`, relative, any `scheme://`), folder completion off-thread; `places.rs` (home + `user-dirs.dirs` + Trash, bookmarks in `places.toml` with rename/move/remove menu and dialog, collapsed sections; `Places::set_section(Section::Devices|Network, Vec<Place>)` for later plans, `#[expect(dead_code)]` until used). UI `ui/shell/{tab-bar,toolbar,breadcrumb,pane,sidebar,status-bar}.slint`; MainWindow is per pane now (D-034). Mouse back/forward via the winit event hook (`unstable-winit-030`). `StateLayer` gained `pointer`, `moved`, `mouse-x`, `pressed-x`. `tunal [<dir>…] [--split a b]`.
- Open a URI in a new tab: `Shell::open_tab(vec![uri]); show_current()` (private; add a `pub fn` when a plan needs it from outside the shell).
- Verified: workspace build, clippy -D warnings, fmt --check, literal grep empty; looked at light + dark 1200x760 with two tabs, split view and sidebar, restored session (3 tabs, bookmarks, collapsed section), breadcrumb editing with completion list. Temporary uncommitted hook in a scratch copy: history (into/up/back/forward/crumb), typed paths, completion of 5 inputs, select-all status, tab new/move/cycle/close, split, bookmarks add (deduped)/move/rename/remove, session + places files written and read back; real key and pointer events through the window: Ctrl+T/W/Tab, Ctrl+L + typing + Enter/Esc, Alt+arrows, F3, F9, middle-click close, drag tab to front, click empty breadcrumb, place and crumb clicks.
- Not done: mouse back/forward buttons not exercised (winit only; no live window). Tab and section motion not watched (software renderer ignores `transform-*`; screenshots are single frames). Completion list delivery needs the event loop (logic and list checked separately). A closed tab vanishes at once; the others slide over.
- Later: tab bar scrolling past the minimum width; drag-reorder bookmarks in the sidebar; per-place glyph on tabs (Music shows a plain folder); Backspace to go up.
## Later
-