1.7 KiB
1.7 KiB
Top Bar Integration
Purpose
TopBar renders app-shell search, campus/role badges, notifications, and the profile menu (which delegates sign-out to the auth session) through the three-layer frontend architecture.
View -> Business Logic -> API/Data Access -> Backend
TopBar does not own product content records. It owns shell UI state and delegates auth actions to the auth session.
Frontend Layers
View:
frontend/src/components/frameworks/TopBar.tsxfrontend/src/components/top-bar/TopBarView.tsxfrontend/src/components/top-bar/TopBarSearch.tsxfrontend/src/components/top-bar/TopBarBadges.tsxfrontend/src/components/top-bar/TopBarNotifications.tsxfrontend/src/components/top-bar/TopBarProfileMenu.tsx
Business logic:
frontend/src/business/top-bar/hooks.tsfrontend/src/business/top-bar/selectors.tsfrontend/src/business/top-bar/types.ts
Shared config:
frontend/src/shared/constants/topBar.ts
Behavior
TopBar.tsxis a thin wrapper that reads auth session state and passes it intouseTopBarPage.useTopBarPageowns profile menu state, notifications menu state, search query state, and sign-out error state.- Selectors handle initials, campus label fallback, shared role labels, and unread notification count.
- View components receive a prepared page model and do not call API/data access modules.
- Profile and settings menu items are explicitly disabled until product workflows exist, instead of rendering silent no-op buttons.
Data Ownership Rules
- Do not add notification seed data to frontend constants.
- Keep TopBar constants limited to role badge classes and static menu labels.
- Future persisted notifications should use a backend API and a dedicated business hook.