mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 04:50:59 +00:00
Add an `<AppSettingsProvider>` that fetches `bugReportEnabled` once via `/api/bugreport/status` and exposes it through `useAppSettings()`. The sidebar consumes the flag and conditionally renders the Bug Report entry — both in the collapsed icon mode and the expanded label mode. The bottom-nav and topbar do not surface bugreport today, so no changes were needed there. The provider mounts inside `Providers` (above the toaster), so any future flag-gated UI can reuse the same hook without re-fetching the status payload. Defaults to `true` while the query is loading or the user is unauthenticated so the entry doesn't flicker out under the cursor on slow connections. Tests: SSR-render `<SidebarNav>` with both flag states and assert the `/bugreport` href appears / disappears accordingly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>