Conversation
This comment was marked as outdated.
This comment was marked as outdated.
| interface Props { | ||
| children: React.ReactNode; | ||
| } |
There was a problem hiding this comment.
💡 Minor suggestion: Consider more descriptive naming
The generic name Props could be more descriptive:
interface PageLayoutProps {
children: React.ReactNode;
}
export default function PageLayout({ children }: PageLayoutProps) {This follows common React conventions and improves code searchability. Not blocking, just a style preference.
This comment was marked as outdated.
This comment was marked as outdated.
… attribute for PageLayout
This comment was marked as outdated.
This comment was marked as outdated.
| it("returns h-screen when path is index", async () => { | ||
| const pageLayout = await pageSetup("/"); | ||
|
|
||
| expect(pageLayout).toHaveClass("h-screen"); | ||
| expect(pageLayout).not.toHaveClass("sm:pt-32", "sm:pb-16"); | ||
| }); | ||
|
|
||
| it("returns h-screen when path starts with /letter", async () => { | ||
| const pageLayout = await pageSetup("/letter/oregon-law-help"); | ||
|
|
||
| expect(pageLayout).toHaveClass("h-screen"); | ||
| expect(pageLayout).not.toHaveClass("sm:pt-32", "sm:pb-16"); | ||
| }); | ||
|
|
||
| it("returns h-screen when path starts with /letter", async () => { | ||
| const pageLayout = await pageSetup("/about"); | ||
|
|
||
| expect(pageLayout).not.toHaveClass("h-screen"); | ||
| expect(pageLayout).toHaveClass("sm:pt-32", "sm:pb-16"); | ||
| }); |
There was a problem hiding this comment.
Great start on testing! Consider adding these additional test cases for more comprehensive coverage:
- Static
/letterroute (no params):
it("returns h-screen when path is /letter (no params)", async () => {
const pageLayout = await pageSetup("/letter");
expect(pageLayout).toHaveClass("h-screen");
});- Other static pages (
/disclaimer,/privacy-policy):
it("returns sm:pt-32 sm:pb-16 for /disclaimer", async () => {
const pageLayout = await pageSetup("/disclaimer");
expect(pageLayout).toHaveClass("sm:pt-32", "sm:pb-16");
});- Children rendering:
it("renders children correctly", () => {
const { container } = render(
<MemoryRouter initialEntries={["/"]}>
<PageLayout>
<div>Test</div>
</PageLayout>
</MemoryRouter>
);
expect(screen.getByTestId("test-child")).toBeInTheDocument();
});These additional tests would bring the coverage in line with the thoroughness of other component tests in the codebase (like About.test.tsx).
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Need adjustment with recent merges, revert to draft |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Claude finished @leekahung's task in 3m 19s —— View job Code Review Complete ✅
CI Status: PR Checks ✅ | CodeQL in progress SummarySolid refactoring that achieves its stated goal cleanly. Code QualityThe core change is straightforward and well-executed. One observation in SecurityNo concerns. Performance
TestingCore conditional logic is covered: index path → Documentation
Issues FoundMust Fix: None Non-blocking (inline comments posted):
|
|
Claude finished @leekahung's task in 1m 51s —— View job Code Review Complete ✅
What Changed Since Last ReviewThe two previous non-blocking suggestions were implemented in commit
Both are clean fixes. SummaryThe PR is in good shape. Code Quality
One minor nit in SecurityNo concerns. PerformanceNo regressions. TestingThe three existing tests cover the key branching logic. Two items from last review remain as nice-to-haves:
Issues FoundMust Fix: None Non-blocking:
|
|
Claude finished @leekahung's task in 2m 39s —— View job Code Review Complete ✅
What Changed Since Last ReviewThe branch was rebased onto main ( SummaryThe core refactor is solid. Code QualityThe One new issue in SecurityNo concerns. PerformanceNo regressions. TestingThree tests cover the branching logic correctly. Two carry-over nits remain (see inline comments). Documentation
Issues FoundMust Fix: None Non-blocking (inline comments posted):
|
| "hover:text-green-dark hover:bg-green-light hover:opacity-70", | ||
| "hover:outline hover:outline-paper-background hover:rounded", | ||
| "no-underline", | ||
| isActive ? "bg-green-medium rounded" : "no-underline", |
There was a problem hiding this comment.
Carry-over from last review: "no-underline" appears twice — once unconditionally on line 38 and again in the inactive branch here. The inactive branch one is redundant.
| isActive ? "bg-green-medium rounded" : "no-underline", | |
| isActive ? "bg-green-medium rounded" : "", |
|
Claude finished @leekahung's task in 1m 29s —— View job Code Review Complete ✅
What Changed Since Last ReviewThe two non-blocking suggestions from the Feb 23 review were addressed in commit
SummaryThis PR is ready. All must-fix items were absent from the start, and all non-blocking suggestions across four review rounds have now been resolved. The Code Quality
SecurityNo concerns. PerformanceNo regressions. TestingThree tests cover the branching logic. Two carry-over nits persist but are non-blocking:
Documentation
Issues FoundMust Fix: None Non-blocking (carry-overs, both pre-existing from prior reviews):
|
What type of PR is this? (check all applicable)
Description
This is a minor PR to refactor common styles for pages into a single layout component. It's mainly to make the UI more maintainable; it should have no visual changes. Architecture.md has been updated to include the new layout component.
The package
clsxhas also been added to help with conditional Tailwind classes in components.Related Tickets & Documents
QA Instructions, Screenshots, Recordings
Please replace this line with instructions on how to test your changes, a note on the devices and browsers this has been tested on, as well as any relevant images for UI changes.
Added/updated tests?
Documentation
Architecture.mdhas been updated[optional] Are there any post deployment tasks we need to perform?