Repository navigation
fix(webui): close residual LOW items in the Models and Activity pages - #1975
Merged
Merged
Conversation
Models: everything before the inspector drawer goes inert while it is open below 1100 px (a display: contents wrapper keeps the stack spacing). Row labels and tooltips isolate the display name. A row action whose row re-sorts onto another page turns the pager to it and focuses the follow-up control there; a failed action's one-shot return never turns the page. Search, filters and sort live in a session store (library-view.ts) so a Chat round trip keeps them. Row callback refs are cached per control, the inspect-request effect lists `wide`, and consuming a request notifies subscribers. Drawer: the adapter stops a Tab only when it wraps, when the panel has no stop, or when focus is on the package's stale first or last element, so descendants see every other Tab. Activity: the slot box is a region and tab stop only while it overflows (shared useOverflowRegion, both axes). Operations sorts only when operations or locale change, number formatters are cached per locale and precision, the plural form follows the rounded count, a zero context reads unknown, and a re-selected model waits for its first sample instead of showing old tiles under the stale banner. The gallery gains a loading StatCard for the CSP spec, which now asserts its skeleton. Every new test was confirmed to fail against the main sources. Typecheck, lint, unit, the default Playwright suite, bundle verify, binary-asset and contract checks pass. Closes #1974
The row focus intent now follows a re-sorted row to its new page, but it also turned the page back whenever the user paged away while an action was still settling. A pointer press that does not focus the pager (Safari, Firefox on macOS) leaves focus on <body> once the row's Inspect button leaves the page, so the effect still read the user as waiting and snapped the pager back to the row. RowFocus now records the page the row was last seen on. A page change that the row did not make (visible page differs, row page unchanged) ends the intent; a re-sort that moves the row still follows it. The `once` return trip is unchanged. Adds a unit test that pages away with a non-focusing click during a draining Unload (fails before the fix), and Playwright assertions that the page behind the narrow drawer is inert, refuses focus through the display: contents wrapper, and hands focus back to the Inspect button on close. Regenerated the bundle. Refs #1974
The library view store kept the search, filters and sort across logout and across a change of server instance. The next login in the same tab inherited the previous session's search, and after a server restart a remembered source or task that the new catalog lacks could hide every row. The view now belongs to the server instance it was set against and reads as the defaults on another one, and logout resets it. Tests cover both paths and fail without the fix. Refs #1974
This was referenced Sep 26, 2026
inureyes
added a commit
that referenced
this pull request
Sep 26, 2026
#1977) ## Summary - Split `ModelsLibrary` (731 lines) along its seams into `row-focus.ts` (`useRowFocus`), `columns.tsx` (`libraryColumns(context)`, `LibraryRow`, `downloadRepo`) and `toolbar.tsx` (`LibraryToolbar`). Behavior-preserving and in its own commit: `screen.tsx` is 433 lines, exports, DOM, class names, test ids and handler order are unchanged, and the existing Models unit and Playwright tests pass unmodified. - `useOverflowRegion` adds a `MutationObserver` on the region: it re-resolves the table, moves the `ResizeObserver` to it, and re-runs the overflow check, so a table mounted or swapped after attach (or content that grows without a resize) is followed. The observer watches `childList` only, and its overflow check is coalesced into one `requestAnimationFrame`, so row churn from polls and SSE bursts costs at most one layout read per frame. - A focused scroll box that stops overflowing keeps its tab stop, role and name until a one-shot `blur`, instead of dropping focus to `<body>`. `disconnect` removes both observers and the listener. - `cached()` is bounded at `CACHE_LIMIT = 32` keys with oldest-first eviction; `chat/time.ts` uses the shared helper instead of its private unbounded copy. - The #1975 technical report no longer cites a 500-line module rule; `docs/code-guidelines.md` sets 800, and the bullet now describes the cohesion concern this PR addresses. - Regenerated `src/webui/assets` (Node v26.5.1) and added the bilingual technical report under `TECHNICAL_REPORTS/`. ## Changes during review - The implementation review found the mutation callback ran the layout-reading overflow check synchronously after every React commit that changed nodes, one forced layout per commit during an SSE burst (MEDIUM). It is now coalesced per frame; the attach-time and `ResizeObserver` paths stay synchronous. The security review found no CRITICAL or HIGH issues. ## Test plan - [x] New tests in `common-adapters.test.tsx` (late table, focused shrink) and `format.test.ts` (eviction) fail against the main code and pass here. - [x] `pnpm --dir webui run typecheck`, `lint`, `unit` (35 node + 713 Vitest), theme selectors. - [x] Full default Chromium Playwright suite: 124 passed on the final head. - [x] `build_bundle.py --verify`, `check_binary_assets.py`, `check_webui_contract.py`. Closes #1976
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the eleven LOW items left open by the #1930 and #1929 hardening, in one PR as the issue asks.
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.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.browser.spec.tspairs the progress samples with their next sibling;csp.spec.tsasserts its skeleton.Changes during review
<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.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
build_bundle.py --verify,check_binary_assets.py,check_webui_contract.pymlxcel-serverbuilt fromdc1845d3(--release --features cuda, GB10, embedded bundle,--api-key-file --webui), servedstyle-src 'self'withoutunsafe-inline; both themes pass with the skeleton assertionCloses #1974