chore(css): drop dead duplicate .settingsRow flex rule - #266
Merged
Conversation
@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.
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
styles.csshad two.settingsRowdeclarations:display: flex; gap: 10px; justify-content: space-between)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 (.settingsRowis still consumed by SettingsModal / ProvidersPanel, just from the surviving canonical rule).