refactor(components): inline Item composition and enforce component boundaries#289
refactor(components): inline Item composition and enforce component boundaries#289andrewck24 merged 12 commits intodevfrom
Conversation
- Install Shadcn Item via npx shadcn@latest add item to src/components/ui/item.tsx - Remove custom list-item compound component (superseded by Shadcn Item) - Write Storybook stories for Shadcn Item covering two item forms, action footer pattern, variant/size combinations
…tives - Rewrite PersonItem as thin wrapper over ItemMedia/ItemContent/ItemTitle - Remove href/onClick/action props; consumers use Item asChild for navigation - Add co-located PersonItemSkeleton export with data-testid markers - Install shadcn Skeleton component - Update players/list.tsx to navigable form (Item asChild + Link) - Update roster-list.tsx to static with actions form (Item + ItemActions) - Rewrite tests: data-testid for structure queries, Link instead of <a>
- Rewrite TeamItem as thin wrapper over ItemMedia/ItemContent/ItemTitle - Remove href/onClick/action/className props; consumers use Item asChild - Add co-located TeamItemSkeleton export with data-testid markers - Update invitations to action footer pattern (Item asChild + accept/reject footer) - Update menu to navigable form (Item asChild + button with className) - Rewrite tests: data-testid for structure queries, Link/button via asChild
- Move LoadingCourt from custom/loading/court.tsx to custom/court/index.tsx - Export as named export alongside other court primitives - Update team/lineup and record/index imports accordingly - Delete custom/loading/court.tsx
- Delete unused ui/sheet.tsx (zero consumers) - Relocate ui/panel.tsx to custom/panel/index.tsx, update 9 import paths - Relocate ui/flip-words.tsx to landing/flip-words.tsx, update hero.tsx import - Fix hero.test.tsx mock path for flip-words relocation
- Create docs/architecture.md with layer boundary table (ui/custom/domain) - Document testing conventions: data-testid usage, Link vs <a>, no container.querySelector - Note iterative expansion policy for future changes
Move person-item and team-item to custom/list-item/ subdirectory, mirror test structure under custom/__tests__/list-item/, and update all consumer import paths. Also use Array.from loop for LoadingCourt placeholder cards for consistency with RecordCourt pattern, and update architecture docs to reflect subdirectory grouping convention.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @andrewck24's task in 3m 12s —— View job PR Review: component architecture refactor
Overall this is a well-structured refactor. The compound component pattern for Issues1. Invalid Tailwind arbitrary-variant syntax —
|
- Deleted the Spectra: Discuss, Ingest, and Propose commands as they are no longer needed. - Updated the Spectra Apply skill to include a preflight check for missing files and adjusted the configuration file references from `openspec/config.yaml` to `.spectra.yaml`. - Enhanced the Spectra Ask skill description for clarity. - Revised the Spectra Debug skill to reference the new configuration file. - Improved the Spectra Discuss skill to include a structured approach for discussions based on codebase scouting. - Adjusted the Spectra Ingest and Propose skills to reference the new configuration file for parallel task markers.
Remove the PersonItem and TeamItem wrapper layer along with the related tests and legacy list-item story. Compose Item primitives directly in players, roster, menu, and invitations, while keeping the invitation overlay-link pattern so the row stays clickable except for the action buttons. Add the shared avatar primitive, move Storybook coverage to item.stories.tsx, and sync the archived component-architecture and storybook-modernization docs to match the final implementation.
|
Claude finished @andrewck24's task in 3m 18s —— View job PR Review: component architecture refactor
The overall refactor is clean — compound component pattern, Unresolved from previous review1. Invalid Tailwind arbitrary-variant syntax —
|
Correct the Tailwind anchor selector in ui/item.tsx and restore the missing React import in ui/skeleton.tsx. Add inline reject error feedback for invitation rows, document the overlay-link item form in docs/architecture.md, and align the menu loading placeholder with the shared Skeleton component.
|
Claude finished @andrewck24's task in 2m 56s —— View job PR Review: component architecture refactor
All four issues from the previous review have been resolved. One new finding from this pass. Resolved since last review
New findingError message paragraph sits below the navigation overlay —
|
… of toast Remove errorMap state and inline <p> error messages from InvitationItem. Errors are already handled by showErrorToast. Also delete unused team/invitation-list.tsx and its tests (dead code).
|
Claude finished @andrewck24's task in 2m 9s —— View job PR Review: component architecture refactor
All issues from prior reviews have been resolved. One note on the latest approach. Resolved since last review
Note on the latest commit (
|
|
🎉 This PR is included in version 0.12.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
This PR finishes the
component-architecturerefactor around the actual landed shape, not the earlier wrapper-based plan.Itemas the base row primitive insrc/components/ui/item.tsxPersonItemandTeamItemwrapper layer, and composeItemprimitives directly in players, roster, menu, and invitationssrc/components/ui/avatar.tsxplusItemAvatarfor the only shared domain-agnostic avatar boilerplatedocs/architecture.mdLoadingCourt,panel, andflip-words, and delete the unusedsheet.tsxcustom/list-itemStorybook coverage withsrc/stories/item.stories.tsxcomponent-architectureartifacts and relatedstorybook-modernizationdocs to match the final implementationReview Fixes
ui/item.tsxReactimport inui/skeleton.tsxSkeletoncomponentVerification
npm testnpx tsc --noEmitnpm run lintnpm run build摘要
這個 PR 完成
component-architecture重構的最終落地版本,而不是早期保留 wrapper 的方案。Item作為基礎 row primitivePersonItem/TeamItemwrapper,改由各 consumer 直接組合Itemprimitivessrc/components/ui/avatar.tsx與ItemAvatar,只保留通用 avatar boilerplatedocs/architecture.md明確記錄LoadingCourt、panel、flip-words,刪除未使用的sheet.tsxsrc/stories/item.stories.tsxcomponent-architecture與storybook-modernization文件內容,讓規格與實作一致