From f298130cb07fb9098d7a1eefba9e3273e1909b4f Mon Sep 17 00:00:00 2001 From: Stefan Ernst <24554551+stefan-ernst@users.noreply.github.com> Date: Mon, 2 Nov 2026 21:28:31 +0100 Subject: [PATCH] refactor(frontend): route refresh-work-items through one reconciliation (WI-1924) Seven surfaces listened to the global refresh-work-items broadcast independently, so one mutation started several unrelated reads: the homepage snapshot, the item SLA panel, every SLA badge, child items and the collection delta. The SLA panel also bypassed slaState and issued its own per-item read, duplicating the workspace batch the badges already use. Add a workItemRefresh coordinator that owns the single listener, merges a burst into one notification, and notifies each subscriber once. Migrate the homepage lifecycle, homepage, item detail, collection views, SLA panel and SLA badge to subscribe to it. The panel now reads through slaState so it shares the workspace batch with badges, and both skip a burst that names another workspace. Cache invalidation stays a synchronous window listener in slaState so the cache is cleared before the debounced subscribers reload. --- .../collections/CollectionBacklog.svelte | 10 +- .../collections/CollectionBoard.svelte | 9 +- .../collections/CollectionList.svelte | 24 ++-- .../src/lib/features/items/ItemDetail.svelte | 29 +++-- .../features/items/ItemDetailSidebar.svelte | 2 +- .../lib/features/items/ItemSLAPanel.svelte | 19 ++- frontend/src/lib/features/sla/SLABadge.svelte | 9 +- frontend/src/lib/pages/Homepage.svelte | 3 +- frontend/src/lib/pages/useMainAppLifecycle.js | 9 +- frontend/src/lib/stores/workItemRefresh.js | 121 ++++++++++++++++++ 10 files changed, 191 insertions(+), 44 deletions(-) create mode 100644 frontend/src/lib/stores/workItemRefresh.js diff --git a/frontend/src/lib/features/collections/CollectionBacklog.svelte b/frontend/src/lib/features/collections/CollectionBacklog.svelte index 8481fd428..fe5e18ba2 100644 --- a/frontend/src/lib/features/collections/CollectionBacklog.svelte +++ b/frontend/src/lib/features/collections/CollectionBacklog.svelte @@ -1,6 +1,5 @@