Skip to content

feat(webui): rebuild Settings as one-setting rows with search - #3553

Merged
inureyes merged 7 commits into
mainfrom
feature/issue-3524-settings-rows-search
Nov 29, 2026
Merged

inureyes merged 7 commits into
mainfrom
feature/issue-3524-settings-rows-search

Conversation

@inureyes

@inureyes inureyes commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Closes #3524. Part of #3526.

Settings moves to the new grammar. Each tab is now a set of sections made of one-setting rows. Advanced settings sit one drill-down level in, and a search filters rows across every tab.

  • Rows. The label and an optional description sit on the start side, with the control on the inline end.
    • Below a 38 rem panel width the row stacks. This is a container query on .settings-screen, not a viewport breakpoint. Playwright checks both sides of it at 390, 1024 and 1440.
    • Read-only facts are also one per row: the context values and the startup values.
    • SettingsSection puts a section's own on/off switch in its header (toggle). No section has a real on/off today, so the slot is unit-tested but unused. I did not invent a synthetic switch over shared server state.
  • Levels. These open in place of the tab's top level: Glass material, Advanced sampling (min_p, repetition_penalty, seed), the DRY, Diffusion, Template and Other live groups, and Server details (geometry, values under internal names, read-only reasons).
    • Focus moves to the level's heading, and Back returns it to the drill row.
    • A level is not in the hash. It closes whenever the tab changes, whether by the tab strip, a link or the hash.
    • The live draft, its pending count, Apply and the result notice stay above the level, so Apply sends the edits from every group. A drill row counts its unapplied edits and the values that need fixing.
  • Search. The static tabs render from the same row lists that the index holds. Live and startup entries come from the selected model's /settings schema; if no read exists yet, the screen makes one non-loading read while a query is typed.
    • Matching covers English and Korean labels and descriptions at once, plus the internal name.
    • Choosing a result, or pressing Enter for the first one, opens its tab and level and focuses the row's control.
    • Up and Down step through the results, Escape clears the field, and IME composition is respected. When nothing matches, an empty state offers Clear.
  • Saving. Appearance, request defaults and the next-run profile save on choice, with no Save button.
    • An out-of-range value stays on screen marked "Not saved".
    • Live server values keep draft, Apply and the conflict refresh.
    • Startup values stay read-only under the restart note.
    • ux-contract.md records both exceptions. settings.md and both user guides describe the new layout.
  • Dialogs and copy. The profile CLI view and import/export open in Dialog, and the three resets use useConfirm. Settings strings move to Run and Stop terms (decision 5), for example "Next run · browser profile" and "다음 실행 · 브라우저 프로필".

Shared edits outside features/settings/:

  • icons.tsx adds the forward and back chevrons, and primitives.tsx re-exports Icon. The design-system icon list is updated to match.
  • The strings fixture changes in one block. It now holds 1,021 entries, under the 1,024 maxItems cap, so api.yaml is unchanged.
  • shell.spec.ts: I removed the two-frame wait in shellGeometry.
    • The 4 px overflow at 195 px did not reproduce on the untouched main baseline or on this branch. I measured every frame after the hash change, across 16 runs and with 8x CPU throttling.
    • The shell spec passed 126/126 over six runs without the wait.
    • The wait was masking nothing, and measuring the first visible frame keeps any future regression visible.

Bundle: initial JS gzip is 316,231 B (+760, from the two glyphs) and total is 476,094 B (+5,281).

Validation:

  • From webui/: typecheck, lint, check:theme-selectors, check:themes and check:agents pass. unit passes 836/836 and the Chromium browser suite 140/140.
  • build_bundle.py --verify and make verify-webui-contract pass.
  • I did not run browser:all, make verify-webui-rust, make verify-webui-integration-fake or the served-CSP spec. They are left for the central gate.
  • Real binary: mlxcel-server -m qwen3-0.6b-4bit --webui --settings --props, with two Chromium contexts. Results:
    • Choosing Dark applies immediately and survives a reload.
    • A temperature edit stays a draft (no PATCH) until Apply, then reads back as 0.55.
    • In the two-client case, A drafts 0.33, B applies 0.77, then A presses Apply. A shows the conflict notice, sends no PATCH and keeps its 0.33 draft, and B's 0.77 stands. A's second Apply lands, and B reads 0.33 after Refresh.
    • Searching "dry" lists the live DRY rows. Screenshots are not attached because images are not committed.

Changes during review

The review found four HIGH issues, all fixed:

  • Search started on Appearance found no live rows.
  • Apply failed silently when the invalid value was on a closed level.
  • The search focus fallback could steal focus late.
  • A valid profile edit erased another field's "Not saved" text.

From the security pass, Apply now collects values in null-prototype records, and search text is normalized once per entry.

Settings now lays every tab out as sections of one-setting rows: label and optional description on the start side, the control on the inline end, stacked below a 38 rem panel width through a container query. Advanced settings sit one drill-down level in (glass material, advanced sampling, the non-Sampling live groups, server details), with Back returning focus to the drill row. A search above the tabs filters rows across all tabs in English and Korean and by internal name, from an index the static tabs render from plus the last-read /settings schema, and moves focus to the chosen row's control.

Browser-local settings (appearance, request defaults, next-run profile) save on choice with no Save button, and an out-of-range value stays on screen as not saved. Live server values keep draft, Apply and conflict refresh, with a pending count above the level switch. Profile CLI and import or export open in Dialogs, and resets use the shared confirmation. Settings copy moves to Run and Stop terms. The contract, settings.md and the user guides record the rows, search and the two saving exceptions. The shell floor no longer waits two frames before measuring.

Refs #3524
@inureyes inureyes added type:enhancement New features, capabilities, or significant additions priority:medium Medium priority status:review Under review labels Nov 28, 2026
Moving rows into drill-down levels and adding search left four paths that misbehaved:

- Search on a tab that never reads /settings (Appearance) found no live or startup rows, because the index only holds the last recorded read. A search with a Ready model and no record now reads the schema once.
- Enter picked results in rank order while the list groups by tab, so Enter could open a setting other than the one shown first. Results now sort by tab, then label matches, then index order.
- Apply with an invalid draft on a closed level returned with no message. It now says how many values need fixing, and the drill row that opens the level names the count.
- Choosing a row that needs a Ready model while none is Ready left focus on the body for up to 240 frames, then moved it to the tab even after the person had clicked or typed elsewhere. The fallback is now immediate for that case, and any pointer or key input cancels the wait. The field also drops aria-controls when no results list is rendered.

Settings unit tests (121), typecheck, lint, the i18n drift test and the Chromium settings spec pass; the new tests fail with the fixes reverted. Bundle regenerated.

Refs #3524
With save on choice, every valid profile edit publishes a new profile, and the effect that clears typed text on a profile change ran after the form's own save too. A valid edit in one field therefore erased another field's out-of-range text and its "Not saved" notice, against the contract that such a value stays on screen as not saved. The form now skips that reset after its own save; a scope switch, import or reset still clears it.

docs/webui/settings.md now states the search order (by tab, label matches first within a tab) and the one-off schema read a search makes when no tab has read it yet.

Settings unit tests (122), typecheck, lint and the Chromium settings spec pass; the new profile test fails with the fix reverted. Bundle regenerated.

Refs #3524
@inureyes

Copy link
Copy Markdown
Member Author

Implementation Review Summary

Intent

Settings as one-setting rows with drill-down levels and a bilingual client-side search, save on choice for browser-local values, draft and Apply kept for live values.

Findings Addressed

  • Search started on Appearance found no live or startup rows: the index only had a schema once some tab had read it. A search now reads it once (HIGH, 37d1dda)
  • Apply with an invalid draft on a closed level returned silently. It now reports the count, and the drill row names it (HIGH, 37d1dda)
  • Picking a row that needs a Ready model, with none Ready, left focus on the body for up to 240 frames, then moved it to the tab even after the user had moved on (HIGH, 37d1dda)
  • A valid profile edit erased another field's unsaved text and its "Not saved" notice (HIGH, e476aab)
  • Enter took the first result in rank order while the list groups by tab (MEDIUM, fixed alongside)
  • The search field kept aria-controls pointing at a list that was not rendered (MEDIUM, fixed alongside)

Remaining Items

  • A level reopens on a hash return to its tab, although the PR body says levels reset on a tab change (MEDIUM)
  • A model or connection change inside a live level leaves only Back and a banner (MEDIUM)
  • The empty state shows while the first schema read is in flight (LOW)
  • DrillRow aria-describedby repeats text that is already in the button name (LOW)
  • Real-binary acceptance runs, the full epic: rebuild the bundled WebUI on a dense, task-first design grammar #3526 gates and make verify-webui-contract (needs jsonschema) were not run here
  • Bundle sizes in the PR body are out of date after the two commits

Verification

  • All stated requirements implemented (real-binary items 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 (settings unit 122, typecheck, lint, i18n drift, Chromium settings spec 11/11)

A drill-down level reset only through the tab strip, so leaving Requests by a link or hash change and coming back reopened Advanced sampling. The screen now drops the level whenever the active tab changes, by any route; a search pick still opens its level because it sets the target tab first.

Refs #3524
@inureyes

Copy link
Copy Markdown
Member Author

Security and performance review of the Settings rebuild at 7297f93. No CRITICAL or HIGH findings, so no fixes were committed.

Verified clean:

  • Schema names never resolve through prototypes on the read paths: catalog lookups go through Sets, startup and current values use Object.hasOwn, and the draft uses computed keys and Object.fromEntries, which create own properties.
  • focusRow uses getElementById on the sanitized rowAnchorId, so no selector string is built from server input.
  • No dangerouslySetInnerHTML, innerHTML, inline style or inserted <style>. Server help and reason strings render as text, and index.html changes only hashed asset names.
  • The search read runs only while a query exists, no record exists, the model is Ready and --settings is on. actions is memoised on the client, so typing does not re-fire the read. It aborts on cleanup and goes through getSettings, which sends autoload=false. The screen never issues a PATCH.
  • Both response maps are capped at 32 entries and the schema validator caps it at 256 with unique names. Focus waits are capped at 240 frames and cancel on pointer or key input.
  • Load profiles in localStorage are revalidated on every publish and load. Request defaults stay in memory. No credentials or prompts are persisted.

Open, not fixed (below the auto-fix threshold):

  • LOW, webui/src/features/settings/live-settings.tsx:103-110: values and invalid in apply() are plain {}. A setting named __proto__ would not be counted by the new invalidCount gate and would drop out of the PATCH body. This predates the PR and needs a hostile server to trigger. The fix is Object.create(null).
  • LOW, webui/src/features/settings/settings-layout.tsx:14: names that differ only in sanitized characters (a.b and a-b) map to the same DOM id, so search focus lands on the first match.
  • LOW, webui/src/features/settings/settings-screen.tsx:89: a query typed while the Model or Server tab's own first read is still in flight issues one extra concurrent GET.
  • LOW, webui/src/features/settings/settings-index.ts:145-152: every keystroke re-runs NFKC normalization over every entry. help length is not capped, so a long server help string makes each keystroke slower. Normalizing once per index would remove that cost.

Verification: typecheck, lint, settings vitest (123/123) and the Chromium settings spec (11/11) pass.

Apply now collects parsed values and parse errors in null-prototype records, so a server setting named `__proto__` stays an own key of the PATCH body and of the invalid count instead of dropping out silently. The settings search normalizes each index entry once and caches it, because server help text has no length cap and was re-normalized on every keystroke. Both were LOW findings from the security pass on the PR.

Refs #3524
The fallback test asserted after a fixed 80 ms, which a loaded full-suite run missed once (focus was still on the route heading). It now polls for up to 20 such waits for the tab to take focus; the full unit suite then passed 836/836 three times in a row.

Refs #3524
@inureyes inureyes added status:done Completed and removed status:review Under review labels Nov 29, 2026
Bring in the Chat workspace restructure (#3552) and the Helm chart publishing work (#3554) so the Settings rebuild for #3524 stays mergeable.

- Icons: the union of both sides, `forward` and `back` from Settings plus `add`, `parameters` and `privacy` from Chat; the icon count test now expects 30.
- Docs: design-system.md lists all 30 glyphs and keeps the Settings note on the re-exported `Icon`; both user guides keep the Settings rows and search paragraph and take Chat's wording that the history and privacy dialog opens from the shield button in Chat's header.
- Strings: the fixture merged cleanly to 1040 entries with no key edited on both sides, so `StringCatalog.strings.maxItems` in docs/webui/api.yaml rises from 1024 to 2048; the generated DTO has no drift.
- Bundled assets were regenerated with scripts/webui/build_bundle.py rather than hand-merged.

Validated with typecheck, lint, the unit suite (843 tests), the theme and agents checks, the bundle verify, the WebUI contract check, and the Chromium settings, chat and shell Playwright specs (39 passed).
@inureyes
inureyes marked this pull request as ready for review November 29, 2026 00:41
@inureyes
inureyes merged commit 8932d86 into main Nov 29, 2026
35 of 36 checks passed
@inureyes
inureyes deleted the feature/issue-3524-settings-rows-search branch November 29, 2026 00:42
inureyes added a commit that referenced this pull request Nov 29, 2026
Brings in the Chat workspace (#3552), Settings rows and search (#3553), the Helm chart and GHCR publishing work, and the other main commits since the branch point.

All source files merged without conflicts. The string fixture ends at 1050 entries: the union of both sides, minus six Settings and Chat keys that main deleted and Activity never touched; every key whose copy differs was changed on one side only, and that side's copy is kept. Only the generated src/webui/assets bundle conflicted, so it was regenerated from the merged sources with scripts/webui/build_bundle.py rather than hand-merged.

Validated with webui typecheck, lint, unit (859 tests), the theme and agents checks, build_bundle.py --verify, and make verify-webui-contract.
@inureyes inureyes added this to the 0.9 milestone Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Medium 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): rebuild Settings as one-setting rows with search

1 participant