From a1e6edc74d886e899ad9fc3016e87307bd1f2c41 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Sun, 9 Aug 2026 16:03:57 -0400 Subject: [PATCH] Add a source list to the sidebar and lead with the Records tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sidebar now lists every source under the Sources item when it is expanded, so entering a source takes one click instead of two. Bank feeds sort first, then CSV sources, alphabetical within each group, and a small icon marks which is which — the same config.simplefin test the Import page uses. Selecting a source lands on Records rather than Setup: the index route under /sources/:name redirects there and Setup moved to an explicit /setup path at the end of the tab strip. Setup is the rare job; Records is the frequent one. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_0154qBiPua1PXeet69XmmvQb --- ui/src/App.jsx | 4 +- ui/src/components/Sidebar.jsx | 93 ++++++++++++++++++++++++-------- ui/src/components/SourceTabs.jsx | 6 ++- 3 files changed, 79 insertions(+), 24 deletions(-) diff --git a/ui/src/App.jsx b/ui/src/App.jsx index c513404..809f3ad 100644 --- a/ui/src/App.jsx +++ b/ui/src/App.jsx @@ -141,6 +141,7 @@ export default function App() { setExpanded={setSidebarExpanded} loginUser={loginUser} onLogout={handleLogout} + sources={sources} /> @@ -201,7 +202,8 @@ export default function App() { } /> }> - } /> + } /> + } /> } /> } /> } /> diff --git a/ui/src/components/Sidebar.jsx b/ui/src/components/Sidebar.jsx index 6741839..a67d7ce 100644 --- a/ui/src/components/Sidebar.jsx +++ b/ui/src/components/Sidebar.jsx @@ -1,10 +1,37 @@ +import { Fragment, useMemo } from 'react' import { NavLink } from 'react-router-dom' import useTheme from '../theme.jsx' import { NAV } from './navItems.jsx' -export default function Sidebar({ expanded, setExpanded, loginUser, onLogout }) { +// Same distinction the Import page makes: a source is either on a bank feed or +// it gets CSVs uploaded to it. +const feedIcon = ( + + + + + +) + +const csvIcon = ( + + + + +) + +export default function Sidebar({ expanded, setExpanded, loginUser, onLogout, sources = [] }) { const { dark, setDark } = useTheme() + // Bank feeds first, then CSV sources, alphabetical within each group + const navSources = useMemo(() => ( + sources + .map(s => ({ ...s, isFeed: !!s.config?.simplefin?.account_id })) + .sort((a, b) => + (b.isFeed - a.isFeed) || a.name.localeCompare(b.name, undefined, { sensitivity: 'base' }) + ) + ), [sources]) + return (
{/* Nav */} -