S016: chrome and menus redesign: pill tabs on springs, address pill, toolbar badges, page card, floating flyouts

Tabs slide to their slots with a sliding selection pill and drag under the
pointer; the address field is a pill with a site chip, host emphasis and a
star that fills; flyouts and menus share one floating surface that springs
open and fades closed. Web page corners are masked over the GL blit.
tests/smoke/chrome.txt shoots the chrome and every flyout dark and light.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-11 20:11:33 -06:00
commit 72d06510b2
2 changed files with 1758 additions and 722 deletions

View file

@ -220,6 +220,26 @@ while something plays), `shadow(painter, rect, radius, dark)` (one soft shadow f
a font family); shadows are tessellator-blurred rectangles only (not arbitrary shapes); `Ui::id`/`Id::new` are
deprecated in 0.37 but still used across the code.
**Chrome** (S016, `src/ui/chrome.rs`). Everything behind the chrome and around the page is `chrome::chrome_fill`
(`surface_container`); the page is a card with margin `GAP_S` (sides and bottom) and radius `L`. Web pages are
blitted as rectangles, so `ui::card_corners` paints a ring in the chrome colour over the corners (works over the GL
blit). Heights: tab strip 44 (tab pills 34, gap 4, width 76..240, pinned 44, +24 with an audio button), toolbar 52
(address pill 40), bookmarks bar 36 (chips 28), title bar 36, app bar 44; buttons inside tabs and the address field
are 24. Tabs slide to their slots with `DEFAULT` springs, the selection pill (secondary_container) slides between
them, a dragged tab stays under the pointer (`theme::spring_jump`) and the others make room (`drag_layout`); a
window resize jumps instead of sliding. Toolbar order: back, forward, reload, home, incognito | address | passwords,
history, bookmarks, downloads, qr, apps, devtools, pip, screenshot, adblock, media, vpn, profile, menu (each shown
per the toolbar setting). Status on buttons: badges (blocked count, running downloads), a progress ring round
downloads, a coloured dot on the VPN, a slash through the shield when off. All icons are Material Symbols (D-009).
**Floating surfaces** (`src/ui/menus.rs`). `menus::floating(ctx, id, pos, pivot, open, |ui| ..)` draws a
`menus::surface` (surface_container_high, radius `L`, popup shadow) that grows from its pivot corner (scale 0.9 to
1, `DEFAULT`) and fades in (`EFFECT`); with `open` false it shrinks and fades without input, then returns None.
Flyouts keep the last one drawn so it animates out; switching flyouts closes one while the other opens. Rows:
`menu_item(ui, icon, label, trailing, selected)` (34 high, icon column, label cut with an ellipsis, shortcut or
detail on the right), `divider`, `empty`, `one_line` (text cut to a width). egui popups (`Popup::menu`, submenus)
use the same `surface` frame. Areas need `default_size` set or egui caps them at 600×400.
## Feature checklist
See `docs/FEATURES.md`; every row names the file that implements it and its review state.

View file

@ -68,6 +68,22 @@ One entry per session, newest last, ≤ 15 lines: done, verified how, not done,
- Later: chrome toolbar glyphs still drawn at text size via egui Buttons (S016); `egui::Ui::id`/`Id::new`
deprecation warnings across src/ui.
## S016 — Chrome and menus redesign (2026-11-11)
- Done: chrome.rs rewritten: pill tabs on springs (selection pill slides, drag under the pointer, others make room),
round +, 52 pt toolbar of icon buttons with badges/progress ring/VPN dot, address pill (site chip, "Not secure",
host emphasis, zoom/install chips, star that fills), suggestions as a floating menu, bookmarks bar chips + empty
hint, page as a rounded card (corners masked over the GL blit). menus.rs: `floating` (spring open/close), `menu_item`;
every flyout and the page menu restyled (wavy download/seek bars, cookie artwork with dot visualizer, morphing play).
Measurements: DESIGN.md "Chrome". Main menu: Save page/PDF/QR/Install/Shortcut moved into "Save and share".
- Shots: `tools/smoke.sh tests/smoke/chrome.txt` (target/smoke/s016f-chrome): chrome-dark/light, main(-opening)-dark,
main-light, downloads, shield, vpn, siteinfo, qr, tabmenu (dark+light), media(-playing), profiles, apps, back,
bookmark, suggest-dark, narrow-light. selftest: `flyout tabmenu|back|bookmark`, `type <text>`.
- Verified: chrome, launch, restore, painters, gallery smoke exit 0; 40 unit tests (+drag_layout, address_job).
- Not done/seen: S006 basics scripts don't exist yet (ran the four above instead); page right-click menu, hover,
press and a live tab drag not in screenshots (no pointer in selftest for chrome); no real-GPU check.
- egui limits hit: Area capped at 600×400 unless `default_size`; Xvfb never focuses the window, so text focus drops
(selftest `type` sends Focused(true)); stale TextEdit selection shows after focus leaves (cleared by hand).
## Later
- Reader mode, split view, translate, real gamepad rumble (D-002: not planned for now).
- Packaging and first release (D-001: plan when the user asks).