From 8ff3aa2544ef5c1b273eeaa980af3ff5795a5de8 Mon Sep 17 00:00:00 2001 From: Adeyemiadigun Date: Sat, 26 Sep 2026 11:37:39 +0100 Subject: [PATCH] fix(#586): gate advanced features behind advancedMode toggle - hooks/useSettings: expose advancedMode (default false) + same-tab notifySettingsUpdated() so mounted components re-read on toggle - settings page: notify subscribers on save; document what the toggle reveals - StreamCard: show raw stroops/s rate in advanced mode - stream detail: raw stroop amounts inline + Advanced details card with stream/token/factory contract addresses and raw unix timestamps - compare page: raw stroop rate + token contract rows in advanced mode - navbar: Compare link only in advanced mode (route stays directly reachable) --- app/settings/page.tsx | 24 +++++-- app/stream/[id]/page.tsx | 106 ++++++++++++++++++++++++++++++- app/streams/compare/page.tsx | 35 ++++++++++ components/Navbar.tsx | 12 +++- components/stream/StreamCard.tsx | 23 +++++-- hooks/useSettings.ts | 37 +++++++++-- 6 files changed, 221 insertions(+), 16 deletions(-) diff --git a/app/settings/page.tsx b/app/settings/page.tsx index 3e148c2..84e81d3 100644 --- a/app/settings/page.tsx +++ b/app/settings/page.tsx @@ -9,6 +9,7 @@ import { type TimeFormat, type RefreshIntervalSeconds, REFRESH_INTERVAL_OPTIONS, + notifySettingsUpdated, } from "@/hooks/useSettings"; type Currency = "USD" | "EUR" | "XLM"; @@ -90,6 +91,9 @@ export default function SettingsPage() { try { localStorage.setItem(STORAGE_KEY, JSON.stringify(settings)); + // Wake up mounted useSettings() subscribers in this tab — the + // `storage` event only fires in *other* tabs (#586). + notifySettingsUpdated(); } catch { // Storage can be unavailable in private browsing or embedded webviews. } @@ -298,15 +302,27 @@ export default function SettingsPage() { className="w-5 h-5 rounded border-gray-300 dark:border-gray-600 text-black dark:text-white focus:ring-black dark:focus:ring-white" /> -