Skip to content

chore(css): drop dead duplicate .settingsRow flex rule - #266

Merged
jackwener merged 2 commits into
mainfrom
yuejing/dedup-settings-row
Jun 25, 2026
Merged

chore(css): drop dead duplicate .settingsRow flex rule#266
jackwener merged 2 commits into
mainfrom
yuejing/dedup-settings-row

Conversation

@jackwener

Copy link
Copy Markdown
Member

Summary

styles.css had two .settingsRow declarations:

  • Line 8960: simple flex (display: flex; gap: 10px; justify-content: space-between)
  • Line 9309: full grouped-card grid (display: grid; grid-template-columns: minmax(150px, 0.36fr) minmax(0, 1fr); padding: 16px 20px; border-bottom: hairline; …)

The grouped-card rule overrides every property of the flex rule except justify-content: space-between — which is a no-op once layout flips to a 2-fr grid that fills the container. First rule was truly dead and was leaving readers confused about which recipe owns the chrome.

Drop the duplicate. The grouped-card rule at line ~9300 is now the unambiguous source of truth for the settings row chrome.

Test plan

  • renderer-style-pruning-contract.test.ts — 2/2 pass (.settingsRow is still consumed by SettingsModal / ProvidersPanel, just from the surviving canonical rule).

@WAWQAQ msg `f1461d30`「用库的应该用库」: keep collapsing local
hand-rolled wrappers into shared `@maka/ui` primitives.

The 17-line `Switch` adapter inside SettingsModal.tsx that reshapes
Base UI's `{ checked, onCheckedChange, aria-label }` API into the
settings-toggle `{ ariaLabel, checked, onChange, disabled,
ariaDescribedBy }` shape now lives at
`packages/ui/src/primitives/settings-switch.tsx` as `SettingsSwitch`.

SettingsModal imports it aliased as `Switch` so all 15+ call sites
stay byte-identical:

  import { SettingsSwitch as Switch, … } from '@maka/ui';

The local `function Switch` is gone (replaced with a 4-line breadcrumb
comment pointing at the new home).

The other `<Switch>` consumer in `packages/ui/src/components.tsx:2290`
already uses Base UI's direct API (`<Switch checked={false} disabled
aria-label="…" />`) and stays untouched — it's not a settings-row
toggle.

Verified clean:
  ✔ @maka/ui build
  ✔ tsc -p apps/desktop/tsconfig.renderer.json (only pre-existing
    unrelated TS2366)
  ✔ renderer-style-pruning-contract.test.ts 2/2 (kenji's selector
    inventory guard found no new orphan CSS)
… grouped-card grid rule)

`styles.css` had two `.settingsRow` declarations:
- Line 8960: simple flex row (`display: flex; gap: 10px;
  justify-content: space-between`)
- Line 9309: full grouped-card grid (`display: grid;
  grid-template-columns: minmax(150px, 0.36fr) minmax(0, 1fr);
  padding: 16px 20px; border-bottom: hairline; …`)

The grouped-card rule overrides every property of the flex rule
except `justify-content: space-between`, which is a no-op once the
layout flips to a 2-fr grid that fills the container. The first rule
was therefore truly dead and was leaving readers confused about which
recipe owns the chrome.

Drop the duplicate. The grouped-card rule at line ~9300 is now the
unambiguous source of truth for the settings row chrome.

The inventory guard (`renderer-style-pruning-contract.test.ts`)
still passes — `.settingsRow` is fully consumed by SettingsModal /
ProvidersPanel.
@jackwener
jackwener merged commit 0d45406 into main Jun 25, 2026
@jackwener
jackwener deleted the yuejing/dedup-settings-row branch June 25, 2026 18:56
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