Repository navigation
feat(webui): rebuild the shell and shared primitives - #3537
Conversation
The shell moves onto the grammar of docs/webui/design-system.md: a 200 px sidebar that collapses to a 64 px rail through ui-common SideNav's collapsible option (stored in the appearance preferences), a 52 px header that receives each route's title and actions from its PageHeader and folds actions that do not fit into one overflow menu, and a 28 px status bar that replaces the toolbar chips. The bar shows the running models, tokens per second and server reachability from the snapshot Activity already reads; the server publishes no instantaneous rate, so the rate is the growth of its cumulative decode counters between two runtime samples. Every non-ready state of the bar has a recovery action and a test id, and a model that starts is one status-bar item plus one notification entry. The primitives follow: buttons and fields at the control height with the neutral secondary pill, a feedback state and one shared confirm hook, the fixed destructive and stop verbs, a sized Dialog with a tab strip and body and footer slots, notice banners and the toast stack, the count badge, stat summary, stat-card row and timestamps, the 64 px empty-state icon and the 1.25 px icon stroke. Text fields change their border color on focus; every other control keeps the ring. Dialog stays on the native element: under the served CSP both it and ui-common Modal raise no violation, but Modal is not in the top layer, so opened beside the still-exported native Drawer it does not paint above it or take focus, and it needs six more style-carrying elements in the safe-layout allowlist. Drawer and Inspector stay exported for the screens that have not moved yet. Specs and unit tests are updated for every renamed class; test ids keep their values. Initial JavaScript grows by 9,023 bytes gzip (306,208 to 315,231). Refs #3520
…g decision docs/webui/design-system.md now states the shell geometry as built (sidebar and rail, header with the overflow menu, status bar and its compact form), the dialog sizes and slots, button feedback and the shared confirmation, the figure and timestamp primitives, and the notice rules. The Shell and localization section replaces the toolbar-chip text with the status bar: its three items, where their data comes from, how tokens per second is derived, and the recovery action and test id of every async state. The target markers for the icon stroke, the control height binding and the text-field focus are gone; the theme cross-fade and the rise-in stay marked as targets, with the reason. docs/webui/ui-common.md records why Dialog stays on the native element, with the served-CSP comparison against ui-common Modal, and updates the adapter matrix, the bridges, the CSSOM allowlist and the seam list. The UX contract and both user guides describe the new layout. Refs #3520
…gaps The compact override of the status bar height sat in styles.css, which app.css imports before tokens.css, so the base 28 px won and the bar rendered 46 px while everything that subtracts the token used 28. The override now lives in tokens.css after the base value, and the bar draws its hairline inside its box, so it is exactly 44 px below 1024 px. The shell's edge rules now outrank .material-glass, which had been framing the header, the sidebar and the bar on all four sides. A dialog body that scrolls is now a keyboard stop (a named region when the dialog has no tabs), so it can be scrolled when nothing inside takes focus. A signed-in session whose catalog has not arrived reads as still being reached and keeps Retry, so the bar's loading state always has a recovery action. The document sets scroll-padding for the sticky header and the fixed bar. The served-CSP spec waits for SideNav's rail motion, which holds an inert copy of the content area while it plays; found by running the spec against a preview build. The settings spec measures from the top of the page, since axe counts a control half under the sticky header as obscured. Refs #3520
The user guides said tokens per second needs --metrics and --slots. The slots endpoint is on unless the server starts with --no-slots, which a run against the release binary confirmed: without --metrics the status bar's reason names metrics only, and with --no-slots it names slots. The design contract also records two status bar gaps left for #3523: the rate's unit is not localized, and the reason control reads as "no running model selected" until the selected model's first runtime sample arrives. Refs #3520
Below 1024 px the route's actions live in the header, and at 390 px in its overflow menu, but only the header's icon buttons were raised to 44 px. Add Model, Rescan local roots, Refresh server state, New conversation, Refresh observations and Export sanitized diagnostics measured 31.5 px tall there, and the trigger of Activity's model picker 24 px, against the ux-contract rule that the header's controls are 44 px targets in the compact layout. The compact rule now covers buttons and Select triggers inside the header actions, and expectCompactToolbarHitTargets measures them too; the fold spec asserts it with the menu open. With the rule reverted that spec fails at 31.5 px. Also add unit cases for the tokens-per-second derivation: counters that fall (a model reloaded on the same server instance restarts its lifetime totals), tokens with no elapsed time, no growth, and a server restart clearing the history the rate is read from. Refs #3520
The toast stack is new in this change, and below 1024 px a toast's dismiss button measured 28 by 28 px, under the 44 px compact hit-target floor in ux-contract.md. A compact rule in the toast adapter CSS now raises a toast's buttons to 44 px. A shell spec now posts five toasts at 1440 and 390 px and asserts the stack is at most 360 px wide, flush right, above the status bar, shows three entries, and keeps its controls at 24 px and 44 px respectively. With the rule reverted it fails at 28 px. Refs #3520
Implementation Review SummaryIntent
Findings Addressed
Remaining Items
Verification
|
expectSafeLayout admitted custom-property style writes on every div inside an Astryx Banner header in a notice or toast. Only the header's end area (the action row) receives the StyleX edge-compensation margins, so the allowlist now names that element alone: a style write on the title, description or icon wrapper fails the layout check again. Validated with the shell spec and the served-CSP spec against a real secured server.
Security and performance reviewNo CRITICAL, HIGH or MEDIUM findings.
Fixed in bb2cac5 (LOW, test only): the Not fixed (LOW): while a model loads, every catalog update posts its "Preparing" notice again with the same content, so the toast stack re-renders once per catalog change. Gates on the final head: typecheck, lint, unit (810 tests), theme and agent checks, |
…ialog The Preparing notice for a loading model was re-posted on every catalog update, rebuilding the notice array and re-rendering the toast stack each time. useModelStartNotices now remembers the posted title per model and posts only when it changes. The header overflow trigger no longer sets aria-haspopup, since its panel is a group rather than a menu; aria-expanded, aria-controls and the Escape and focus behavior are unchanged. The gallery Dialog demo uses the Dialog footer slot instead of the old dialog-actions row. The design-system doc now states that the empty status-bar action is omitted on the Models route, which is already the recovery surface. Validation: typecheck, lint, unit (811), theme and agents checks, build_bundle --verify, verify-webui-contract, and Playwright shell and browser specs (chromium, 50 passed). Refs #3520
Bilingual report covering the rebuilt WebUI shell, the status bar's counter-derived rate, the native Dialog decision, the header fold and the remaining gaps.
The page scrolled under a sticky header that now holds route actions, so at some scroll offsets a content control sat half under a header control. axe target-size flagged the Settings request-defaults help button under the header's storage help button at 390 px in the CI engines spec; a scroll-offset sweep found four failing offsets. AppShell now runs in its fill mode: the main landmark is the one scroller between the header and the fixed status bar, so content never passes under chrome. Rules for the old sticky model are removed and Chat fills main. The settings spec's scroll-to-top workaround for the same overlap is removed, and the layout checks (expectSafeLayout, horizontalOverflow, the shell floor and the Activity fit test) now measure main as well as the document, so overflow inside the new scroller still fails them. At compact widths the header folded Activity's model picker behind More actions, so activity-performance.mjs (700 px window) could not find the combobox. The picker scopes the page, so it is now the first row of the content at every width, like the Chat and Settings pickers; header actions are buttons only, and the dead header-Select rules are removed. Tabbing to the picker showed no focus ring, since the trigger is a button inside the Select box; the box now draws the ring. Validation in a Linux container with the CI font packages: chromium suite 136 passed (three runs with two workers), engines spec chromium, firefox and webkit 17 passed, scroll sweep clean. typecheck, lint, unit (811), theme, agents, contract and bundle verify pass. Refs #3520
The scoped Settings spec timed out on CI at 390 px clicking a model option: the option went unstable, a profile input intercepted the click, and the option never became visible again. Forcing one non-live connection phase (a visibilitychange dispatch) with the list open reproduces that signature deterministically: the Model and Server tabs replaced their whole panel with the unavailable banner whenever the connection left ready, streaming or polling, so the selector unmounted, the content moved up under the list, and the selector came back closed. While signed in, both tabs now keep the selector (and the Model tab its next-load profile) mounted and replace only the live sections with the banner. A unit test pins it and fails without the fix. AppShell's fill mode clips its own box, so a header wider than the viewport never reached the document; a mutation at 195 px went unnoticed. The layout checks now measure the shell box too, and the shell floor reads a settled frame, since a route folds its header actions within its first frame. The Settings help buttons are 44 px targets below 1024 px. Validation in a Linux container with the CI fonts: chromium suite 136 passed, shell and settings specs 56 passed over two repeats, engines spec 17 passed in chromium, firefox and webkit, scroll sweep clean; typecheck, lint, unit (812), theme, agents, contract and bundle verify pass. Refs #3520
The report said the 390 px header fold hides Activity's model picker; the picker now stays in the content column with the Chat and Settings selectors, and only buttons fold. Refs #3520
Summary
Rebuilds the WebUI shell and the shared primitives on the grammar of
docs/webui/design-system.md(#3526). Screens keep their current layout inside the new shell until #3521 to #3524 move them.SideNavcollapsible, stored assidebarCollapsedin the appearance preferences. A 52 px header that receives each route's title and actions from itsPageHeader; actions that do not fit fold into one overflow menu. A 28 px status bar replaces the toolbar chips andTOOLBAR_CHIP_LIMIT. Below 1024 px the sidebar is the mobile navigation and the bar shows its one most important item, 44 px tall so it meets the hit-target floor. Chrome is glass in theglassfamily only.decode_rateis always unavailable), so the rate is the growth of its cumulative decode counters between two runtime samples. Without the metrics endpoint (--metrics) or the slots endpoint (on unless--no-slots) the bar shows reachability and running models only and says why on hover and focus. Each non-ready state (partial,empty,loading,stale,offline,error,unauthorized) has a recovery action and adata-testid. A model that starts is one status-bar item ("Preparing") plus one notification entry.useButtonFeedback), one shared confirm hook (useConfirm), the fixed destructive and stop verbs (ActionButton). A sizedDialogwith a pill-tab strip and body and footer slots.NoticeBanner, the inline error banner and a bottom-right toast stack (360 px, three at most).CountBadge,StatSummary,StatCardRow,Timestamp,DataTablerow padding from the contract. One 64 px icon in the empty state, the 1.25 px icon stroke. Text fields change their border color on focus; every other control keeps the ring.DrawerandInspectorstay exported fromprimitives.tsx. The gallery shows every primitive in its states. Strings are in English and Korean with the fixture.data-testidvalues keep their names; every spec that queried a renamed class is updated.Dialog decision
Dialogstays on the native<dialog>and does not wrap ui-commonModal. Both were built behind the same props and run through the served-CSP check against a realmlxcel-server --webui --api-key ...on loopback (default-src 'self'; script-src 'self'; style-src 'self'; ...).<dialog>Modalsecuritypolicyviolationevents, inserted<style>dialog,:modal, top layer, nostyleattributediv[role="dialog"], not in the top layerexpectSafeLayout<html>and<body>Drawer(390 px run; at 1440 px theModalcase left the Drawer unable to close, which ended that run)The policy permits both, since every style either one writes goes through CSSOM.
Modalsits below the top layer, and two confirmations render beside the Drawer they open from (the Models library's beside the inspector Drawer, Chat's delete beside the conversation-list Drawer), so those would be hidden and unreachable until #3525 removesDrawer. The decision and this table are indocs/webui/ui-common.md#dialog-decision.JavaScript growth
The initial growth is the header, the status bar, the sized Dialog and the Tooltip that carries the status bar's reason. The toast stack is its own chunk, fetched when the first notice is posted.
Real-binary validation
Release
mlxcel-server --webui --api-key ... -m <Qwen3 0.6B 4-bit checkpoint> --metrics --slotson loopback, serving this branch's bundle (the servedindex-*.jsandindex-*.cssnames matchsrc/webui/assets/), driven by headless Chromium.mlxcelandglass, light and dark, English and KoreanSizes are
getBoundingClientRectof AppShell's banner, AppShell's side navigation and the status bar. All 24 cases measured the same per viewport.1 running,qwen3-0.6b-4bit Ready,Server reachable; statepartial(no running model selected yet; the information control says so)tokens/s not yet measured; stateready216 tokens/s; stateready1 running,qwen3-0.6b-4bit Readyonly1개 실행 중,qwen3-0.6b-4bit 준비됨,216 tokens/s,서버 응답 중--metricspartial; the control's tooltip reads "Metrics are off. Restart the server with --metrics."--metrics --no-slotspartial; the tooltip reads "Slots are off. Restart the server with --slots."Computed styles on the same binary: icon
stroke-width1.25 px withvector-effect: non-scaling-stroke; h1 17.5 px at weight 600; buttons and text fields 31.5 px tall (2.25 rem on the 14 px root); field radius 5.25 px; a focused text field changes its border fromrgb(220, 220, 228)torgb(139, 92, 246)with no ring; a focused button draws the 2 px ring in that color.Screenshots of all 24 cases and of the live steps were captured locally. They are not embedded here because no image upload path is available from the CLI.
Deviations and open items
partialuntil then, the reason still reads "no running model is selected" until that model's first sample, and the unit reads "tokens/s" in Korean too. feat(webui): restyle Activity as a dashboard feeding the status bar #3523 owns the status bar content.models.status.*) is unchanged; only the status bar's starting item reads "Preparing".expectSafeLayoutgained three entries for styles the newly adopted library components write through CSSOM (a Banner's action row, a toast's progress fill, the CountBadge offset). "No new inline style outside the allowlist" is measured against the list with those entries.Changes during review
expectCompactToolbarHitTargetsnow measures them. Toast dismiss buttons get the same 44 px compact target, with a spec for the stack's width, position, count and targets.expectSafeLayoutallowlist is narrowed to the Banner's action row.aria-haspopup(its panel is a group, not a menu). The gallery's Dialog demo uses the footer slot. The status bar'semptystate documents why it offers no action on the Models route.src/webui/assets/by SHA-256.target-sizefailures on Linux at 390 px where a content control sat under a header control). The overflow assertions now measure the document, the shell box and main, and the shell-floor helper measures after two animation frames, because the header fold settles one frame after a route mounts.Values chosen where the contract gave none
Dialog widths 28, 40 and 60 rem; field radius
md(0.375 rem); the header title as heading 3; the compact status bar at 44 px; six iterations of the lifecycle pulse; 1.6 s of button feedback; 6 s for the "is running" notice. All are written intodocs/webui/design-system.mdand need the owner's confirmation.Test plan
webui/:typecheck,lint,check:theme-selectors,check:themes,check:agents,unit(811 tests),browser(136),browser:all(21)python3 scripts/webui/build_bundle.py --verify,make verify-webui-contract,make verify-webui-rust,make verify-webui-integration-fake(the router harness)playwright.csp.config.ts) against the release binary above: 2 passedindex.htmlmatchessrc/webui/assets/),make verify-webui-rust,make verify-webui-integration-fakebinary assets, which fails onmaintoo since feat(models): add LiquidAI d1-omni (d1_omni) decision model #3533 (an undeclared audio fixture), independent of this PRCloses #3520