Skip to content

feat(ui): desktop page navigation + New Chat fix#315

Merged
dimakis merged 1 commit into
mainfrom
session/2026-05-06-952f62950235
May 6, 2026
Merged

feat(ui): desktop page navigation + New Chat fix#315
dimakis merged 1 commit into
mainfrom
session/2026-05-06-952f62950235

Conversation

@dimakis
Copy link
Copy Markdown
Owner

@dimakis dimakis commented May 6, 2026

Summary

  • Adds DesktopNav component to the left sidebar so desktop users can navigate to Calendar, Inbox, Telos, Tasks, and Files (previously only reachable by typing URLs)
  • Non-chat pages now render inside DesktopShell on desktop via PageRoute wrapper — nav sidebar on the left, no right panel
  • Fixes the New Chat button which was broken because history.replaceState desynchronized React Router — handleNewChat now calls storeNewSession() directly

Test plan

  • DesktopShell tests updated and passing (7/7)
  • TypeScript clean (no frontend errors)
  • Manual: verify nav items render in left sidebar on desktop
  • Manual: verify clicking nav items navigates to correct pages
  • Manual: verify active state highlighting
  • Manual: verify New Chat button creates fresh session
  • Manual: verify mobile layout unchanged (TabBar still works)

🤖 Generated with Claude Code

Desktop layout had no way to navigate to non-chat pages (Calendar, Inbox,
Telos, Tasks, Files). Adds DesktopNav component in the left sidebar and
wraps non-chat routes in DesktopShell via PageRoute. Also fixes the New
Chat button which was broken because history.replaceState desynchronized
React Router — handleNewChat now calls storeNewSession() directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dimakis dimakis merged commit 1b2638d into main May 6, 2026
1 check failed
Copy link
Copy Markdown
Owner Author

@dimakis dimakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Centaur Review

Found 4 issue(s) (3 warning).

frontend/src/components/DesktopNav.tsx

Solid feature PR — the New Chat fix is correct (storeNewSession clears store state before navigation), and DesktopShell's optional props cleanly support the new PageRoute pattern. Main gap is missing tests for the new DesktopNav component and the center-only DesktopShell rendering path.

  • 🟡 missing_tests: New component has no unit tests. It contains routing logic (match functions), badge rendering, and navigation — all worth covering. The project follows TDD, so tests should exist alongside the implementation. [fixable]
  • 🔵 style (L16): The items array (with its closures) is re-allocated on every render. For 6 items this is negligible, but wrapping it in useMemo(() => [...], [inboxCount, todoCount]) would make dependencies explicit and avoid the allocation when only location changes. [fixable]

frontend/src/components/__tests__/DesktopShell.test.tsx

Solid feature PR — the New Chat fix is correct (storeNewSession clears store state before navigation), and DesktopShell's optional props cleanly support the new PageRoute pattern. Main gap is missing tests for the new DesktopNav component and the center-only DesktopShell rendering path.

  • 🟡 missing_tests: No test covers the new center-only rendering path (right omitted). The PR made right optional and wrapped it in a conditional ({right && ...}), but every existing test still passes right. A test rendering <DesktopShell center={...} /> without left/right would verify the PageRoute usage path and confirm the right sidebar collapse button is correctly absent. [fixable]

frontend/src/components/DesktopShell.tsx

Solid feature PR — the New Chat fix is correct (storeNewSession clears store state before navigation), and DesktopShell's optional props cleanly support the new PageRoute pattern. Main gap is missing tests for the new DesktopNav component and the center-only DesktopShell rendering path.

  • 🟡 bugs (L63): When left is undefined (the PageRoute case), the left sidebar still renders DesktopNav and the collapse toggle — which is the desired behavior. However, when the sidebar is collapsed and then expanded, the fragment renders <DesktopNav /> followed by {undefined}. This is harmless in React (undefined children are ignored), but worth noting: there's no visual separator or empty-state handling between the nav and a missing session panel. If the left sidebar should be entirely hidden when no left content exists, wrap the whole sidebar in a conditional too.

const navigate = useNavigate();
const { inboxCount, todoCount } = useTabBadges();

const items: NavItem[] = [
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 style: The items array (with its closures) is re-allocated on every render. For 6 items this is negligible, but wrapping it in useMemo(() => [...], [inboxCount, todoCount]) would make dependencies explicit and avoid the allocation when only location changes. [fixable]

{leftCollapsed ? '\u25B6' : '\u25C0'}
</button>
{!leftCollapsed && left}
{!leftCollapsed && (
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 bugs: When left is undefined (the PageRoute case), the left sidebar still renders DesktopNav and the collapse toggle — which is the desired behavior. However, when the sidebar is collapsed and then expanded, the fragment renders <DesktopNav /> followed by {undefined}. This is harmless in React (undefined children are ignored), but worth noting: there's no visual separator or empty-state handling between the nav and a missing session panel. If the left sidebar should be entirely hidden when no left content exists, wrap the whole sidebar in a conditional too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant