ai-powered-conversational-intelligence

Navigation and action ownership

Companion to docs/ui-production-audit.md (what was found duplicated and why) — this document is the resulting contract: one action, one owner, one location, so a future change never has to guess which of two copies to update, or accidentally leaves one stale.

Ownership table

Action Single owner/location Behavior
New chat Sidebar (Sidebar.tsx) and the header product name (AppShell.tsx) chatStore.startNewChat() then navigate('/') — resets to a fresh, unsaved conversation; persisted to the server only once a question is actually asked. Two entry points deliberately: the sidebar button is the explicit control, and the product name is the “click the logo to go home” convention every web app has, which users try regardless of whether it works. Both run the identical two calls, and AppShell.test.tsx asserts the resulting store state matches, so they cannot drift into meaning different things
Chat-history search Sidebar (ConversationSearch/useChatSearch) Debounced GET /chat/search, scoped server-side to the authenticated user; falls back to client-side title filtering only when no local-auth session exists
Sidebar collapse/expand Header (SidebarToggle, one instance) Toggles settingsStore.sidebarCollapsed — desktop-only (>=lg); below lg the sidebar is always the MobileNav drawer instead, which this control doesn’t affect
Mobile navigation drawer Header (MobileNav, <lg only) Opens the same Sidebar component as an off-canvas drawer; closes itself after New Chat / selecting a conversation (onNavigate)
Settings/customization User profile menu (UserMenu → “Settings”) Opens the single SettingsDialog instance (owned by AppShell.tsx) → unmodified HistorySettingsSection (appearance, connection status, schema browser, AI-insight/voice toggles)
Theme User profile menu (quick ThemeToggle row) and inside Settings’ Appearance section Documented, intentional shortcut — see “Theme: the one deliberate exception” below, not a duplicate
Logout User profile menu (UserMenu → “Sign out”) Calls local-auth logout if a local session exists, else OIDC sign-out if configured; never deletes server-side history (soft state only, see docs/chat-history-ui.md)
Profile / account info User profile menu (UserMenu header row) Display name + email, read from useLocalAuthStore; absent (no header row) when no local account is signed in
SQL context (schema, plan, validation, results) Inline, per conversation turn (TurnCard.tsx’s collapsible sections) Not a persistent right-side panel — see “Why no separate context panel” below
Image editing Image attachment chip / message actions only Opens ImageEditor (lazy-loaded) for that specific attachment; never appears in SettingsDialog or any global menu
Page navigation (Chat / Knowledge Sources / Media Search) Header nav tabs Plain client-side routes (react-router), unrelated to account/settings actions, kept in the header since it’s genuine cross-page navigation, not a duplicated setting
Database Onboarding (Prompt 26) Header nav tab, gated on role (admin/analyst, read from useLocalAuthStore) One of two nav tabs that aren’t always visible — unlike every other entry in this table, it has no useful read-only purpose for an account with neither role, so it’s omitted rather than shown leading nowhere. UX-only gating; the real enforcement is server-side (api/onboarding.py’s own ONBOARDING_MANAGE/ONBOARDING_REVIEW checks)
SME Semantic Review (Prompt 27) Header nav tab, gated on role (admin/analyst, same canSeeReviewTabs boolean Database Onboarding uses — CATALOG_MANAGE/CATALOG_REVIEW sit at the identical two RBAC tiers) The governed semantic-catalog review surface (entities/metrics/dimensions/domains) — reuses the identical gating pattern, and links into Database Onboarding for PII/relationship/semantic-label/golden-question review rather than re-implementing that table a second time. UX-only gating; real enforcement is server-side (api/semantic_catalog.py’s own CatalogAction checks)
Platform Admin (Prompt 28) Header nav tab, gated on a different dimension than the two rows above — the platform_admin role specifically (canSeePlatformAdmin, a separate boolean from canSeeReviewTabs), never satisfied by holding the tenant-scoped admin role alone The cross-tenant operations dashboard (tenants, users/roles, databases, semantic-review-queue counts, jobs, usage/latency, security events, audit logs, config status) — see identity.rbac.Permission.PLATFORM_ADMIN’s own docstring for why this is deliberately not folded into the admin/analyst gate above. UX-only gating; real enforcement is server-side (api/platform_admin.py’s own require_platform_admin dependency on every route)
Analytics & insights (Prompt 30) Inside each answered turn (TurnCard.tsx → AnalyticsSummary), not a nav tab — shown after “Confirm and Run”, gated like the insight Read-only analysis of the already-computed result (KPIs, trend, ranking/distribution, anomalies, forecast, approved definitions, evidence, query scope). Related questions and drill-down submit through the normal chat flow. No role gating beyond the existing ask permission; the restricted-field notice is a presentation of an existing server-side failure
Tenant Admin (Prompt 29) Header nav tab, gated on yet another dimension — admin/auditor/manager (canSeeTenantAdmin, mirroring identity.rbac.Permission.ADMIN_DASHBOARD_READ’s own real grant set, distinct from both rows above) The tenant-scoped counterpart to Platform Admin — introduces no new permission at all; every query resolves the caller’s own tenant server-side and never accepts one from the client. UX-only gating; real enforcement is server-side (api/tenant_admin.py, reusing the existing admin-tier identity.rbac permissions)
Recommendations (Prompt 31) Header nav tab, gated on the same admin/analyst check as the review tabs (canSeeReviewTabs) — RECOMMENDATION_REVIEW is granted to exactly those two roles The recommendation & action dashboard: a filterable list (database, category, status, owner) and a detail view with the claim, its evidence (each claim shows its own truth level), confidence, rule/model, affected entity, measurable impact (or “not measured”), verdicts (accept, partially useful, reject, mark incorrect), resolve, owner assignment, notes, and the full audit trail. Every item is labelled as an AI estimate. Expire is admin-only. UX-only gating; real enforcement is server-side (api/recommendation_governance.py, every route through authorize_recommendation_action)
Role-based navigation (Prompt 32) Header tabs and every screen route are drawn from GET /navigation, a server decision (security/navigation.py), never from a role name in the browser Each screen route is wrapped in RequireNavItem: a URL typed for a screen the caller may not use shows the forbidden page and is audit-logged. Review and admin pages read their actions from the server’s capabilities. The /recommendations JSON path is never a page path: the screen lives at /recommended-actions

Theme: the one deliberate exception, and why

ThemeToggle (the same component, reading/writing the same settingsStore.themeMode) appears in two places:

  1. UserMenu’s quick row — a fast, no-navigation way to try light/ dark/system while doing something else, rendered as plain content (not a DropdownMenuItem) specifically so clicking a theme option doesn’t close the menu — a user can compare more than one theme in a single open.
  2. SettingsDialog → Appearance section — the full customization surface, alongside accent color, font, and language, which don’t have their own header shortcuts.

This is the same component and the same store, not two competing implementations — changing the theme from either place is instantly reflected in the other. It is kept because theme is the one setting common enough to want a zero-navigation shortcut for, matching this document’s own governing rule (“place the same action in two locations only when the second is clearly a shortcut and documented here”). Everything else that used to be reachable from two places (Settings itself, Logout) was consolidated to exactly one.

Why no separate right-side context panel

The originating request’s suggested architecture includes an optional right-side “context panel” for schema/SQL/retrieval details. This repository’s existing chat rendering already presents that information — generated SQL, executed SQL, validation/cost notices, retrieved schema, query plan, sources used — as collapsible sections inline within each conversation turn (TurnCard.tsx composing SchemaContextPanel, QueryPlanPanel, SourcesUsedPanel, SqlEditor, ResultsTable), not expanded by default. Introducing a second, persistent panel showing the same data would either duplicate it in two places at once or require restructuring already-working, previously-reviewed chat components for no reported problem — none of the duplication/clutter complaints that motivated this pass were about SQL/context presentation. Kept as-is, documented here as a deliberate adaptation rather than a silently-skipped requirement.

Single source of truth for sidebar state

Verification

Real headless-Chromium screenshots (Playwright, launched against the actual Vite dev server, auth mocked via request interception since no test credentials were available in this environment) were taken and visually reviewed at:

Zero browser console errors were captured in any of the above. See docs/ui-production-audit.md §6 for the summary and docs/ui-design-system.md for the token/visual system these screens draw from.