refactor(web): split base.css by section (pinned import order) and api.ts by domain #195
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab#195
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The two mechanical splits from the line-cap policy (#193):
web/src/base.css(3945 lines, ~39 touches/3mo) andweb/src/api.ts(1563 lines, 36 touches/3mo). Both are low-design, verification-cheap splits — bundled into one issue deliberately. Decomposition design below, per the #193 split-quality bar.Behavior-preserving. No visual change, no import-path change for existing callers.
base.css →
web/src/styles/*.csswith pinned import orderThe cascade hazard is the whole game: rules moved to a different file change specificity-tie outcomes unless order is preserved. Therefore:
base.cssstays as the entry point but becomes an ordered list of@importstatements only (Vite inlines and preserves order). Nothing else lives in it.styles/tokens.css(the:rootblocks + dark-scheme overrides — this file stays small forever),styles/type.css,styles/layout.css,styles/shell.css(side rail, drawer, mobile strip),styles/cards.css,styles/chips.css,styles/buttons.css,styles/forms.css,styles/banners.css, … through the remaining banners.min-width: 1024px,prefers-reduced-motion) that override earlier sections must stay after the sections they override — if a banner group's rules are order-coupled to another group, put them in the same file rather than relying on import order between two new files.api.ts →
web/src/api/domain modules, barrel re-exportapi.tsbecomes a pure barrel (export * from './api/...') so all ~36 importers are untouched.api/core.ts(BASE,request,ApiError,errorMessage,setUnauthorizedHandler),api/auth.ts(M1),api/credentials.ts(M2),api/repos.ts(M2),api/providers.ts(M3 providers + provider auth),api/runs.ts(M3 instances & runs), plus whatever later sections exist past line 487 (issues/PRs/settings/push — split by the same banner rule).api/core.tsif truly shared). Each module under 1000.web/src/api.test.tsfollows the same split only if needed; it is currently under cap — leave it whole if that's simpler.Sequencing & ratchet
base.cssandapi.tsentries frombaseline.json(ratchet test enforces).Acceptance
vitest,eslint,prettier --check,vite build.