Skip to content

feat(webui): redesign the model library as a dense list with row actions - #1930

Merged
inureyes merged 17 commits into
mainfrom
feature/issue-1918-model-library-redesign
Sep 25, 2026
Merged

inureyes merged 17 commits into
mainfrom
feature/issue-1918-model-library-redesign

Conversation

@inureyes

@inureyes inureyes commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Closes #1918. Part of #1910.

The Models library becomes a dense list where each row is the unit of work: Load, Use in Chat and Unload are reachable from the row, and internal state is no longer copy.

What changes

  • Rows are one 33 px line with a fine pointer (28 px row controls; touch keeps 32 px): name (truncated, full text in title), size, quantization or weight dtype, task badges in declared order, state, and actions. A row shows Use in Chat when chat is available, Unload on any Ready row, and Load otherwise (disabled while it cannot load). Every row has an "Inspect {name}" icon button (the fix(webui): make the whole model library row open the inspector #1901 row primary) and cache rows a danger Delete. Row and inspector share one openAction(kind, entry) path, so the stale, capacity and eviction confirmations are unchanged; a row loads with that entry's own profile (loadProfileFor). Focus follows a row action to the control that replaces it (Load after Unload).
  • Sorting moved to the Name, Size, Quantization and State headers in controlled mode, pinned to ready, then transitions, then the rest. The Sort select and its strings are gone. Source and Task filters show labels.
  • Inspector: a pane at 1100 px and wider, a right drawer (role="dialog", "Model details", the shared Drawer with width="medium" side="end", the same variant Chat's settings drawer uses) below it. Overview and capability badges up top; ids, reasons, profile, removal notes, disabled server actions, roots and the docs link sit in a Details disclosure that renders nothing until opened. In the drawer, Tab stays inside the panel (the Details summary included) and Escape in a confirmation closes only the confirmation. The row Load goes through load-action.ts (from feat(webui): rebuild Chat as a conversation view #1931), shared with Chat.
  • Removed: Library operations, the provider-summary paragraph, the disabled-actions list and the permanent roots disclosure. Kept: download pseudo-rows (op: keys), Load with eviction after a capacity conflict, and the models-pending status line. Roots are the empty state's action.
  • Server: nullable dtype in CatalogMetadata from config.json torch_dtype/dtype (top level, then text_config), normalized to bf16/fp16/fp32/fp64, with float8_*, int8 and uint8 passed through as written; anything else (including auto) is null. Required and nullable in api.yaml; DTO, fixtures and catalog.md/.ko.md updated. No schema-version bump.

Drawer reconciliation with #1931

Both PRs added an end-anchored Drawer. The adapter keeps one API, main's width/side modifier classes over the constant inline sheet width, and one Tab wrap computed at key-press time: it wraps at the panel's first and last usable stops, counts a Details summary, skips a closed details' contents, and stops every Tab inside the panel in the capture phase so the package's stale handler cannot wrap early. It keeps main's IME Escape guard and main's rule that an Escape inside an open native dialog belongs to that dialog, plus this PR's fixes: a drawer confirmation's Escape leaves the drawer open, and a Tab pressed with focus on no element enters the panel. Chat's and Models' drawer tests all pass.

Deviations from the issue

  • Unload appears on any Ready row, not only a chat-capable one: an embedding or rerank model would otherwise have no row path to unload.
  • The feat(webui): app shell shows loaded models, uses PageLayout/PageHeader, and completes the global shortcuts #1914 shell did not move connection.authenticated.detail into the sidebar footer. This PR puts it inside the footer's Connection details disclosure (desktop copy only, so the test id names one element).
  • ui-common alpha.19 DataTable sorts rows itself even in controlled mode, so columns use a sortComparator carrying the lifecycle pin instead of a bare sortValueAccessor.
  • SkeletonRow mounts one role="status" per row, breaking refactor(webui): adopt every shared @lablup/ui-common component #1902's single-status contract; the loading slot keeps LoadingStatus with 8 decorative rows.
  • Below 1100 px the drawer opens only on Inspect, row activation, or a chip/palette request, not from a remembered selection.
  • Columns give way as the list narrows (tasks below 60rem, size and quantization below 44rem, state below 32rem); the name cell then carries state and, for downloads, progress.
  • No screenshot baselines or SHA256 table exist since chore: stop committing binary assets and guard against new ones #1904, so that item does not apply.
  • Also fixed: the 390 px scrollable-region-focusable violation (an overflowing table box becomes a named focusable region) and bidi isolation of names in dialog sentences.

Validation

Rust test first, before the fix:

test server::webui::catalog::tests::dtype_reports_the_declared_weight_dtype_and_null_when_unknown ... FAILED
assertion `left == right` failed: bf16
  left: None
 right: Some(String("bf16"))

After: ... ok; server::webui (79 tests), clippy and fmt pass.

After merging main at 18fda739 (#1928 Settings, #1931 Chat): typecheck, lint, unit (35 node + 664 Vitest), check:theme-selectors, Chromium Playwright (119, including chat.spec.ts), build_bundle.py --verify, check_webui_contract.py and check_binary_assets.py pass. The row spec drives load, chat and unload through models-row-* only; the drawer focus specs fail with their fixes reverted.

Page measurements, mock API, 120 entries:

Viewport Height before Height after Words before Words after Rows in view before after
1440x900 2514 px 1176 px 346 281 5 19
390x844 4190 px 2083 px 346 128 0 5

Real-binary acceptance: pass, mlxcel-server built from this branch (--release --features cuda, GB10, embedded bundle) with --models-dir over the real 187-checkpoint library, --api-prefix /lab --no-models-autoload --settings --props --metrics --webui, driven by headless Chromium:

  • Searching qwen3-0.6b-4bit and pressing the row's Load reached Ready with Use in Chat and Unload in the row. Use in Chat opened #chat. Back on Models, the row's Unload plus confirmation returned the row to Unloaded with focus on its Load button, and the catalog reported lifecycle.state: unloaded and worker_exit_observed: true. No page errors, and no mdl_ or op_ text on the page.
  • Real catalog, unfiltered: 1440x900 is 1,177 px with 19 rows in view and 266 words (issue baseline 3,132 px, 4 rows); 390x844 is 2,107 px with 5 rows in view and 125 words (baseline 5,936 px). No horizontal scroll at either width. The Quantization column shows bf16, fp16 and fp32 for unquantized checkpoints.

Hardening

  • The drawer's document key handler backs off whenever a native modal is open. Before, an Escape from <body> (after a pointer press on a confirmation's text) closed the drawer under the confirmation.
  • A row Load or Unload that is refused or fails no longer leaves its focus intent armed. Before, the row pulled focus to Use in Chat whenever it became Ready later by any path. Focus now returns once to the pressed control, a cancelled confirmation drops the intent, and focus moves without scrolling.
  • Widening past 1100 px forgets an open drawer, so narrowing again does not reopen it unasked.
  • The inspector hides a zero context: after an unload the runtime keeps its revision with ctx_size 0 and showed "Effective context (tokens) 0". Found in the real-binary run above (that run's binary predates only this one-line change).
  • Each fix has a jsdom test that fails with the fix reverted. Typecheck, lint, unit (35 node + 666 Vitest), theme selectors, Playwright models/ui-common-components/chat/shell (47), build_bundle.py --verify, contract and binary-asset checks pass.

Known and left as LOW: the page behind the drawer is not inert (Tab and Escape are handled); row button labels interpolate names without bidi isolation, because the pinned Inspect {name} accessible names would change; a failed download row shows the server's error.message (pinned by screen.test.tsx), an accepted exception to the Details-only rule; with the lifecycle pin, an unloaded row returns to its sorted position, which can be a later page when no search is active.

The Models library printed "Unknown" in the quantization slot for every unquantized checkpoint because nothing in the catalog read the dtype a config declares. CatalogMetadata now carries a nullable dtype, read from config.json torch_dtype (or dtype in newer exports), at the top level and then under text_config, and normalized to a short name (bfloat16 becomes bf16). Anything else passes through only as a lowercase ASCII identifier of at most 32 bytes; auto, non-strings and oversized values are null.

The field is required and nullable in docs/webui/api.yaml, the generated DTO and the catalog fixtures carry it, and docs/webui/catalog.md and its Korean translation describe it. The new catalog test asserts the wire shape for twelve config variants and failed before the change (the key was absent).

Refs #1918
The Models page showed four rows per 1440x900 viewport, kept Load, Use in Chat and Unload inside the inspector, and printed opaque ids, raw reasons and a Library operations list as copy. Each row is now one line: name, size, quantization or weight dtype, task badges, state and actions (Use in Chat and Unload when ready, Load otherwise, Inspect as the #1901 row primary, Delete for cache rows). Row and inspector share one openAction path, so the stale, capacity and eviction confirmations are unchanged, and a row loads with that entry's own profile.

Sorting moved to the column headers in controlled mode with one comparator (ready first, then transitions, then the rest), because alpha.19 re-sorts the page itself. Below 1100 px the inspector is a drawer that opens only on an explicit request, and a confirmation closed from it keeps focus in it. Ids, reasons, profile, removal notes and roots sit in a Details disclosure that renders nothing until opened. Operations are gone except download pseudo-rows and a Load with eviction button after a capacity conflict; the provider summary moved into the sidebar's Connection details. Filters use labels, names in dialog sentences are bidi-isolated, and an overflowing table box becomes a focusable region, clearing the known scrollable-region-focusable violation at 390 px.

Refs #1918
Rebuilt with python3 scripts/webui/build_bundle.py from the redesigned sources; build_bundle.py --verify passes.

Refs #1918
@inureyes inureyes added type:enhancement New features, capabilities, or significant additions priority:high High priority area:architecture Architecture and code structure changes status:review Under review labels Sep 19, 2026
Review of the library redesign found four places where a row or the drawer lost a required action or keyboard path.

- A Ready model without chat (embedding, rerank, transcription) showed a disabled Load and no Unload. The Actions cell now follows the lifecycle: Use in Chat when chat is available, Unload on any Ready row, Load otherwise. After a row Load, focus lands on Use in Chat, or on Unload for a model without chat.
- Below 44rem the Size and State columns give way, and download pseudo-rows have no inspector, so a download at 390 px showed no progress or state. The name cell now carries both as a fallback shown only once those columns are hidden.
- Escape in a confirmation opened from the inspector drawer also closed the drawer. The Drawer adapter now leaves an Escape inside a native dialog to that dialog, which returns focus to its opener in the drawer.
- alpha.19 builds the drawer's Tab trap once on open and omits summary, so the Details disclosure was unreachable by keyboard below 1100 px. The adapter now computes the Tab cycle at key-press time for both drawers.

New Vitest and Playwright cases fail with each fix reverted. typecheck, eslint, unit (35 node + 556 Vitest), check:theme-selectors, all 114 Chromium Playwright cases, the contract check and the server::webui Rust tests pass.

Refs #1918
Rebuilt with scripts/webui/build_bundle.py after the row, download-progress and drawer keyboard fixes; build_bundle.py --verify and check_binary_assets.py pass.

Refs #1918
@inureyes

Copy link
Copy Markdown
Member Author

Implementation Review Summary

Intent

Make the Models library a dense list where Load, Use in Chat and Unload run from the row, move internal state behind a Details disclosure, and report the declared weight dtype in the catalog.

Findings Addressed

  • A Ready model without chat (embedding, rerank, transcription) showed a disabled Load and no Unload on its row; Unload now follows the lifecycle, and focus after a row Load lands on Unload for such a model (HIGH, a176036)
  • Download pseudo-rows lost their progress bar and state below 44rem / 32rem, where the Size and State columns hide and no inspector exists to recover them; the name cell now carries both as a fallback (HIGH, a176036)
  • Escape in a confirmation opened from the inspector drawer also closed the drawer and dropped focus on the page heading (HIGH, a176036)
  • The drawer's Tab trap (alpha.19, built once on open, no summary) made the Details disclosure unreachable by keyboard below 1100 px; the adapter now computes the cycle at key-press time (HIGH, a176036)

Remaining Items

  • At exactly 1100 px the pane renders but models.css still collapses the layout to one column (max-width: 1100px vs min-width: 1100px) (LOW)
  • Badge gained an unused title prop (LOW)
  • The page behind the Models drawer is not inert; the new trap keeps Tab inside, but Tab from <body> after a pointer press on the drawer heading can reach the page (MEDIUM)
  • Real-binary load, Use in Chat and unload from a row: pending, run separately against this head

Verification

  • All stated requirements implemented (real-binary acceptance pending)
  • No placeholder/mock code remaining
  • Integrated into project code flow
  • Project conventions followed
  • Existing modules reused where applicable
  • No unintended structural changes
  • Tests pass: typecheck, eslint, unit (35 node + 556 Vitest), check:theme-selectors, all 114 Chromium Playwright cases, contract and binary-asset checks, build_bundle.py --verify, server::webui Rust tests, clippy and fmt

…overs

The page behind the Models inspector drawer is not inert, so after a pointer press on the drawer heading left focus on the body, Tab walked the list behind the modal panel. The Drawer adapter now moves a Tab pressed outside an open panel to its first stop (Shift+Tab: last), next to the existing outside-panel Escape handling; a new drawer test fails with the change reverted.

The two-column layout now collapses with the same 1100 px boundary the inspector uses (width < 1100px), so an exactly 1100 px window no longer stacks the pane under the list. The Activity connection banner drops its duplicate connection-authenticated-detail test id, which the sidebar's Connection details now carries, and the unused Badge title prop is gone.

Refs #1918
Rebuilt with python3 scripts/webui/build_bundle.py; build_bundle.py --verify and check_binary_assets.py pass.

Refs #1918
@inureyes

Copy link
Copy Markdown
Member Author

Security and Performance Review

Reviewed at 29e8c3a9. No CRITICAL or HIGH findings, so nothing was auto-fixed.

Verified

  • normalize_dtype accepts only [a-z0-9_]{1,32} and never panics. Its output matches the api.yaml pattern, and the client validates against that same schema.
  • No dangerouslySetInnerHTML, eval, style attributes or inline scripts were added, and the bundle's innerHTML/eval/setAttribute("style") counts match main. The docs link is static and uses rel="noreferrer".
  • loadProfileFor uses Object.hasOwn on the validated profile document. A row load of entry X submits X's own profile, the same one the inspector shows.
  • The Drawer listeners are removed when it closes. No hidden drawer can trap Tab: the Models drawer unmounts at 1100 px and wider, and the nav sheet closes when the window widens. The ResizeObserver disconnects correctly and only watches nodes that stay mounted.
  • Only Inspect is a row primary. Unload, Delete and eviction still require their confirmations.

Remaining (LOW)

  • Row labels and the Inspect/Delete tooltips put display_name in without isolation (screen.tsx:307-346). Adding isolate() would change the pinned accessible names.
  • dtype passes any bounded identifier through, so a downloaded config can show a misleading label when quantization is null (catalog_metadata_config.rs:130). An allowlist would close this.
  • inventory() re-sorts the catalog on every snapshot change (screen.tsx:100), measured at 1.2 ms per call for 1,000 entries. A useMemo keyed on the catalog, filter and sort would avoid it.
  • useWideInspector creates a MediaQueryList on every render (inspect-request.ts:40).
  • An Inspect at 1100 px or wider leaves drawerOpen set, so narrowing the window later opens the drawer over the list.

Gates

server::webui tests (79), clippy, fmt, typecheck, eslint, unit (35 node + 557 Vitest), theme selectors, models.spec.ts (14), ui-common-components.spec.ts (14), build_bundle.py --verify, contract and binary-asset checks all pass.

…renders

Security review follow-ups (all LOW). The catalog printed any short identifier from a downloaded config.json torch_dtype in the Quantization column, so a config could show a word such as verified there; it now reports only recognized tensor dtypes (bf16, fp16, fp32, fp64, the four float8 variants, int8, uint8) and null otherwise, with a new test case and the api.yaml, catalog.md and catalog.ko.md wording updated.

The library no longer re-sorts the whole catalog on runtime and operation events (inventory is memoized on catalog, filter and sort), useWideInspector keeps one MediaQueryList instead of creating one per render, and Inspect or a chip request in a wide window no longer leaves drawer state behind that would open the drawer when the window later narrows.

Refs #1918
… follow-ups

Rebuilt with python3 scripts/webui/build_bundle.py; build_bundle.py --verify and check_binary_assets.py pass.

Refs #1918
The Models redesign added two pure functions with no direct test: quantizationValue (Quantization shows the declared quantization, falls back to the declared weight dtype, then nothing) and entryTasks (the Tasks column dedupes repeated capability tasks and orders them by output_tasks, with tasks absent from output_tasks kept last). Every existing fixture happened to declare capabilities in output_tasks order with no duplicates, so the reordering and dedup logic ran untested; the fixed Playwright fixture never exercised a null quantization either.

Adds a policy.test.ts case for each function and a screen.test.tsx case that renders the Quantization column with quantization null and dtype set, and with both null. Updates the Vitest count in docs/webui/design-system.md from 558 to 561 and regenerates the embedded bundle manifest digest for the webui/src change.

Validation:
- pnpm --dir webui run unit (35 node + 561 Vitest)
- pnpm --dir webui run typecheck
- pnpm --dir webui exec eslint . --max-warnings=0
- pnpm --dir webui run check:theme-selectors
- python3 scripts/webui/build_bundle.py --verify
- python3 scripts/ci/check_webui_contract.py and scripts/ci/check_binary_assets.py

Refs #1918
normalize_dtype maps float64/double/fp64/f64 to fp64, the same way it maps the bfloat16, float16 and float32 aliases, but catalog.md and catalog.ko.md only listed the bf16/fp16/fp32 examples. Add float64 to both so the documented alias list matches the implementation.

Refs #1918
Brings in #1928 (Settings tabs). The two doc conflicts keep both sides: the ui-common matrix keeps this branch's Badge row and main's Field/Toggle row, and design-system.md keeps main's Toggle export with this branch's Drawer sentence. The embedded bundle was regenerated from the merged sources rather than hand-merged, and the suite counts were recounted (35 node + 602 Vitest, 116 Chromium Playwright), all passing.

Refs #1918
@inureyes inureyes added status:done Completed and removed status:review Under review labels Sep 19, 2026
The hosted Linux runner, with DejaVu metrics, fit 14 rows in a 900 px viewport where macOS fit 15, so the acceptance spec failed in CI. With a fine pointer, row controls now use 28 px buttons (above the 24 px target minimum) and 2 px cell padding, which brings a row to 33 px locally and 19 rows into view; touch keeps the 32 px controls. The bundle is regenerated in the same commit.

Refs #1918
inureyes added a commit that referenced this pull request Sep 19, 2026
Rebuilds the Chat route as a conversation view: a conversation list (a pane from 961 px, a Drawer below), user and assistant messages you can tell apart without reading them (alignment, a "You" label and a model badge, timestamps, elapsed seconds while streaming, keyed status labels), a pinned composer that grows from 1 to 8 rows, one settings drawer for conversation settings, next-turn parameters and local history, and Load from Chat. The page itself no longer scrolls; only the message list does. Send, Stop, edit, history and privacy behave as before. Retry re-sends a failed last turn through the same guards.

## Design notes

- There is one "New conversation" button, in the page header. A second button with the same name breaks strict role locators in four specs.
- The model picker sits in the conversation header, because the ui-common Select always opens its dropdown downward. Its groups are expressed as ordered options (Ready chat models first) with a state description on each, because the Select has no option groups.
- Load goes through a confirmation, then `models/load-action.ts`, which sends the same request the Models screen sends. A `conflict` response opens the Models capacity dialog. Selecting a model never loads it. `screen.tsx` changes only at its `load()` call site.
- History payloads are now version 2 and add `startedAt`. Version-1 turns import with `startedAt` 0, and the IndexedDB version stays at 1.
- Status labels are Generating, Done, Stopped, Did not finish and Failed, so the raw status words never appear.

## Changes during review

- The Drawer adapter wraps Tab at the controls that are usable when the key is pressed. Before, Tab escaped both Chat drawers while a response streamed.
- An imported time outside the range a `Date` can hold renders as unknown instead of crashing the WebUI. `startedAt` is bounded on import.
- Retry is disabled whenever Send would be refused. When clearing the overrides removes the badge that opened the settings drawer, focus falls back to the settings button on close. The model picker now sorts its options only when the catalog or selection changes.

## Validation

- Passing at b9fab1b: typecheck, lint, check:theme-selectors, `unit` (58 files, 600 tests), `build_bundle.py --verify`, `check_webui_contract.py` and `check_binary_assets.py`.
- Playwright Chromium at b9fab1b, one spec per run: chat 5, shell 14, browser 29, models 8, settings 3, activity 3, theme 23, ui-common-components 14, ui-common-shell 12, all passing.
- Passing after merging main with #1928 (e2a5af2): typecheck, lint, theme selectors, unit (62 files, 641 tests), `--verify`, the contract and binary-asset checks, and the chat, shell, settings and browser specs. The Chat drawer's sampling link now opens `#settings/requests`, and the parameter hints use #1928's server-default resolution.
- A test for the Clear All focus race failed 3/3 before the fix. `confirmations.test.tsx` then passed 10 consecutive runs.
- Not runnable locally: `router-real` and `performance` (selectors updated).

## Measurements (before/after)

Mock fixture, 30-turn conversation, page scrolled to the top. Before is main 835a552, after is b9fab1b. The real-binary figures are in the next section.

| Viewport | Page height, empty | Page height, 30 turns | Composer visible without scrolling | Scrolling elements | Words, empty |
|---|---|---|---|---|---|
| 1440x900 before | 967 | 1405 | no (bottom 1113) | transcript box + page | 93 |
| 1440x900 after | 900 | 900 | yes (bottom 803) | `.chat-messages` only | 59 |
| 390x844 before | 1268 | 1600 | no (bottom 1280) | transcript box + page | 93 |
| 390x844 after | 844 | 844 | yes (bottom 743) | `.chat-messages` only | 46 |

## Real-binary acceptance

Ran against an isolated bundled `mlxcel-server` built from b9fab1b, with `qwen3-0.6b-4bit` loaded. Every check passed.

- `chat-real.spec.ts` (with `MLXCEL_CHAT_REAL_ISOLATED=1`): the reply was "Hello! 🌍" and the status label reads Done. Stop worked: the request lease rose above 0, returned to 0, and the status label reads Stopped. There were no CSP violations and no external requests, and axe found no violations. The harness now reads the model's own catalog entry, because a large catalog puts the model past the first page. The short turn is capped at 64 tokens.
- Load from Chat: with the model unloaded, selecting it and opening the confirmation sent no request. Confirming sent exactly one `POST /ui-api/v1/model-actions` with the Models body (`action: load`, `model_id`, `expected_revision`, `idempotency_key`). Once the model reached Ready, the header's Load button was gone and a 32-token turn answered. Stop mid-stream took the lease back to 0 and the status label reads Stopped.
- At 1440 and 390: one click in the list switches conversations. At 390 the list opens as a Drawer from the header and closes when you pick a conversation. Setting `max_tokens` shows "Overrides: max_tokens". The badge reopens the drawer on the parameters section, and focus returns to the badge.
- At 1440x900 with 30 real turns, the page stays 900 px tall, the composer is visible, only `.chat-messages` scrolls, and the page has 797 words (45 when empty).

The live run found one defect, now fixed in 5f50a89: on the current conversation row, the hover tint stacked on the current-row tint and dropped the muted metadata to 4.42:1 contrast. The Chat browser spec runs axe in that state; it failed before the fix and passes after.

Merge note: #1930 adds the same end-anchored Drawer variant, as `placement`. This PR adds it as `side` plus `width`. Whichever PR merges second reconciles the Drawer signature and the `ds-drawer--end` CSS.

Part of #1910

Closes #1915


## CI note (GB10 Activity gate)

The `WebUI installed artifact` job on `e2a5af2a` (run 35453693578) failed only at the "Run Activity performance gate" step's precheck, `GPU compute processes are already present before Activity gate`, so the gate never measured anything; every other step passed, including the real-router browser harness, the installed-artifact WebUI check and the reverse-proxy check. The precheck has failed for every PR since run 35449824150 was cancelled at 14:59:53Z inside that step, which points at a GPU process left on the runner. This PR changes the Chat screen and does not touch decode or the Activity page, so per the maintainer's decision for this epic it merges with this evidence recorded (gate noise: #1925).
Brings in #1931 (Chat), which added the same end-anchored Drawer variant this branch had. The adapter now has one API, main's `width="medium"` and `side="end"` modifier classes over the constant inline sheet width; the Models inspector drawer uses them and this branch's `placement` prop, its 520 px inline width and the matching layout-gate allowance are gone. There is one Tab-wrap implementation, computed at key-press time: it wraps at the panel's first and last usable stops, counts a Details summary and skips the contents of a closed details, and stops every Tab inside the panel in the capture phase so the package's stale handler cannot wrap early. It keeps main's IME Escape guard and main's rule that an Escape inside an open native dialog belongs to that dialog, and this branch's fixes: a drawer confirmation's Escape leaves the drawer open, and a Tab pressed with focus on no element enters the panel (a Tab from a control outside it, such as a portalled Select list, keeps its own order).

The Models Inspect button uses main's info icon, the row load goes through main's load-action.ts, both drawer test sets are kept, and the bundle was regenerated rather than hand-merged. Unit (35 node + 664 Vitest) and all 119 Chromium Playwright tests pass, including chat.spec.ts.

Refs #1918
- The drawer's document key handler backs off whenever a native modal is open, not only when the key starts inside it: an Escape or Tab from <body> after a pointer press on a confirmation's text no longer closes or re-enters the drawer beneath it.
- A row Load or Unload that is refused or fails no longer leaves its focus intent armed. Focus returns once to the control the user pressed, and the row no longer pulls focus when it becomes ready later by another path. Cancelling a confirmation also drops the intent, and focus moves without scrolling.
- Widening past 1100 px forgets that the drawer was open, so narrowing again does not reopen it without a request.
- The CatalogMetadata dtype doc names the allowlist the code enforces.

Refs #1918
Refs #1930
After an unload the model's runtime keeps its revision and reports ctx_size 0, so the Overview read "Effective context (tokens) 0". Found in the real-binary row acceptance; a context is now shown only when it is positive.

Refs #1918
Refs #1930
@inureyes
inureyes merged commit 6900e3c into main Sep 25, 2026
20 checks passed
@inureyes
inureyes deleted the feature/issue-1918-model-library-redesign branch September 25, 2026 03:08
inureyes added a commit that referenced this pull request Sep 25, 2026
…#1975)

## Summary

Closes the eleven LOW items left open by the #1930 and #1929 hardening, in one PR as the issue asks.

- Models: the page before the inspector drawer is inert below 1100 px; row labels and tooltips isolate the display name; a row action whose row re-sorts onto another page turns the pager there and focuses the follow-up control (a failed action's one-shot return never turns the page); search, filters and sort survive a route round trip via `library-view.ts`, scoped to the server instance they were set against and cleared on logout; row callback refs are stable; consuming an inspector request notifies subscribers.
- Drawer: a Tab propagates to descendants unless the adapter wraps it, the panel has no stop, or it starts on the package's stale first/last element.
- Activity: the slot box is a region and tab stop only while it overflows (shared `useOverflowRegion`); Operations sorts only on operations/locale change; formatters are cached per locale and precision; the plural form follows the rounded count; zero context reads unknown; a re-selected model waits for its first sample instead of showing old tiles under the stale banner.
- Gallery: a loading StatCard sample, placed after the lifecycle samples because `browser.spec.ts` pairs the progress samples with their next sibling; `csp.spec.ts` asserts its skeleton.

## Changes during review

- The pager-follow first treated focus on `<body>` as still waiting, so in Safari and macOS Firefox (where clicking Next does not focus it) it turned the page back after the user paged away. The intent now remembers the row's page: a re-sort is followed, a user page change ends it.
- The security review found the library view outliving logout and a server-instance change (the next session inherited the previous search; a remembered source or task could hide every row on a new catalog). It is now instance-scoped and reset on logout.
- A browser spec now checks that the page behind the drawer is inert in Chromium and that focus returns to Inspect after Close.
- A bilingual technical report is committed under `TECHNICAL_REPORTS/`.

Existing tests that assumed the old behavior were updated: slot-region and tab-order expectations, row-label locators (built from `isolate()`), and Activity fixtures now seed one history sample.

## Test plan

- [x] Every new test fails against the main sources and passes here (the CSP skeleton assertion by inspection: main's gallery renders no StatCard)
- [x] typecheck, lint, full unit (35 node + 710 Vitest), default Playwright suite (124, includes models, activity, shell)
- [x] `build_bundle.py --verify`, `check_binary_assets.py`, `check_webui_contract.py`
- [x] CSP spec against a real secured server: `mlxcel-server` built from `dc1845d3` (`--release --features cuda`, GB10, embedded bundle, `--api-key-file --webui`), served `style-src 'self'` without `unsafe-inline`; both themes pass with the skeleton assertion

Closes #1974
@inureyes inureyes added this to the 0.8 milestone Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:architecture Architecture and code structure changes priority:high High priority status:done Completed type:enhancement New features, capabilities, or significant additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(webui): redesign the model library as a dense, task-first list with row actions

1 participant