feat(ui): add global query refresh indicator to board header
Replace per-widget loading spinners with a shared header indicator that shows live TanStack Query cache status for all widget-related queries. Includes orange/green dot, completion beep, and hover card with per-query staleness and error details.
This commit is contained in:
3 files changed
+228
-6
No files matched your search
@@ -39,7 +39,7 @@ const FetchCalendar = ({ month, setMonth, isEditMode, integrationIds, options }:
|
||||
releaseType: options.releaseType,
|
||||
showUnmonitored: options.showUnmonitored,
|
||||
};
|
||||
const [data] = clientApi.widget.calendar.findAllEvents.useSuspenseQuery(input, {
|
||||
const { data } = clientApi.widget.calendar.findAllEvents.useQuery(input, {
|
||||
refetchOnMount: false,
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnReconnect: false,
|
||||
@@ -61,7 +61,7 @@ const FetchCalendar = ({ month, setMonth, isEditMode, integrationIds, options }:
|
||||
},
|
||||
});
|
||||
|
||||
const events = useMemo(() => data.flatMap((item) => item.events), [data]);
|
||||
const events = useMemo(() => data?.flatMap((item) => item.events) ?? [], [data]);
|
||||
|
||||
return <CalendarBase isEditMode={isEditMode} events={events} month={month} setMonth={setMonth} options={options} />;
|
||||
};
|
||||
@@ -156,9 +156,6 @@ const CalendarBase = ({ isEditMode, events, month, setMonth, options }: Calendar
|
||||
|
||||
return (
|
||||
<CalendarDay
|
||||
// new Date() does not work here, because for timezones like UTC-7 it will
|
||||
// show one day earlier (probably due to the time being set to 00:00)
|
||||
// see https://github.com/homarr-labs/homarr/pull/3120
|
||||
date={dayjs(tileDate).toDate()}
|
||||
events={eventsForDate}
|
||||
disabled={isEditMode || eventsForDate.length === 0}
|
||||
|
||||
Reference in new issue
Block a user