Skip to content

refactor(ui): relocate settings CSS into per-surface files (#546 PR1) - #588

Merged
Astro-Han merged 3 commits into
mainfrom
refactor/546-pr1-settings-relocation
Jul 6, 2026
Merged

refactor(ui): relocate settings CSS into per-surface files (#546 PR1)#588
Astro-Han merged 3 commits into
mainfrom
refactor/546-pr1-settings-relocation

Conversation

@Astro-Han

Copy link
Copy Markdown
Contributor

Summary

Phase A "settings relocation" pass (#546 PR1): dissolve the four grab-bag CSS files and split the misplaced chat content out of settings/models.css, so every CSS file matches a single surface. Zero visual change.

Why

Refs #546. Post-#520 CSS governance: filenames and actual selectors diverged widely — tool-stream.css held 4 unrelated surfaces, settings/models.css was 71% chat content, health-center/permission-center belong under settings/ but sat at the styles root. Relocate first (zero visual change, governed by the converge contracts), polish per-surface later (Phase B/C).

Scope

Changed:

  • Dissolved tool-stream.css (4 surfaces) → settings/{web-search,memory}.css + onboarding.css + daily-review.css
  • health-center.csssettings/health.css; permission-center.csssettings/permission.css
  • settings/models.css lines 285-1016 (artifact pane, browser panel, turn highlight, session-branch banner) → new chat-detail.css
  • settings/connection.css memory meta row → settings/memory.css
  • settings/form.css runtime permission diff/raw → new permission-dialog.css
  • settings-select.csssettings/select.css (SettingsSelect chrome) + model-switcher.css (ModelPicker)
  • styles.css + styles/settings.css @import lists updated
  • 2 contract tests adapted to the new file layout / import order

Not included:

  • PR0 (TSX typography contract extension) — separate worktree
  • PR2 (chat-header split), PR3 (sidebar/onboarding/composer) — other Phase A PRs, independent file sets
  • Any visual/polish change (Phase B/C)

Verification

  • Zero visual change: expanded styles.css's full @import tree before (main) and after (this branch) using the same expandCssImports path the converge contracts use, normalized each top-level rule, sorted, and diffed — identical (1682 rules both sides).
  • npm run -w @maka/desktop test2134 pass, 0 fail (includes every converge contract).
  • Renderer build → CSS compiles, all @import paths resolve.
  • All touched files verified brace-balanced.

User-facing impact

None. Pure CSS relocation; selectors and declarations are byte-identical, only their file location changes.

Reviewer notes

  • The two test edits are forced by the relocation: one test hardcoded the deleted settings-select.css path; the other used a greedy cross-rule regex ([\s\S]*min-height: 32px) that only passed because of the old import order — it now anchors inside one rule block ([^}]*) and matches the actual control-lg token.
  • chat-detail.css is a new transitional surface; PR5 polishes artifact/browser there.
  • Rollback: revert both commits; no schema/migration/state change.

Checklist

  • Scope matches the PR title and excludes unrelated changes
  • Verification lists commands/results
  • User-facing impact: none (pure relocation)
  • Risk/rollback called out
  • UI changes: no screenshot — zero visual change proven by rule-set diff + converge contracts

Astro-Han added 3 commits July 7, 2026 03:21
Dissolve the grab-bag files (tool-stream, health-center, permission-center,
settings-select) and split the misplaced chat content out of
settings/models.css so every CSS file matches a single surface. Zero
visual change: every top-level rule is preserved verbatim, verified by
expanding styles.css's @import tree before and after and diffing the
sorted rule set (identical, 1682 rules both sides).

Surfaces relocated:
- tool-stream.css (4 surfaces) -> settings/{web-search,memory}.css +
  onboarding.css + daily-review.css, then deleted
- health-center.css -> settings/health.css
- permission-center.css -> settings/permission.css
- settings/models.css lines 285-1016 (artifact pane, browser panel, turn
  search-highlight, session-branch banner) -> chat-detail.css
- settings/connection.css memory meta row -> settings/memory.css
- settings/form.css runtime permission diff/raw -> permission-dialog.css
- settings-select.css -> settings/select.css (SettingsSelect chrome) +
  model-switcher.css (ModelPicker combobox)

styles.css and styles/settings.css @import lists updated accordingly.

Part of #546.
…tion

Two contract tests assumed the old file layout / cross-file import order:
- model-thinking-level-contract readModelPickerCss hardcoded
  settings-select.css (deleted in the previous commit) -> now reads
  settings/select.css, where the SettingsSelect chrome now lives.
- session-sticky-model-contract used a greedy [\s\S]* regex that matched
  `min-height: 32px` across rule boundaries; it passed only because
  settings-select.css was imported before model-switcher.css. Now anchors
  inside one rule block ([^}]*) and matches the actual control-lg token
  (= 32px), so it no longer depends on cross-file @import order.

Part of #546.
…t move

Codex review caught a cascade regression: settings/select.css was imported
via settings.css (which sits after model-switcher.css in styles.css), so
.settingsSelectMenuPopup { overflow-y: auto } landed AFTER
.modelPickerPopup { overflow: hidden }. Same specificity -> later wins, so
the ModelPicker outer popup scrolled instead of only .modelPickerList,
breaking the pinned search/footer on long catalogs.

Import settings/select.css directly from styles.css, immediately before
model-switcher.css, restoring main's order (settings-select was imported
just before model-switcher there too). Rule set unchanged; only the
cross-file cascade order is restored to main parity.
@Astro-Han
Astro-Han merged commit 666738a into main Jul 6, 2026
3 checks passed
@Astro-Han
Astro-Han deleted the refactor/546-pr1-settings-relocation branch July 14, 2026 05: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