feat(nav): link the docs and blog from the app, and the app from the header - #392
Conversation
…header A signed-in visitor to / is sent to /home, so the public header's Docs and Blog links were out of reach from inside the app, and a signed-in reader who did land on a docs or blog page saw Login and Register with no way back. The sidebar now ends with Docs and Blog, marked to open in a new tab, and the public header swaps Login and Register for a single Open app link once the page is live and the session says the visitor is signed in. The server HTML still carries Login and Register, and the session is the one AuthProvider already checks at the root, so the header adds no request. Claude-Session: https://claude.ai/code/session_011KBrhQHzwrB39C4c4Vw9Pq
|
Change classification: normal — platform or application code changed. A normal change carries a documented automated review on this pull request before merge, in place of a second human approver. The |
|
@claude please review this PR |
|
Claude finished @jfrench9's task in 1m 26s —— View job Review: feat(nav): link the docs and blog from the app, and the app from the header
Summary: Clean, well-scoped change that closes a real navigation gap (signed-in visitors landing on
Tests
Not independently verified: this sandbox has no No blocking issues. Nice attention to the hydration-mismatch edge case and to matching the existing |
… open in a new tab Claude-Session: https://claude.ai/code/session_011KBrhQHzwrB39C4c4Vw9Pq
Summary
A signed-in visitor to
/is redirected to/homebyLandingGate, so they never see the public header's Docs and Blog links, and nothing in the app shell linked to them. A signed-in reader who did reach a docs or blog page saw Login and Register with no way back into the app. This adds Docs and Blog to the end of the sidebar and swaps Login/Register for a single Open app link in the public header when the visitor is signed in.Changes
src/app/(app)/sidebar-config.tsx): two always-visible items after MCP / Repositories: Docs →/docs(HiBookOpen) and Blog →/blog(HiNewspaper), both withtarget: '_blank'.src/components/landing/Header.tsx, used by the landing, docs and blog layouts): desktop and mobile show Open app →/home, styled as the Register button, in place of Login and Register once the page is live and the session says the visitor is signed in.AuthProvidercontextLandingGatereads (useOptionalAuth, the non-throwing twin ofuseAuth, so the header still renders with no provider around it).AuthProviderat the root already checks the session on mount, so the header adds no network request.useSyncExternalStore, the patternLandingGateuses) keeps the server HTML identical to today: Login and Register, whatever the session.src/app/(app)/__tests__/sidebar-config.test.ts(Docs/Blog last, hrefs,target: '_blank', with no graph, a user graph and a repository);src/components/landing/__tests__/Header.test.tsx(signed-out, signed-in, loading, no provider, and server HTML under a signed-in session).Deploy Notes
None. The branch is on
@robosystems/core0.9.3 (RoboFinSystems/robosystems-core#69), whoseCoreSidebarpassestargetthrough withrel="noopener noreferrer", so the new links open in a new tab. On 0.9.2 thetargetwas ignored and the link navigated the app's own tab.Testing
env -u NEXT_PUBLIC_* ... NODE_ENV=test npm run test:all: passed (61 test files, 460 tests; format, lint, typecheck, cf-lint clean). The pre-commit hook re-ran format:check, lint, typecheck and tests, also green.npm run build: not run (no routing, layout or config change;Headerwas already a client component).🤖 Generated with Claude Code
https://claude.ai/code/session_011KBrhQHzwrB39C4c4Vw9Pq