Refactor/components pageshell#182
Merged
mikewheeleer merged 2 commits intoJun 26, 2026
Merged
Conversation
Contributor
|
clean diff — merging now |
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.
What was done Extracted the repeated main layout wrapper used across pages into a shared, reusable PageShell component to consolidate focus styling, horizontal alignment, page spacing, landmark structure, and keyboard accessibility.
Component Creation: Created src/components/PageShell.tsx rendering
with configurable properties maxWidth (Tailwind max-width suffix, defaulting to "3xl"), gap (spacing scale, defaulting to "6"), and a merged additional className. Fully documented via JSDoc.Page Migration: Migrated three pages:
src/app/settings/page.tsx (maxWidth="2xl", gap="8")
src/app/docs/page.tsx (maxWidth="3xl", gap="6")
src/app/services/new/page.tsx (maxWidth="xl", gap="6")
Documentation: Documented the PageShell props, options, and rendering rationale in docs/components.md.
Unit Testing: Created src/components/tests/PageShell.test.tsx containing tests for default configuration, custom maxWidth and gap values, fallback logic, custom class name merging, and verification that migrated pages render properly within PageShell.
How it was verified
Verified typescript typecheck:
bash
npm run typecheck
Output: Done with 0 errors
Ran PageShell test suite with 100% statement, branch, function, and line coverage:
bash
npx jest src/components/tests/PageShell.test.tsx --coverage --collectCoverageFrom=src/components/PageShell.tsx --collectCoverageFrom=src/app/docs/page.tsx --collectCoverageFrom=src/app/settings/page.tsx
Output:
----------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 100 | 100 |
app/docs | 100 | 100 | 100 | 100 |
page.tsx | 100 | 100 | 100 | 100 |
app/settings | 100 | 100 | 100 | 100 |
page.tsx | 100 | 100 | 100 | 100 |
components | 100 | 100 | 100 | 100 |
PageShell.tsx | 100 | 100 | 100 | 100 |
----------------|---------|----------|---------|---------|-------------------
Test Suites: 1 passed, 1 total
Tests: 6 passed, 6 total
closes #177