From 0b1c6a83226330eec361f0ce43b20f4316582d2b Mon Sep 17 00:00:00 2001 From: null Date: Fri, 3 Jul 2026 12:50:07 -0500 Subject: [PATCH] feat(nav): surface Data in the primary app menu (IMP-IA-01) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Import/export/backups (/data) was only reachable from the account overflow dropdown + command palette — buried for how central it is. Move it into the main Tracker nav menu alongside Bills/Categories/Spending/… so it appears in both the desktop dropdown and the mobile nav. Preserves the existing gate: Data stays hidden for the default-admin account (new `accountToolsOnly` flag on the nav item, filtered by the same `!user.is_default_admin` check the account dropdown used). Removed the now -redundant account-dropdown entry; command palette entry unchanged. Co-Authored-By: Claude Opus 4.8 --- client/components/layout/Sidebar.jsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/client/components/layout/Sidebar.jsx b/client/components/layout/Sidebar.jsx index 476f8b4..a271073 100644 --- a/client/components/layout/Sidebar.jsx +++ b/client/components/layout/Sidebar.jsx @@ -46,6 +46,7 @@ const trackerItems = [ { to: '/bank-transactions', icon: Landmark, label: 'Banking', simplefinOnly: true }, { to: '/snowball', icon: TrendingDown, label: 'Snowball' }, { to: '/payoff', icon: Calculator, label: 'Payoff' }, + { to: '/data', icon: Database, label: 'Data', accountToolsOnly: true }, ]; function TrackerMenu({ onNavigate, badge, badgeNames = [], items = trackerItems }) { @@ -164,10 +165,6 @@ function UserMenu({ adminMode = false }) { Settings - navigate('/data')}> - - Data - )} @@ -199,9 +196,13 @@ export default function Sidebar({ adminMode = false }) { const { data: overdueData } = useOverdueCount(); const overdueCount = (!adminMode && overdueData?.count) ? overdueData.count : 0; const overdueNames = (!adminMode && overdueData?.names) ? overdueData.names : []; + const accountToolsAllowed = !user?.is_default_admin; const trackerMenuItems = useMemo( - () => trackerItems.filter(item => !item.simplefinOnly || simplefinReady), - [simplefinReady], + () => trackerItems.filter(item => ( + (!item.simplefinOnly || simplefinReady) + && (!item.accountToolsOnly || accountToolsAllowed) + )), + [simplefinReady, accountToolsAllowed], ); useEffect(() => {