Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: scope Today's Agenda remaining count to shown events (#9937)
[._.]/4dde32e6c56d
diff --git a/client/src/components/dashboard/builtins/TodayAgendaWidget.jsx b/client/src/components/dashboard/builtins/TodayAgendaWidget.jsxindex daac3e2d01..3c7bf880cb 100644--- a/client/src/components/dashboard/builtins/TodayAgendaWidget.jsx+++ b/client/src/components/dashboard/builtins/TodayAgendaWidget.jsx@@ -1,7 +1,7 @@import { Link } from 'react-router';import { CalendarDays, ArrowRight } from 'lucide-react';import { useTimeTick } from '../../../hooks/useTimeTick';-import { formatTimeOfDay } from '../../../utils/formatters';+import { formatCount, formatTimeOfDay } from '../../../utils/formatters';// Glanceable "what's left today" agenda. Reads the shared `calendarAgenda`// slice of dashboardState (populated from GET /api/calendar/agenda — the@@ -24,6 +24,7 @@ export default function TodayAgendaWidget({ dashboardState }) {const nextEvent = rows.find((r) => !r.event.isAllDay && !r.past)?.event;const remaining = rows.filter((r) => !r.past).length;const total = agenda.total ?? events.length;+ const truncated = total > events.length;return (<Link@@ -38,12 +39,19 @@ export default function TodayAgendaWidget({ dashboardState }) {</span></div>- {events.length === 0 ? (+ {events.length === 0 && !truncated ? (<div className="text-xs text-gray-500">Nothing on the calendar today 🎉</div>) : (<>- <div className="text-xs text-gray-500 mb-2">- {remaining} of {total} event{total !== 1 ? 's' : ''} remaining+ <div className="text-xs text-gray-500 mb-2 min-w-0 break-words">+ {truncated ? (+ <>+ {formatCount(remaining)} of {formatCount(events.length)} shown event{events.length !== 1 ? 's' : ''} remaining+ <span className="block">{formatCount(total)} event{total !== 1 ? 's' : ''} today</span>+ </>+ ) : (+ <>{formatCount(remaining)} of {formatCount(total)} event{total !== 1 ? 's' : ''} remaining</>+ )}</div><ul className="space-y-1">{rows.map(({ event, past }) => (@@ -65,8 +73,8 @@ export default function TodayAgendaWidget({ dashboardState }) {</li>))}</ul>- {total > events.length && (- <div className="text-xs text-gray-500 mt-2">+{total - events.length} more</div>+ {truncated && (+ <div className="text-xs text-gray-500 mt-2">+{formatCount(total - events.length)} more</div>)}</>)}diff --git a/client/src/components/dashboard/builtins/TodayAgendaWidget.test.jsx b/client/src/components/dashboard/builtins/TodayAgendaWidget.test.jsxindex 4ec30dcd82..8732946c42 100644--- a/client/src/components/dashboard/builtins/TodayAgendaWidget.test.jsx+++ b/client/src/components/dashboard/builtins/TodayAgendaWidget.test.jsx@@ -52,5 +52,54 @@ describe('TodayAgendaWidget', () => {],});expect(screen.getByText('+9 more')).toBeTruthy();+ expect(screen.getByText('1 of 1 shown event remaining')).toBeTruthy();+ expect(screen.getByText('10 events today')).toBeTruthy();+ });++ it('scopes a zero remaining count to the displayed page when every shown event has ended', () => {+ renderWidget({+ date: '2026-09-01',+ accountCount: 1,+ total: 10,+ events: Array.from({ length: 8 }, (_, i) => ({+ id: String(i), accountId: 'acc', title: `Finished ${i}`,+ startTime: iso(-7200000), endTime: iso(-3600000), isAllDay: false, location: null,+ })),+ });++ expect(screen.getByText('0 of 8 shown events remaining')).toBeTruthy();+ expect(screen.getByText('10 events today')).toBeTruthy();+ expect(screen.getByText('+2 more')).toBeTruthy();+ expect(screen.getByRole('link').getAttribute('href')).toBe('/calendar/agenda');+ });++ it('shows the remaining count only for displayed events in a partial response', () => {+ renderWidget({+ date: '2026-09-01',+ accountCount: 1,+ total: 4,+ events: [+ { id: 'a', accountId: 'acc', title: 'Finished', startTime: iso(-7200000), endTime: iso(-3600000), isAllDay: false, location: null },+ { id: 'b', accountId: 'acc', title: 'Upcoming', startTime: iso(3600000), endTime: iso(7200000), isAllDay: false, location: null },+ ],+ });++ expect(screen.getByText('1 of 2 shown events remaining')).toBeTruthy();+ expect(screen.getByText('4 events today')).toBeTruthy();+ expect(screen.getByText('+2 more')).toBeTruthy();+ });++ it('formats large counts in both the day total and omitted-event cue', () => {+ renderWidget({+ date: '2026-09-01',+ accountCount: 1,+ total: 12345,+ events: [+ { id: 'a', accountId: 'acc', title: 'Upcoming', startTime: iso(3600000), endTime: iso(7200000), isAllDay: false, location: null },+ ],+ });++ expect(screen.getByText('12,345 events today')).toBeTruthy();+ expect(screen.getByText('+12,344 more')).toBeTruthy();});});