Skip to content

Commit 5838b68

Browse files
authored
chore(design-system): re-sync @uploads/ui to Claude Design (#665)
* chore(design-system): re-sync @uploads/ui to Claude Design Re-sync of the 14-component library to the "Uploads" Claude Design project. All 14 verified-by-upload against the project's `_ds_sync.json` anchor — no component sources changed, so nothing needed re-grading. Three sync inputs corrected along the way: - `Progress` and `Select` now take `cardMode: "column"`. A newer converter measures grid cells differently and flagged both `[GRID_OVERFLOW]`; NOTES.md had recorded them as fitting the default width. Their preview sheets were re-checked after the fix and still grade good. - `conventions.md` now lists `Button`'s `solid` variant and `icon` prop. Both ship real CSS and JSDoc, but the header predated them — the design agent would never have learned `solid` exists. - NOTES.md: the worktree build recipe said `npx tsup`, which emits no declarations (`dts: false` in tsup.config.ts). Corrected to `npm run build`, plus a note that header drift is usually additive rather than renames. Validate exits clean with no warnings; render check 14/14. * fix(design-system): re-sync on top of #664 after a stale-base upload The earlier sync in this branch was built from a worktree branched at #663, one commit before #664 landed. It rebuilt and re-uploaded the pre-#664 stylesheet about an hour after that fix merged, restoring the exact `--ul-progress-fill` declaration #664 removed. The Claude Design agent kept reporting the finding against the uploaded CSS and was correct to. Rebased onto `origin/main` (9f0de53), rebuilt, and re-uploaded. The shipped bundle now has zero `--ul-*` custom-property declarations; the token count drops 32 -> 31. Progress still renders three distinct bands through `currentColor` (sheets re-checked, grades held), render check 14/14, validate clean with no warnings. Adds a Re-sync risk note: a sync uploads whatever the tree builds, so a stale base silently reverts merged design-system fixes and the anchor diff cannot catch it — the bundle genuinely changed and reads as a legitimate update. Fetch and check `origin/main` before building, then grep the built bundle for whatever the most recent DS fix removed.
1 parent 9f0de53 commit 5838b68

3 files changed

Lines changed: 39 additions & 7 deletions

File tree

.design-sync/NOTES.md

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@ restage by hand (or copy from main) in those worktrees.
4242
with **tsup**`packages/ui/dist/{index.js,index.d.ts,uploads-ui.css}`.
4343
- `cfg.buildCmd` = `pnpm --filter @uploads/ui build`. That needs the package's
4444
devDeps installed. In an isolated worktree with no workspace install, build it
45-
standalone: `cd packages/ui && npm install --no-save --no-package-lock && npx tsup`
45+
standalone: `cd packages/ui && npm install --no-save --no-package-lock && npm run build`
4646
(npm avoids pnpm workspace resolution; approve the esbuild postinstall).
47+
**Use `npm run build`, not `npx tsup`.** `tsup.config.ts` sets `dts: false`, so
48+
tsup alone emits only `index.js` + `uploads-ui.css`; the 12 `.d.ts` files come
49+
from the second half of the build script (`tsc -p tsconfig.build.json
50+
--emitDeclarationOnly --outDir dist`). Skip it and every `<Name>Props` contract
51+
the design agent codes against degrades silently.
4752
- Converter invocation (from repo root):
4853
`node .ds-sync/package-build.mjs --config .design-sync/config.json --node-modules packages/ui/node_modules --entry ./packages/ui/dist/index.js --out ./ds-bundle`
4954
`PKG_DIR` is walked up from `--entry`, so the entry must be the real
@@ -88,19 +93,36 @@ restage by hand (or copy from main) in those worktrees.
8893
- Playwright + chromium live under `.ds-sync/node_modules` (see restage above —
8994
install with the other converter deps in one `npm i`). On a fresh clone the
9095
`.ds-sync/` tree is gitignored and regenerated, so reinstall before validating.
91-
- 5 components use `cfg.overrides.<Name>.cardMode = "column"` (Button, Divider,
92-
Field, GalleryTile, Panel) to resolve `[GRID_OVERFLOW]` — their previews are wider
93-
than a grid cell. Not a warn once the override is applied.
96+
- 7 components use `cfg.overrides.<Name>.cardMode = "column"` (Button, Divider,
97+
Field, GalleryTile, Panel, Progress, Select) to resolve `[GRID_OVERFLOW]` — their
98+
previews are wider than a grid cell. Not a warn once the override is applied.
99+
- **Progress and Select were added to that list on the 2026-08-14 re-sync.** The
100+
2026-08-14 sync recorded them as fitting the default card width; a later converter
101+
measures grid cells differently and flagged both `[GRID_OVERFLOW]` (`wide`). If a
102+
future converter flags more components the same way, the remedy is the same one
103+
the warn names — merge `cardMode: "column"`, then
104+
`preview-rebuild.mjs --components <them>`; grades carry through it.
94105
- No `[RENDER_THIN]` / `variants-identical` warns to record — all cells graded good.
95106
- **Progress** and **Select** were added to `@uploads/ui` and authored on the
96107
2026-08-14 sync (`previews/Progress.tsx`, `previews/Select.tsx`) — 3 cells each,
97-
all graded good, no grid override needed (default card width fits). Select is a
108+
all graded good (both later needed `cardMode: "column"`, see above). Select is a
98109
new export from `Field.tsx` (`ul-select` / compact `ul-select--sm`); Progress is
99110
its own file (`ul-progress__*`, `data-level` fill bands). Both added to
100111
`conventions.md`. That brought the DS from 12 → 14 components.
101112

102113
## Re-sync risks
103114

115+
- **Sync from an up-to-date `main`, and check before uploading.** A sync uploads
116+
whatever the working tree builds, so a stale base silently *reverts* merged
117+
design-system fixes in the Claude Design project — the anchor diff can't catch
118+
it, because the bundle genuinely changed and looks like a legitimate update.
119+
This bit us on 2026-08-14: a worktree branched at #663 re-synced ~1h after #664
120+
merged and re-uploaded the pre-#664 stylesheet, restoring the exact
121+
`--ul-progress-fill` declaration #664 removed. The design agent kept reporting
122+
the finding and was correct. **Run `git fetch && git log --oneline -3
123+
origin/main` before the build**, and after building grep the bundle for
124+
whatever the most recent DS fix removed
125+
(`grep -c 'ul-progress-fill' ds-bundle/_ds_bundle.css` → expect 0).
104126
- **Harness is not in git** — if `.ds-sync/` is missing, restage before build/
105127
validate (see "Converter harness" above). Worktrees only inherit it when main
106128
already has a staged copy.
@@ -110,6 +132,12 @@ restage by hand (or copy from main) in those worktrees.
110132
- `.design-sync/conventions.md` enumerates real tokens/props/components validated
111133
against the build. If `packages/ui` renames a token or component, re-validate the
112134
header (the base skill's conventions step does this) and fix drift.
135+
**Drift is usually additive, not renames** — the 2026-08-14 re-sync found
136+
`Button.variant` had gained `"solid"` (a real variant with its own
137+
`ul-btn--solid` CSS) while the header still listed only four. Nothing the header
138+
named was wrong, so a name-existence check alone passes; also diff each
139+
enumerated union against the fresh `<Name>.d.ts` for *added* members, or the
140+
design agent never learns the new option exists.
113141
- The scoped `npm install` in `packages/ui` writes no lockfile (`--no-package-lock`),
114142
so the exact tsup/esbuild versions aren't pinned there — the committed
115143
`package.json` ranges are the source of truth. A real `pnpm install` at repo root

.design-sync/config.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
"Divider": { "cardMode": "column" },
1212
"Field": { "cardMode": "column" },
1313
"GalleryTile": { "cardMode": "column" },
14-
"Panel": { "cardMode": "column" }
14+
"Panel": { "cardMode": "column" },
15+
"Progress": { "cardMode": "column" },
16+
"Select": { "cardMode": "column" }
1517
}
1618
}

.design-sync/conventions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ Build every screen inside one.
3232
There is **no utility-class vocabulary to author**. Style two ways only:
3333

3434
1. **Component props** carry the design language:
35-
- `Button``variant` (`default | primary | ghost | danger`), `size` (`sm | md | lg`), `block`
35+
- `Button``variant` (`default | primary | solid | ghost | danger`; `solid`
36+
fills with the accent — at most one per surface), `size` (`sm | md | lg`),
37+
`block`, `icon`
3638
- `Callout``tone` (`info | ready | error | muted`), `title`
3739
- `Badge``tone` (`neutral | accent | ok | danger`), `dot`
3840
- `Field``label`, `hint`, `invalid`

0 commit comments

Comments
 (0)