refactor(app): split components/ into layouts/ and feature sections/#8547
Merged
Conversation
Pure git mv + import-specifier rewrite, no logic changes: - src/layouts/: RootLayout, Layout (AppDataProvider), BareLayout, NavBar, Footer, MastheadRule - src/sections/landing/: HeroSection, NumbersStrip, PaletteStrip, LibrariesSection, PlotOfTheDay, PlotOfTheDayTerminal, TypewriterText, ScienceNote - src/sections/spec-detail/: SpecDetailView, SpecTabs, SpecOverview, RelatedSpecs, CodeShowcase, LibraryPills (used only by SpecPage — moved here instead of plots-gallery as originally sketched) - src/sections/plots-gallery/: FilterBar, ImagesGrid, ImageCard, ToolbarActions - src/sections/libraries/: LibraryCard - src/components/ keeps the shared primitives: LoaderSpinner, SectionHeader, ErrorBoundary, RouteErrorBoundary, CodeHighlighter, ThemeToggle, FeedbackWidget - Barrel index.ts per folder; hooks/ and utils/ barrels completed - Tests moved alongside; layouts/ and sections/ added to coverage Part 7 of the frontend modernization roadmap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the frontend folder structure by moving UI code from src/components/ into src/layouts/ (app chrome/providers) and src/sections/ (page feature blocks), while updating imports, barrels, and Vitest coverage globs accordingly.
Changes:
- Introduces
src/layouts/andsrc/sections/**structure with per-folderindex.tsbarrels. - Rewrites import specifiers across pages/routes/tests to point at the new locations.
- Extends Vitest coverage include globs to track
layouts/andsections/.
Reviewed changes
Copilot reviewed 41 out of 60 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| app/vitest.config.ts | Adds coverage include globs for src/layouts/** and src/sections/**. |
| app/src/utils/index.ts | Completes utils/ barrel exports. |
| app/src/sections/spec-detail/SpecTabs.tsx | Spec detail tabs component moved under sections/spec-detail. |
| app/src/sections/spec-detail/SpecTabs.test.tsx | Updates SpecTabs test import path. |
| app/src/sections/spec-detail/SpecOverview.tsx | Spec implementations overview grid moved under sections/spec-detail. |
| app/src/sections/spec-detail/SpecOverview.test.tsx | Updates SpecOverview test import path. |
| app/src/sections/spec-detail/SpecDetailView.tsx | Single-implementation detail view moved under sections/spec-detail. |
| app/src/sections/spec-detail/SpecDetailView.test.tsx | Updates SpecDetailView test import path. |
| app/src/sections/spec-detail/RelatedSpecs.tsx | Similar/related specs section moved under sections/spec-detail. |
| app/src/sections/spec-detail/RelatedSpecs.test.tsx | Updates RelatedSpecs test import path. |
| app/src/sections/spec-detail/LibraryPills.tsx | Library selector “pills” moved under sections/spec-detail. |
| app/src/sections/spec-detail/LibraryPills.test.tsx | Updates LibraryPills test import path. |
| app/src/sections/spec-detail/index.ts | Adds sections/spec-detail barrel. |
| app/src/sections/spec-detail/CodeShowcase.tsx | Moves CodeShowcase section under sections/spec-detail. |
| app/src/sections/plots-gallery/ToolbarActions.tsx | Extracts plots-gallery toolbar actions under sections/plots-gallery. |
| app/src/sections/plots-gallery/ToolbarActions.test.tsx | Updates ToolbarActions test import path. |
| app/src/sections/plots-gallery/index.ts | Adds sections/plots-gallery barrel. |
| app/src/sections/plots-gallery/ImagesGrid.tsx | Moves ImagesGrid under sections/plots-gallery. |
| app/src/sections/plots-gallery/ImagesGrid.test.tsx | Updates ImagesGrid test import path + mocks. |
| app/src/sections/plots-gallery/ImageCard.tsx | Moves ImageCard under sections/plots-gallery. |
| app/src/sections/plots-gallery/ImageCard.test.tsx | Updates ImageCard test import path. |
| app/src/sections/plots-gallery/FilterBar.tsx | Moves FilterBar under sections/plots-gallery and rewires ToolbarActions import. |
| app/src/sections/plots-gallery/FilterBar.test.tsx | Updates FilterBar test import path. |
| app/src/sections/libraries/LibraryCard.tsx | Moves LibraryCard under sections/libraries. |
| app/src/sections/libraries/LibraryCard.test.tsx | Updates LibraryCard test import path. |
| app/src/sections/libraries/index.ts | Adds sections/libraries barrel. |
| app/src/sections/landing/TypewriterText.tsx | Moves TypewriterText under sections/landing. |
| app/src/sections/landing/ScienceNote.tsx | Updates ScienceNote imports to new landing section locations. |
| app/src/sections/landing/PlotOfTheDayTerminal.tsx | Moves PlotOfTheDayTerminal under sections/landing. |
| app/src/sections/landing/PlotOfTheDayTerminal.test.tsx | Updates PlotOfTheDayTerminal test import path. |
| app/src/sections/landing/PlotOfTheDay.tsx | Moves PlotOfTheDay under sections/landing. |
| app/src/sections/landing/PlotOfTheDay.test.tsx | Updates PlotOfTheDay test import path. |
| app/src/sections/landing/PaletteStrip.tsx | Moves PaletteStrip under sections/landing. |
| app/src/sections/landing/NumbersStrip.tsx | Moves NumbersStrip under sections/landing. |
| app/src/sections/landing/LibrariesSection.tsx | Updates LibrariesSection to use sections/libraries/LibraryCard. |
| app/src/sections/landing/index.ts | Adds sections/landing barrel. |
| app/src/sections/landing/HeroSection.tsx | Updates HeroSection imports to landing section locations. |
| app/src/sections/landing/HeroSection.test.tsx | Updates HeroSection test mocks/imports for new paths. |
| app/src/routes/index.tsx | Switches router wiring to layouts/Layout and layouts/RootLayout. |
| app/src/pages/SpecPage.tsx | Repoints SpecPage to sections/spec-detail/* (including lazy imports). |
| app/src/pages/SpecPage.test.tsx | Updates SpecPage lazy-component mocks to new paths. |
| app/src/pages/PlotsPage.tsx | Repoints PlotsPage to sections/plots-gallery/*. |
| app/src/pages/PlotsPage.test.tsx | Updates PlotsPage mocks to new paths (including Footer). |
| app/src/pages/LibrariesPage.tsx | Repoints LibrariesPage to sections/libraries/LibraryCard. |
| app/src/pages/LandingPage.tsx | Repoints LandingPage to sections/landing/*. |
| app/src/pages/LandingPage.test.tsx | Updates LandingPage mocks to new paths. |
| app/src/layouts/RootLayout.tsx | Moves RootLayout under layouts/ and updates internal imports. |
| app/src/layouts/RootLayout.test.tsx | Updates RootLayout test mocks/imports to new paths. |
| app/src/layouts/NavBar.tsx | Moves NavBar under layouts/. |
| app/src/layouts/NavBar.test.tsx | Updates NavBar test import path. |
| app/src/layouts/MastheadRule.tsx | Moves MastheadRule under layouts/. |
| app/src/layouts/MastheadRule.test.tsx | Updates MastheadRule test import path. |
| app/src/layouts/Layout.tsx | Moves AppDataProvider (Layout) under layouts/. |
| app/src/layouts/Layout.test.tsx | Updates Layout test import path. |
| app/src/layouts/index.ts | Adds layouts/ barrel. |
| app/src/layouts/Footer.tsx | Moves Footer under layouts/. |
| app/src/layouts/Footer.test.tsx | Updates Footer test import path. |
| app/src/layouts/BareLayout.tsx | Adds BareLayout under layouts/. |
| app/src/hooks/index.ts | Completes hooks/ barrel exports. |
| app/src/components/index.ts | Keeps components/ as shared primitives barrel. |
MarkusNeusinger
added a commit
that referenced
this pull request
Jun 10, 2026
…tion (#8596) ## Summary Part 11 (final) of the frontend modernization roadmap. - **`app/ARCHITECTURE.md`**: directory layout (routes/layouts/pages/sections/components/hooks/lib/theme), conventions (`src/` alias imports, `paths.*` URL registry, `lib/api` client, theme tokens, feature folders), data flow, testing pattern, quality gates, and how-to-add recipes for pages/sections/hooks/endpoints - **`agentic/docs/project-guide.md`**: frontend section now lists the full gate (`lint`, `fm:check`, `type-check` incl. tests, `test`), mentions the dev-time checker overlay, and links the new architecture doc With this, the roadmap is complete: tooling baseline (#8519), src/ aliases (#8520), theme split (#8525), global-config (#8529), API client (#8531), routes registry (#8546), structure split (#8547), FilterBar (#8559), SpecTabs (#8564), MapPage hook (#8581). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part 7 of the frontend modernization roadmap. Pure
git mv+ import-specifier rewrite — zero logic changes.src/layouts/: RootLayout, Layout (AppDataProvider), BareLayout, NavBar, Footer, MastheadRulesrc/sections/landing/: HeroSection, NumbersStrip, PaletteStrip, LibrariesSection, PlotOfTheDay, PlotOfTheDayTerminal, TypewriterText, ScienceNotesrc/sections/spec-detail/: SpecDetailView, SpecTabs, SpecOverview, RelatedSpecs, CodeShowcase, LibraryPills (used only by SpecPage — placed here instead of plots-gallery as originally sketched)src/sections/plots-gallery/: FilterBar, ImagesGrid, ImageCard, ToolbarActionssrc/sections/libraries/: LibraryCardsrc/components/keeps shared primitives only: LoaderSpinner, SectionHeader, ErrorBoundary, RouteErrorBoundary, CodeHighlighter, ThemeToggle, FeedbackWidgetindex.tsper folder;hooks/barrel completed (+3) andutils/barrel completed (+4)layouts/andsections/added to coverageNote: ScienceNote, CodeShowcase, BareLayout, PlotOfTheDay (non-terminal) and PaletteStrip are currently dead code (only self/test references) — moved as-is rather than deleted; removal is proposed separately.
Verification
yarn lint✓ ·yarn fm:check✓ ·yarn type-check✓ ·yarn test552/552 ✓ ·yarn build✓🤖 Generated with Claude Code