Skip to content

refactor(desktop): converge settings sidebar tier and row primitives - #1132

Merged
Astro-Han merged 9 commits into
mainfrom
refactor/settings-rows-convergence
Jul 16, 2026
Merged

refactor(desktop): converge settings sidebar tier and row primitives#1132
Astro-Han merged 9 commits into
mainfrom
refactor/settings-rows-convergence

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Two governance fixes for the Settings surface, from a review of the sidebar and the 通用 page:

  • Sidebar rows drop from the 36px xl tier to the 32px lg tier (.settingsNavItem + .settingsBackButton), the same tier as the session-list rows, so the two sidebars share one row rhythm. Along the way this fixes three latent nav-item issues: the always-semibold strong rule that shadowed the active weight bump (now medium → semibold on active, matching .maka-list-row-name), the 24px glyph track + 17px svg override that contradicted the 16px icon the TSX renders and offset nav labels 8px from the back-button label, and a leftover grid-template-columns on a flex container.
  • Settings row primitives consolidate into styles/settings/rows.css. .settingsRow/.settingsRows (rendered by settings-rows.tsx) had styles scattered across bot.css, connection.css, provider-editor.css, and nav-sidebar.css, which let the two row kinds drift — on the 通用 page, .settingsFormRow titles (隐身模式) rendered 15px while adjacent .settingsRow titles (默认模型) rendered 13px with different padding. One file now owns the row/field family with one typography contract: row titles --font-size-heading/medium, field labels --font-size-ui/medium (one tier below, instead of sharing the heading tier), hints --font-size-base, row padding space-5/space-6 for both kinds.

Both contract tests that pin these invariants are updated at the same seam: the control-height contract moves the two settings nav selectors to the lg tier, and the !important audit registers rows.css as an a11y-only file (its sole !important is the prefers-reduced-motion block that moved out of nav-sidebar.css).

CSS + contract tests only; no TSX changes.

Before / after

Captured from the live app (screenshot harness, settings-general, light 1280) at the merge-base vs this branch, composed with ImageMagick:

before/after settings general

Left: 36px sidebar rows; 默认模型/默认权限模式 card renders 13px titles with tighter padding than the 15px cards above it. Right: 32px sidebar rows matching the session list; all row titles on one 15px tier with uniform padding. (The evidence image is committed on this branch only for the pinned raw URL and is removed again before merge, following the #901/#939 + #1094 convention.)

Verification

  • vite build (renderer) passes — validates the new @import graph and CSS syntax.
  • Contract tests: control-height-converge-contract + renderer-important-audit-contract pass locally (11/11) after the paired updates; these were the two CI test failures on the first push.
  • Live-app screenshot harness: capture-screenshots.mjs --scenario settings-general and --scenario settings-about (light, 1280/990), 4/4 scenarios OK each. settings-general shows the tightened 32px sidebar rows and matching 15px titles across the personalization/toggle cards and the 默认模型/默认权限模式 card; settings-about confirms .settingsRow display rows (label + right-aligned value, mono path variant) render correctly with the converged typography.
  • Not run: Playwright E2E (no journey or selector touched), screenshot pixel-diff baselines (none tracked for these scenarios).

The settings nav rows sat on the 36px xl control tier while the
session-list rows sit on the 32px lg tier, so the two sidebars read as
different rhythms. Drop .settingsNavItem and .settingsBackButton to
--h-control-lg and move the 'settings nav row' example in the token
comments accordingly.

Also fixes three latent nav-item issues found in the same review:
- the always-semibold .settingsNavItem strong rule shadowed the active
  rule's weight change (dead declaration); weight now lives on the item
  (medium, semibold when active — same recipe as .maka-list-row-name)
- the 24px glyph track + 17px svg override contradicted the 16px icon
  the TSX renders and offset nav labels 8px from the back button label
- leftover grid-template-columns on a flex container
The .settingsRow/.settingsRows primitives (settings-rows.tsx) had their
styles scattered across four files — base layout in bot.css, states and
hint in connection.css, label/value typography in provider-editor.css,
and width variants plus the whole .settingsFormRow/.settingsField/
.settingsFormGrid family in nav-sidebar.css. That let the two row kinds
drift: on the 通用 page, .settingsFormRow titles (隐身模式) rendered
15px while adjacent .settingsRow titles (默认模型) rendered 13px, with
different padding.

Move everything into styles/settings/rows.css as the single style home
for the row primitives, and converge the contract:
- row titles: one tier (--font-size-heading / medium) for both kinds
- row padding: space-5/space-6 for both kinds
- hints: one rule (--font-size-base, muted)
- field labels (.settingsFormGrid / .settingsField): --font-size-ui,
  one tier below row titles instead of sharing the heading tier
…ntract

The control-height contract pinned .settingsNavItem/.settingsBackButton
to --h-control-xl; they now sit on --h-control-lg alongside the
session-list rows.
The consolidated settings/rows.css carries the reduced-motion
transition override that moved out of nav-sidebar.css; its only
!important site is that a11y block.
…le-file skip

rows.css is the style home for every Settings row primitive; the
isA11yOnlyFile whole-file skip would blind the audit to any future
non-a11y !important added there. Route it through the stricter
allowlist + in-file Justified: path instead (codex review P2).
Nothing guarded the rows.css convergence: .settingsRow titles could
drift back to 13px/space-4 padding silently. Pin the shared padding,
title/field/hint tiers against the comma-grouped rules so both a value
drift and a fork back into per-kind sibling rules fail (codex review
P2). Verified the pin bites: reverting padding to space-4/space-5
fails the test.
The .settingsNavItem fixture still said xl after the mapping moved to
lg; it only exercises missing-prop detection so nothing was weakened,
but the mismatch misleads (codex review P3).
@Astro-Han
Astro-Han merged commit 45b8748 into main Jul 16, 2026
3 checks passed
@Astro-Han
Astro-Han deleted the refactor/settings-rows-convergence branch July 24, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant