From b678fd898f2dc7502f5cc8ef3f8b11ff99c8ab52 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Thu, 2 Oct 2025 14:10:42 +0000 Subject: [PATCH] Update connection badge UI and add last update timestamp - Make connection badge compact with hover animation - Show small icon (green/gray dot) that expands to show text on hover - Add smooth 500ms transition animation - Add last update timestamp to footer with static time display - Format timestamp as 12-hour time (e.g., "2:34:05 PM") --- frontend-modern/src/App.tsx | 49 +++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/frontend-modern/src/App.tsx b/frontend-modern/src/App.tsx index 2932ee6c3..ce7adff94 100644 --- a/frontend-modern/src/App.tsx +++ b/frontend-modern/src/App.tsx @@ -84,12 +84,27 @@ function App() { const [dataUpdated, setDataUpdated] = createSignal(false); let updateTimeout: number; + // Last update time formatting + const [lastUpdateText, setLastUpdateText] = createSignal(''); + + const formatLastUpdate = (timestamp: string) => { + if (!timestamp) return ''; + const date = new Date(timestamp); + return date.toLocaleTimeString('en-US', { + hour: 'numeric', + minute: '2-digit', + second: '2-digit', + hour12: true + }); + }; + // Flash indicator when data updates createEffect(() => { // Watch for state changes const updateTime = state().lastUpdate; if (updateTime && updateTime !== '') { setDataUpdated(true); + setLastUpdateText(formatLastUpdate(updateTime)); window.clearTimeout(updateTimeout); updateTimeout = window.setTimeout(() => setDataUpdated(false), POLLING_INTERVALS.DATA_FLASH); } @@ -478,6 +493,7 @@ function App() { connected={connected} reconnecting={reconnecting} dataUpdated={dataUpdated} + lastUpdateText={lastUpdateText} versionInfo={versionInfo} darkMode={darkMode} toggleDarkMode={toggleDarkMode} @@ -519,6 +535,7 @@ function AppLayout(props: { connected: () => boolean; reconnecting: () => boolean; dataUpdated: () => boolean; + lastUpdateText: () => string; versionInfo: () => VersionInfo | null; darkMode: () => boolean; toggleDarkMode: () => void; @@ -623,16 +640,16 @@ function AppLayout(props: {
- + - {props.connected() - ? 'Connected' - : props.reconnecting() - ? 'Reconnecting...' - : 'Disconnected'} + + + + + + + + {props.connected() + ? 'Connected' + : props.reconnecting() + ? 'Reconnecting...' + : 'Disconnected'} +
@@ -843,6 +868,10 @@ function AppLayout(props: { {props.versionInfo()?.isDevelopment && ' (Development)'} {props.versionInfo()?.isDocker && ' - Docker'} + + | + Last updated: {props.lastUpdateText()} + );