S005: overlay layer, menu with submenu, modal dialog, toast stack

Menus, dialogs and toasts draw on an own full-window layer so they can
play exit motion; gallery pages show them open for screenshots.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-18 10:06:17 -06:00
commit c94b868b2e
2 changed files with 1071 additions and 40 deletions

View file

@ -10,12 +10,12 @@ Surfaces with entry and exit motion: a popup menu (icons, shortcuts, separators,
CLAUDE.md §2 Motion rules; `animate` skill; crates/tunal/ui/components/*.slint from S004.
## Steps
- [ ] Overlay layer in the window for menus/dialogs/toasts (Slint `PopupWindow` closes instantly, so exit motion needs our own layer); clamp to window edges.
- [ ] `Menu`: opens scaled from the anchor, keyboard navigation (arrows, Enter, Esc), submenu, disabled items, closes on outside click.
- [ ] `Dialog`: scrim fade, surface scale-in, title/body/actions slots, Esc and default button, focus stays inside.
- [ ] `Toast` stack: message, progress bar (determinate/indeterminate), action and cancel; slide in/out, re-stack animated. `Tooltip` after hover delay.
- [ ] Gallery states for menu open, dialog open, two toasts; screenshots.
- [ ] PROGRESS entry, INDEX line, commit `S005: …`
- [x] Overlay layer in the window for menus/dialogs/toasts (Slint `PopupWindow` closes instantly, so exit motion needs our own layer); clamp to window edges.
- [x] `Menu`: opens scaled from the anchor, keyboard navigation (arrows, Enter, Esc), submenu, disabled items, closes on outside click.
- [x] `Dialog`: scrim fade, surface scale-in, title/body/actions slots, Esc and default button, focus stays inside.
- [x] `Toast` stack: message, progress bar (determinate/indeterminate), action and cancel; slide in/out, re-stack animated. `Tooltip` after hover delay.
- [x] Gallery states for menu open, dialog open, two toasts; screenshots.
- [x] PROGRESS entry, INDEX line, commit `S005: …`
## End criteria
- `cargo build --workspace`, `cargo clippy --workspace --all-targets -- -D warnings` and `cargo fmt --check` pass.

View file

@ -13,7 +13,7 @@ Tracker: https://claude.ai/artifact/4X8YCk3cQjUGyuyCqGuU7v
- [x] [S002 — Portal theme and Material schemes](02%20App%20skeleton/S002-theme-portal.md) · Opus high
- [x] [S003 — Window, Theme and Motion globals, screenshot command](02%20App%20skeleton/S003-window-tokens.md) · Opus high
- [x] [S004 — Base animated controls](02%20App%20skeleton/S004-base-controls.md) · Opus high
- [ ] [S005 — Menus, dialogs and toasts](02%20App%20skeleton/S005-menus-dialogs.md) · Opus high
- [x] [S005 — Menus, dialogs and toasts](02%20App%20skeleton/S005-menus-dialogs.md) · Opus high
## 03 File browsing