Skip to content

Update SO navBar to render selected shelter org (SDB-280) - #2467

Open
tglaz wants to merge 1 commit into
mainfrom
SDB-280/so-nav-and-sidebar-updates
Open

tglaz wants to merge 1 commit into
mainfrom
SDB-280/so-nav-and-sidebar-updates

Conversation

@tglaz

@tglaz tglaz commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Update SO navBar to render selected shelter org

SDB-280

  • update shelter-operator navbar to render org name corresponding to currently selected shelter
  • render current user name, email and org in dropdown
  • update shelter table links to
    • default open to Shelter Profile Basic Info
    • update default open state for Shelter Profile and Management sub-menus
image

Summary by Sourcery

Update the shelter-operator navigation and shelter selection flow to reflect the active shelter organization and user context.

New Features:

  • Display the selected shelter’s organization in the shelter-operator navigation bar.
  • Show the current user’s name, email, and active organization in the account menu.
  • Support non-interactive header and footer content in dropdown menus.

Bug Fixes:

  • Open newly selected shelters on the Shelter Profile Basic Info page.

Enhancements:

  • Make Shelter Profile and Shelter Management navigation groups expand based on the current route.
  • Improve dropdown keyboard accessibility and styling customization.
  • Expose active-organization types and hooks through the platform provider index.

Tests:

  • Add a dropdown story demonstrating account-style header and footer content.

@sourcery-ai

sourcery-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Updates the shelter-operator navigation to show the selected shelter’s organization and richer account context, extends the shared dropdown to support that presentation, and adjusts shelter menu expansion and dashboard navigation defaults.

Sequence diagram for shelter organization navigation

sequenceDiagram
    participant Operator
    participant NavBar
    participant useActiveOrg
    participant useUser
    participant ShelterData

    Operator->>NavBar: Open shelter route
    NavBar->>ShelterData: Read selected shelter
    ShelterData-->>NavBar: operatorShelter.organization.name
    NavBar->>useActiveOrg: Read activeOrg
    useActiveOrg-->>NavBar: activeOrg
    NavBar->>useUser: Read user
    useUser-->>NavBar: user name and email
    NavBar-->>Operator: Render shelter organization in navbar
    Operator->>NavBar: Open account dropdown
    NavBar-->>Operator: Render user name, email, and active organization
Loading

State diagram for shelter sidebar expansion

stateDiagram-v2
    [*] --> ShelterRoute
    ShelterRoute --> ProfileExpanded: isShelterProfileRoute(pathname)
    ShelterRoute --> ManagementExpanded: isShelterMgmtRoute(pathname)
    ShelterRoute --> ProfileCollapsed: route does not match profile
    ShelterRoute --> ManagementCollapsed: route does not match management
Loading

Flow diagram for shelter dashboard navigation default

flowchart TD
    A["Select shelter and click Continue"] --> B[shelterProfileRoute]
    B --> C["Shelter Profile / Basic Info"]
    C --> D["Shelter Profile submenu expanded"]
Loading

File-Level Changes

Change Details Files
Render shelter-specific organization context in the operator navigation and account menu.
  • Derive the organization name from the selected shelter on shelter routes, while retaining the dashboard organization fallback.
  • Add the current user’s name, email, and active organization to the account dropdown.
  • Expose active-organization types and hooks needed by the navigation implementation.
libs/react/shelter-operator/src/lib/components/NavBar.tsx
libs/ba-platform/src/lib/react/providers/activeOrg/index.ts
Extend the shared dropdown to support account-context content and improved styling and keyboard interaction.
  • Add optional header and footer regions with customizable classes and sheet styling.
  • Use merged CSS classes and change the popup container to support non-option content.
  • Add keyboard toggling and Escape handling while preserving option selection behavior.
  • Add a story demonstrating header and footer content.
libs/react/components/src/lib/Dropdown/Dropdown.tsx
libs/react/components/src/lib/Dropdown/Dropdown.stories.tsx
Align shelter navigation expansion and dashboard continuation with the intended profile entry point.
  • Expand Shelter Profile and Shelter Management menus based on the current route instead of always expanding them.
  • Navigate the dashboard continuation action to Shelter Profile Basic Info.
libs/react/shelter-operator/src/lib/components/AppSidebar/ShelterProfileLinks.tsx
libs/react/shelter-operator/src/lib/components/AppSidebar/ShelterMgmtLinks.tsx
libs/react/shelter-operator/src/lib/pages/dashboard/Dashboard.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot 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.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="libs/react/shelter-operator/src/lib/components/NavBar.tsx" line_range="72-75" />
<code_context>
   const { canCreateShelter } = useShelterPermissions();
   const showCreateButton = isDashboardPage && canCreateShelter;

-  const orgName =
+  // assumes user belongs to 1 organization only
+  const currentUserOrgName =
</code_context>
<issue_to_address>
**issue (bug_risk):** On every non-shelter page for a user belonging to multiple organizations, the navbar displays the literal `Admin Dashboard` instead of the currently selected organization name, even though `activeOrg` is available and can change through the organization selector.

**Triggers:** When the current user belongs to more than one organization and selects an organization outside a shelter view.

**Suggested fix:** Use `activeOrg?.name` for the non-shelter navbar label, with `Admin Dashboard` only as an explicit fallback when no organization is active.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment on lines -72 to 75
const orgName =
// assumes user belongs to 1 organization only
const currentUserOrgName =
organizations.length === 1 ? organizations[0].name : 'Admin Dashboard';

// ── Shelter name ─────────────────────────────────────────────────────────

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.

issue (bug_risk): On every non-shelter page for a user belonging to multiple organizations, the navbar displays the literal Admin Dashboard instead of the currently selected organization name, even though activeOrg is available and can change through the organization selector.

Triggers: When the current user belongs to more than one organization and selects an organization outside a shelter view.

Suggested fix: Use activeOrg?.name for the non-shelter navbar label, with Admin Dashboard only as an explicit fallback when no organization is active.

@github-actions

Copy link
Copy Markdown

🚀 Expo continuous deployment is ready for betterangels!

  • Project → betterangels
  • Environment → Preview
  • Platforms → android, ios
  • Scheme → betterangels
  🤖 Android 🍎 iOS
Runtime Version 4d84f3f87051ebb9c1713e7e2d4522e4b23135d9 4d84f3f87051ebb9c1713e7e2d4522e4b23135d9
Build Details Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview
Runtime version: 4d84f3f87051ebb9c1713e7e2d4522e4b23135d9
App version: 1.2.11
Git commit: a1900145e6c2315da5a85930acd4fcf2f8619aa2
Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview
Runtime version: 4d84f3f87051ebb9c1713e7e2d4522e4b23135d9
App version: 1.2.11
Git commit: a1900145e6c2315da5a85930acd4fcf2f8619aa2
Update Details Update Permalink
DetailsBranch: SDB-280-so-nav-and-sidebar-updates
Runtime version: 4d84f3f87051ebb9c1713e7e2d4522e4b23135d9
Git commit: 8de9421f671d2d8ee60e5d21f7abc493116cbb8f
Update Permalink
DetailsBranch: SDB-280-so-nav-and-sidebar-updates
Runtime version: 4d84f3f87051ebb9c1713e7e2d4522e4b23135d9
Git commit: 8de9421f671d2d8ee60e5d21f7abc493116cbb8f
Update QR

iOS Simulator Build: Simulator Build Link

@github-actions

Copy link
Copy Markdown

🔍 [betterangels-admin] Preview available at: https://admin.dev.betterangels.la/branches/SDB-280-so-nav-and-sidebar-updates

Last updated: 2026-09-16T00:03:09.505Z

@github-actions

Copy link
Copy Markdown

🔍 [shelter-web] Preview available at: https://shelter.dev.betterangels.la/branches/SDB-280-so-nav-and-sidebar-updates

Last updated: 2026-09-16T00:03:09.499Z

@github-actions

Copy link
Copy Markdown

🔍 [storybook-react] Preview available at: https://storybook.dev.betterangels.la/branches/SDB-280-so-nav-and-sidebar-updates

Last updated: 2026-09-16T00:03:09.486Z

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