Skip to content

Make navigation bar application aware#47

Merged
CharlesFarris merged 7 commits into
mainfrom
make-page-auth-aware
May 23, 2026
Merged

Make navigation bar application aware#47
CharlesFarris merged 7 commits into
mainfrom
make-page-auth-aware

Conversation

@CharlesFarris

Copy link
Copy Markdown
Contributor
  • Expand navigation bar functionality
  • Add navigation bar item
  • Add tests

Copilot AI review requested due to automatic review settings May 23, 2026 19:37
@CharlesFarris CharlesFarris self-assigned this May 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR makes the shared navigation bar aware of authentication state and the current route so it can render different link sets and hide the link for the current page.

Changes:

  • Refactor Page to require auth state + currentPath and render a new NavigationBar component with typed props.
  • Introduce NavigationBarItem to hide the current-route link and support generic <li> content (e.g., logout form).
  • Add/expand tests across shared components and feature pages to validate the new navigation behavior.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/shared/page.tsx Makes Page accept auth/current-path props and renders NavigationBar.
src/shared/page.test.tsx Updates Page tests for new props and asserts route-hiding behavior.
src/shared/navigationBarItem.tsx Adds a reusable nav item component (link/generic).
src/shared/navigationBarItem.test.tsx Adds unit tests for NavigationBarItem.
src/shared/navigationBar.tsx Refactors nav into auth-aware component; adds “Add” link for authenticated users.
src/shared/navigationBar.test.tsx Adds tests for authenticated/unauthenticated nav variants and current-route hiding.
src/features/login/loginPage.tsx Updates login page to pass unauthenticated state + current path into Page.
src/features/login/loginPage.test.tsx Routes test via pageRoutes and asserts nav hides current login link.
src/features/home/homePage.tsx Updates home page to pass authenticated state + current path into Page.
src/features/home/homePage.test.tsx Updates expectations for authenticated nav (e.g., hides Home link, shows logout).
src/features/add-todo/addToDoPage.tsx Updates add-todo page to pass authenticated state + current path into Page.
src/features/add-todo/addToDoPage.test.tsx Routes test via pageRoutes and asserts authenticated nav elements.
src/features/about/aboutPage.tsx Updates about page to pass unauthenticated state + current path into Page.
src/features/about/aboutPage.test.tsx Routes test via pageRoutes and asserts unauthenticated nav hides About link.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/shared/page.tsx Outdated
Comment thread src/features/home/homePage.tsx Outdated
Comment thread src/features/add-todo/addToDoPage.tsx Outdated
Comment thread src/shared/navigationBarItem.tsx Outdated
Comment thread src/shared/navigationBar.tsx
Comment thread src/features/about/aboutPage.tsx
Comment thread src/features/login/loginPage.tsx
Copilot AI review requested due to automatic review settings May 23, 2026 20:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Comment thread src/shared/navigationBarItem.tsx Outdated
Comment thread src/shared/navigationBarItem.test.tsx Outdated
Comment thread src/features/home/homePage.tsx
Comment thread src/features/home/homePage.test.tsx
Copilot AI review requested due to automatic review settings May 23, 2026 20:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Comment thread src/features/home/homePage.tsx
Comment thread src/features/add-todo/addToDoPage.tsx Outdated
Comment thread src/features/home/homePage.test.tsx

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Comment thread src/shared/utility.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 23, 2026 22:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

@CharlesFarris CharlesFarris merged commit 765fcd2 into main May 23, 2026
4 checks passed
@CharlesFarris CharlesFarris deleted the make-page-auth-aware branch May 23, 2026 22:15
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.

2 participants