diff --git a/crates/tunal/ui/components/menu.slint b/crates/tunal/ui/components/menu.slint index 0ddb8ce..782ad30 100644 --- a/crates/tunal/ui/components/menu.slint +++ b/crates/tunal/ui/components/menu.slint @@ -314,7 +314,7 @@ export component Menu inherits Overlay { } surface := MenuSurface { - property w: clamp(column.preferred-width, 112px, 280px); + property w: clamp(column.preferred-width, 180px, 280px); width: self.w; height: column.preferred-height; @@ -357,7 +357,7 @@ export component Menu inherits Overlay { // The parent row's top, so the first submenu row lines up with it. property row-y: surface.y + root.sub-row-y - Theme.space-1; - width: clamp(sub-column.preferred-width, 112px, 280px); + width: clamp(sub-column.preferred-width, 180px, 280px); height: sub-column.preferred-height; x: root.place(surface.x + surface.width - Theme.space-1, surface.x + Theme.space-1, self.width, root.width); y: root.place(self.row-y, root.height, self.height, root.height); diff --git a/crates/tunal/ui/theme.slint b/crates/tunal/ui/theme.slint index b5bf4bf..056d751 100644 --- a/crates/tunal/ui/theme.slint +++ b/crates/tunal/ui/theme.slint @@ -70,9 +70,10 @@ export global Theme { // Floating surfaces (menus, dialogs, toasts, tooltips): one soft shadow, mixed from // `shadow`. Resting surfaces have none. - out property float-shadow-blur: 12px; - out property float-shadow-offset: 4px; - out property float-shadow-opacity: 0.18; + out property float-shadow-blur: 24px; + out property float-shadow-offset: 6px; + // Dark surfaces need a deeper shadow to read as lifted. + out property float-shadow-opacity: root.dark ? 0.59 : 0.27; // Dims the window behind a modal dialog, mixed from `scrim`. out property scrim-opacity: 0.32; // Gap kept between a floating surface and the window edge. diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md index fc16f95..5270dd5 100644 --- a/docs/DECISIONS.md +++ b/docs/DECISIONS.md @@ -31,5 +31,5 @@ D-026 — 2026-11-18 — File operations run as jobs in `tunal-core::ops`: `Jobs D-027 — 2026-11-18 — UI sessions look at the user's other Material You apps (Damson, Mulberry, Nacre; egui) as design references for colour roles, state layers, shape, spacing and motion, porting ideas to our Slint Theme/Motion tokens; the stack (Slint 1.19) stays; library defaults that don't match are replaced by own components — user — all UI plans (S004–S031, S034, S035). D-028 — 2026-11-18 — The user's old, buggy Tunal prototype (`/home/astar76/Documents/Apps/tunal-files/tunal/`, Python) is a UI reference only: look at its screens and elements for ideas (layout, panels, playlists, tag editor, dialogs), never copy its code, never port its bugs; the new UI should be fresh, not a re-skin — user — all UI plans, S008 (playlist sort), S021, S023. D-029 — 2026-11-18 — Orchestration: backend-only plans whose dependencies are done and whose files are a crate of their own (S017, S019, S020, S022, S025, S027) may run out of INDEX order in the second parallel slot beside the UI chain; still at most 2 sessions at once; each commits with explicit paths — orchestrator (user asked to keep everything runnable going) — S017–S027. -D-029 — 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-030 — 2026-11-18 — Playlist sort refined (supersedes D-021's details, keeps its UI): candidate playlists come from the viewed folder and from /Playlists (also playlists/Playlist/playlist); only playlists with ≥ 1 track in the viewed folder are offered, one "Playlist sort" option each; preselected = the playlist named after the folder, else the one with most tracks from it; subfolders sort by their first listed track; tracks that moved still match by file name; formats .m3u .m3u8 .pls .xspf .wpl, text decoded utf-8 → utf-16 → cp1252 → latin-1; ordering stays listed-first in playlist order, rest natural name order, desc reverses — orchestrator, from the user's old prototype behaviour (D-028) — S008. +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). diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md index 923b875..8e3cc83 100644 --- a/docs/PROGRESS.md +++ b/docs/PROGRESS.md @@ -44,7 +44,7 @@ One entry per session, newest last, ≤ 15 lines: done, verified how, not done, ## S005 — Menus, dialogs and toasts - Done: `components/overlay.slint` `Overlay { open, modal, enter/exit-duration; out progress; dismissed; place() }` (full-window layer, scrim, outside click/scroll swallowed, hidden once its exit ends). `Menu { items: [MenuItem { text, icon, shortcut, disabled, separator, submenu: [MenuEntry] }], leading-icons; activated(index, sub-index), closed; open-at(x, y), expand(i), close() }`: scale + fade from the anchor, flips/clamps at window edges, arrows skip separators/disabled, Right/Left/Enter/Space/Esc, hover opens the submenu. `Dialog { title, body, actions: [DialogAction { text, kind }], default-action, cancel-action, dialog-width, content-focus; action(i), focus-content; show(), close() }` + children slot: scrim fade, scale-in, Enter/Esc/scrim click, Tab wraps inside. `ToastStack { toasts: [ToastData { message, action, cancellable, progress-kind: ToastProgress, progress, closing }], toast-width; action(i), cancelled(i), removed(i) }`: slide/fade in and out, animated re-stack, auto-dismiss after `Motion.toast-timeout` (paused on hover), determinate bar / indeterminate sweep. `Tooltip` moved to `tooltip.slint`, fades in. `StateLayer.has-focus` + `grab-focus(ring)`. Tokens: `Theme.float-shadow-*`, `scrim-opacity`, `window-margin`; `Motion.enter-scale`, `toast-timeout`, `indeterminate-period`; 9 icons. `tunal --gallery --page menu|dialog`. -- Overlay API: put `ToastStack`, `Dialog`, `Menu` last in the window (`width: 100%; height: 100%`), then `menu.open-at(btn.absolute-position.x, btn.absolute-position.y + btn.height)`, `dialog.show()` / `close()` from `action`, append `ToastData` to the model and remove it on `removed(i)` (D-029). +- Overlay API: put `ToastStack`, `Dialog`, `Menu` last in the window (`width: 100%; height: 100%`), then `menu.open-at(btn.absolute-position.x, btn.absolute-position.y + btn.height)`, `dialog.show()` / `close()` from `action`, append `ToastData` to the model and remove it on `removed(i)` (D-031). - Verified: workspace build, clippy -D warnings, fmt --check, literal grep empty; looked at menu/dialog pages light + dark at 960×640, menu flipped at 720×480, controls page unchanged. Keys injected once through a temporary, uncommitted `dispatch_event` hook: arrow skip and wrap, Esc closing submenu then menu, Enter activating, dialog Tab/Shift+Tab wrap, Enter default, Esc cancel. - Not done: motion (scale, slide, re-stack, sweep) not watched live (screenshots force reduced motion; software renderer ignores `transform-scale`, D-025); pointer outside-click and hover-open not exercised. Dialog content should hold one focus stop: a `TextField` with text has two (input + clear), so Shift+Tab from its clear button wraps to the last action. - Later: focus doesn't return to the opener by itself (use `closed` / after `close()`); a menu opened from a button flips to end at the anchor point, not above the button.