MobileNavigation.tsx
The corrected navigation component
This example shows how an agent reads conventions in an existing React repository, reproduces a problem, makes a scoped edit, and runs tests and browser checks.
“The page remains locked after the mobile menu closes. Fix the regression without changing the navigation component public API, add tests, and verify desktop behavior.”
Start the project and confirm the scroll lock remains after close.
Inspect effect cleanup and multiple close paths to find the missed branch.
Centralize scroll-lock lifecycle and add open, close, and unmount tests.
Execute tests and builds and inspect desktop and mobile viewports.
The corrected navigation component
New regression coverage
Test, build, and browser-check results
Cause, behavior change, and remaining risk
Connect the repository and provide the goal, reproduction steps, and constraints.