Component cleanup #49
Reference in New Issue
Block a user
Delete Branch "adilallo/maintenance/ComponentCleanup"
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?
Component library reorg, Figma registry updates, and cleanup
Overview
This PR reorganizes
app/componentsinto clearer buckets (asset, cards, controls, modals, navigation, sections, type, utility), aligns naming with Figma-oriented conventions, moves admin-only UI (Web Vitals dashboard) next to its route, and refreshes docs and Cursor rules. It also applies a focused ESLint/React fix pass (hook deps, modal composition,next/imagefor the string-URL icon fallback) and removes staleTODO(figma)placeholders from container docstrings in favor of explicit paths and canonical-code notes.Changes
IconCard→Icon,MiniCard→Mini,RuleCard→Rule,Card→Selection,NumberCard→Step;NumberedCards→CardSteps(home / marketing step lists).MenuBar→Menu,MenuBarItem→MenuItem,TopNav→Top(including pathname-aware wrapper).asset/;Iconusesnext/imagewithunoptimizedwhen SVG imports resolve to a string URL ( satisfies@next/next/no-img-element).type/CommunityRule,type/Section,type/TextBlock;SectionHeaderlives undertype/; removes unusedCommunityRuleDocument/DecisionMakingSidebar/Separatorand Context menu components and their stories/tests.ModalHeader/ModalFooterundermodals/;InfoMessageBoxundercontrols/;CreateFlowFooter/CreateFlowTopNavstay under navigation but paths updated;useCreateModalA11yeffect deps includedialogReffor exhaustive-deps.WebVitalsDashboardcolocated underapp/(admin)/monitor/_components/.buildPublishPayload/templateReviewMappingand related guards adjusted;messagesupdated (cardSteps,menurename, removal ofnumberedCardskeys where replaced).public/assets/vector/with normalized filenames.Dialog.container: renderchildrenas JSX children of the view (avoid duplicate prop pattern).TemplateReviewCard:useMemodependency list fixed for compiler /react-hooksrules..cursor/rules/component-props.mdc: Figma traceability without recommendingTODO(figma); other docs/rules (component-structure,routes,create-flow, AGENTS, README, docs/README, create-flow.md, figma-component-registry, backend tickets doc) updated for the new layout.CardSteps,Top,Selection,Step, etc.); removed tests for deleted components; added/adjusted coverage forSection,TextBlock,CommunityRulewhere applicable.How to Test
npm installif needed;npm run devfor the app;npm run storybookfor component stories./monitor(Web Vitals dashboard), marketing/rules/[id], andnot-foundif you hit an unknown route.npx tsc --noEmitnpx vitest runnpx eslint app/components --ext .ts,.tsx(expect clean; confirms Icon + a11y hook warnings addressed)npx next buildNotes
Figma: "…" (node-id)and short “canonical code under …” notes; filling in real node IDs everywhere can be a follow-up.docs/figma-component-registry.md, update the issue body separately; the repo doc is the source of truth for the Type/registry section.