Skip to content

chore(css): drop 2 more verified-dead selectors (.providerCatalog, .connectionStatus) - #255

Merged
jackwener merged 2 commits into
mainfrom
yuejing/round-a-extended-css-sweep
Jun 25, 2026
Merged

chore(css): drop 2 more verified-dead selectors (.providerCatalog, .connectionStatus)#255
jackwener merged 2 commits into
mainfrom
yuejing/round-a-extended-css-sweep

Conversation

@jackwener

Copy link
Copy Markdown
Member

Summary

Round A-extended sweep after #254. @WAWQAQ 「继续」 (msg 76e36d3b). Sticking to zero-visual-risk cleanup while @kenji is offline and the ChoiceCard primitive (Round C) still needs the visual-smoke harness.

Two more dead selectors found in apps/desktop/src/renderer/styles.css:

  • .providerCatalog — bare base class. .providerCatalogRow / .providerCatalogTitle / .providerCatalogDesc etc. are live in ProvidersPanel.tsx, but nothing renders the bare class.
  • .connectionStatus[data-ok=\"false\"] — combinator. No element ever carries the connectionStatus class in the renderer; the live arm is .settingsConnectionBadge[data-tone]. The other arm in the same rule (.providerError) is unrelated and stays.

Both promoted into renderer-style-pruning-contract.test.ts's retired-hook list (now locks 16). The \\.${hook}\\b boundary keeps .providerCatalogRow / .settingsConnectionBadge siblings clear.

Test plan

  • tsc on the touched test file — clean.
  • node --test renderer-style-pruning-contract.test.js — pass (1/1) after the 2 additions.
  • grep -rn 'connectionStatus\\|providerCatalog' apps packages --include='*.tsx' --include='*.ts' — no live consumers of the dead class names.

… one primitive + dead selector sweep

@kenji styles inventory task #128
(`notes/maka-styles-css-inventory-2026-06-25-task-128.md`) flagged that
`styles.css` (14066 lines) had become the product's UI database, with
the Settings select and Plan Reminder select drifted into two
near-identical wrappers + two CSS recipes. The Plan Reminder copy
got a real bug fix (selected-trigger icon) in PR #250; the Settings
copy never did.

@WAWQAQ msg `dea869c5` "做久一点 / 一次多做点" + msg `61862591`
authorizing this round; coordination ack `a137b9d7`. This bundles
Round A (dead selector sweep) and Round B (shared Rich Select
primitive + call-site migration) into one PR.

**Round B — shared SettingsSelect primitive.**
- New `packages/ui/src/primitives/settings-select.tsx`. Option type
  `[value, label, icon?]`; `width` variant (`compact` | `select` |
  `full`); the trigger uses `SelectValue`'s function-child so the
  collapsed picked state renders the same icon + label row as the
  popup items.
- `PlanReminderSelect` in `components.tsx` collapsed to a thin
  `<SettingsSelect width="full" {...props} />` specialization. Both
  surfaces now share one source of truth.
- `SettingsModal.tsx` drops its local `SettingsSelect` definition; the
  5 existing call sites (Daily Review 分析模型, Proxy 代理协议, Gateway
  监听地址, Bot 域名, Usage 状态筛选) automatically pick up the imported
  primitive — same `[value, label]` props still work.
- CSS: rename `.maka-plan-select*` / `.settingsBaseSelectTrigger*` →
  `.settingsSelect*` family on the primitive side; drop the
  `.settingsBaseSelectPopup` block that no longer has a consumer.
  `.settingsRow[data-control-width="select"]` and
  `.settingsField[data-orient="horizontal"]` keep the same width
  contract, now keyed off `.settingsSelectTrigger`.

**Round A — dead selector sweep.**
Per @kenji inventory the following had zero JSX/TSX consumers; I
re-verified each with `grep --include='*.tsx'`:
  - `.maka-nav-primary` (3 rules under `.maka-session-panel[data-
    collapsed="true"]`)
  - `.maka-skill-workbench-rail`

Promoted both into `renderer-style-pruning-contract.test.ts`'s
retired-hook list alongside the 12 already locked there. The contract
test (`✔ does not keep CSS for retired renderer hooks`) passes after
the deletion.

Net: +162 / -148 lines. One source of truth for the Settings/Plan
Reminder Select chrome; one less wrapper and ~24 lines of dead CSS to
maintain. Round C (ChoiceCard/RadioCard) and Round D (CSS ownership
split) still on @kenji's plan.
…k contract

Round A-extended (yuejing 2026-06-25). @WAWQAQ 「继续」 (msg
`76e36d3b`) after #254 landed. Sticking to zero-visual-risk cleanup
while @kenji is offline and the ChoiceCard / RadioCard primitive
(Round C) still needs a visual-smoke harness to be safe.

Found two more selectors with zero JSX/TSX consumers via the standard
sweep against `apps/desktop/src/renderer/styles.css`:

- `.providerCatalog` — bare base class. `.providerCatalogRow` /
  `.providerCatalogTitle` / `.providerCatalogDesc` etc. are live in
  `ProvidersPanel.tsx`, but nothing renders the bare class itself.
- `.connectionStatus[data-ok="false"]` — combinator. No element ever
  carries the `connectionStatus` class in the renderer; the live
  status arm in the codebase is `.settingsConnectionBadge[data-tone]`,
  and `.providerError` (the other arm of the same rule) is unrelated
  and stays.

Both promoted into `renderer-style-pruning-contract.test.ts`'s
retired-hook list (now locks 16). `\.${hook}\b` boundary keeps the
live `.providerCatalogRow` / `.settingsConnectionBadge` siblings
clear.
@jackwener
jackwener merged commit 09ee0e1 into main Jun 25, 2026
@jackwener
jackwener deleted the yuejing/round-a-extended-css-sweep branch June 25, 2026 11:47
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