Repository navigation
fix(#62): complete styled-components v6 migration - #65
Conversation
PR #53 bumped styled-components to v6 without updating code still using v5-only APIs, leaving main unable to resolve modules. - Import from 'styled-components' instead of the removed 'styled-components/macro' in the ten component style.ts files, and delete babel-plugin-macros.config.js (it only configured the styled-components macro). - Replace the v5 ThemedStyledComponentsModule cast with a DefaultTheme module augmentation in src/commons/style/index.d.ts and re-export css/createGlobalStyle/keyframes/ThemeProvider directly. - Use transient props ($isOpen, $large, $sku) in Cart and Product so styling-only props are not forwarded to the DOM in v6. - Drop the stale @types/styled-components devDependency (v6 ships its own types) and update Jest snapshots; only generated class names changed. Verified with TypeScript 4.9.5 swapped into node_modules, because the TypeScript 7 on main breaks tsc and react-scripts (#60): tsc --noEmit passes, all 39 tests pass, and eslint is clean. The lockfile was updated with --legacy-peer-deps because of the same TS 7 peer conflict. Closes #62 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 10:08 AM UTC · Completed 10:22 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $4.99 |
|
<!-- fullsend:risk-assessment --> DetailsBot-authored, well-scoped migration completing issue #62 with full acceptance criteria coverage and no protected or security-sensitive paths; composite score of 2 is held at the prior assessment level, with the large blast radius (28 files, mostly auto-generated snapshots) and two dependency file changes offset by low git churn, single-author history on source files, and clear issue-to-PR traceability. Previous run<!-- fullsend:risk-assessment --> DetailsBot-authored migration scoped to issue #62 with no protected or security-sensitive paths. Two signals raise the score: the large blast radius (27 files) and the two dependency files changed. Source files show low churn and no author contention. |
ReviewFindingsLow
Earlier findings
Previous run<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6InNyYy9jb21wb25lbnRzL0NhcnQvc3R5bGUudHMiLCJpZCI6ImZfMjQ0YjMyM2YzMGE2OWIyOCIsImxpbmUiOjQ1LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6Im1pc3NpbmctdGVzdCIsImZpbGUiOiJzcmMvY29tcG9uZW50cy9DYXJ0L0NhcnQudGVzdC50c3giLCJpZCI6ImZfN2FiYTJjOWFiNDNmZTU0NSIsImFjdGlvbmFibGUiOnRydWUsImRpbWVuc2lvbiI6ImNvcnJlY3RuZXNzIn0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoidXhkLWV2YWx1YXRlLWNvZGUtaGV1cmlzdGljcyIsImZpbGUiOiJzcmMvY29tcG9uZW50cy9Qcm9kdWN0cy9Qcm9kdWN0L1Byb2R1Y3QudHN4IiwiaWQiOiJmXzIyNmQxYWM2MjRjNTczNzAiLCJsaW5lIjo1OCwiYWN0aW9uYWJsZSI6ZmFsc2UsImRpbWVuc2lvbiI6InVzZXItZXhwZXJpZW5jZSJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6InV4ZC1ldmFsdWF0ZS1jb2RlLWhldXJpc3RpY3MiLCJmaWxlIjoic3JjL2NvbXBvbmVudHMvQ2FydC9DYXJ0LnRzeCIsImlkIjoiZl85N2MxZjU5YjkwNTNiNGJkIiwibGluZSI6MjksImFjdGlvbmFibGUiOmZhbHNlLCJkaW1lbnNpb24iOiJ1c2VyLWV4cGVyaWVuY2UifV19 --> ReviewFindingsMedium
Low
Labels: Fixes a broken styled-components dependency upgrade on main by updating JavaScript dependencies and the code that uses them. Next steps:
|
|
🤖 Finished Fix · ✅ Success · Started 10:23 AM UTC · Completed 10:30 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $1.14 |
…rops Address review feedback on PR #65: - Cart/style.ts: the open-cart button background read theme.colors.black, a key that was removed from the theme long ago. The interpolation resolved to undefined, so the declaration was dropped and the button fell back to its own theme.colors.primary background. Use theme.colors.primary directly; rendered output is unchanged and the style no longer references an undefined theme key. - Cart.test.tsx: add a test that opens the cart (exercising the $isOpen=true and $large paths) and asserts that neither isOpen nor large reaches the DOM, either as an attribute or as a React unknown-prop warning. Verified that reverting $large to large makes the test fail. Not changed (pre-existing, out of scope for this migration): the Product image alt text and the cart button accessible name; both are better handled in a follow-up. Verification: tests (19 suites, 40 tests), eslint ./src, and tsc --noEmit (with TypeScript 4.9.5 swapped into node_modules, as the TS 7 on main cannot load react-scripts; see #60) all pass. No pre-commit config exists in the repo. Addresses #65 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🔧 Fix agent — iteration 1 (bot-triggered)Fixed the medium finding by replacing the undefined theme.colors.black with theme.colors.primary in Cart/style.ts (rendered output unchanged). Fixed the low missing-test finding with a Cart test that opens the cart and checks that no transient props reach the DOM; a mutation check confirmed the test catches a regression. Deferred the two pre-existing accessibility findings to a follow-up, as the review recommends. Tests (19 suites, 40 tests), eslint, and tsc --noEmit pass, using TypeScript 4.9.5 swapped into node_modules without saving it, because the TS 7 on main cannot run react-scripts (#60). With TS 4.9.5, the TS2339 error the review predicted does not occur. Fixed (3):
Disagreed (2):
Tests: passed CI inspections (3):
Conflict update: skipped; strategy Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 10:31 AM UTC · Completed 10:45 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $4.88 |
Superseded by updated review
There was a problem hiding this comment.
Note: The following review comments could not be posted on the diff (GitHub returned 422) and are included here instead:
src/components/Products/Product/Product.tsx(file-level): Line 68 ·
[low] uxd-evaluate-code-heuristics
S.BuyButton has tabIndex={-1}, removing 'Add to cart' from the tab order; keyboard users must use the outer S.Container (line 56), a div with positive tabIndex={1} and an onKeyUp handler but no semantic role. Pre-existing; unchanged by this PR.
Suggested fix: Remove tabIndex={-1} from the button (or set 0); change the container's tabIndex={1} to 0 or move the Enter handler to the button.
|
🤖 Finished Retro · ✅ Success · Started 12:11 PM UTC · Completed 12:36 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $4.28 |
Retro: PR #65 (styled-components v6 migration, issue #62)Timeline: triage (3.5m, $0.49) → code (6.7m, $1.16) → review #1 request-changes (14m, $4.99) → fix (8m, $1.14) → review #2 approve (15m, $4.88) → repo What went well: the migration was complete (no v5 leftovers, transient props applied consistently); the fix agent verified its own test with mutation checks; review #2 correctly spotted that the new Main finding (1 proposal): the only rework round was avoidable. The code agent rewrote the exact line containing the undefined Evidence for existing issues (not re-filed):
Minor, not filed: the PR's new test merged with the low-severity order-dependence finding open. The pre-existing accessibility findings (alt on div, missing aria-label, tabIndex order) were posted again on re-review, deferred as out of scope, and have no follow-up issue, because follow-up creation is disabled (fullsend-ai/fullsend#1352). Proposals filed |
Summary
This finishes the styled-components v6 migration that PR #53 started. That PR changed only
package.jsonandpackage-lock.json, so the source still uses v5-only APIs.Changes
style.tsfiles now import fromstyled-componentsinstead ofstyled-components/macro, which v6 no longer ships.babel-plugin-macros.config.jsis deleted because it only configured the styled-components macro.src/commons/style/index.d.tsnow addsStyleClosetThemetoDefaultThemevia module augmentation. This replaces the v5ThemedStyledComponentsModulecast and the oldcreateGlobalStyledeclarations.src/commons/style/styled-components.tsnow re-exportsstyled,css,createGlobalStyle,keyframesandThemeProviderdirectly.isOpen→$isOpenandlarge→$large(Cart),sku→$sku(Product). v6 no longer forwards these styling-only props to the DOM.@types/styled-components(v6 ships its own types). The lockfile change only removes that package and two transitive packages nothing else uses.Loader__Container-sc-5z440p-0→sc-bdnzMm), and no prop attributes appear in the DOM.Testing
grep -r "styled-components/macro" srcfinds nothing.npx eslint ./srcis clean.tsc --noEmitpasses and all tests pass (19 suites, 39 tests). The test run shows no styled-components or React unknown-prop warnings.Caveats
tsconfig.json, and react-scripts can't load it. To runtscand the tests, I temporarily swapped TypeScript 4.9.5 intonode_modules.package.jsonwas not changed.npm run buildwill fully work only after Restore a react-scripts-5-compatible TypeScript (^4.9.5) and ignore TypeScript major bumps in dependabot.yml #60 / fix(#60): restore TypeScript 4.9 and ignore TS majors in dependabot #61 lands.npm uninstall --package-lock-only --legacy-peer-depsbecause of the same TS 7 peer conflict.Cart/style.tsreadstheme.colors.black, which isn't defined in the theme. v6 doesn't flag this, and behavior is unchanged.prettier --checkalso flagsCart.tsxandCartProduct/style.ts, but those files fail it on main too, so I left them alone.🤖 Generated with Claude Code
Closes #62
Post-script verification
agent/62-styled-components-v6-migration)b43a8796bb612bb0e9a5b3ad100109761b01a1c6..HEAD)