feat(dashboard): poll optimisation — T4, T5, T6

T4: workstreams.md and dependencies.md now call /state/deps instead of the
    full /state/summary — removes 2 heavy 10-table queries per 60 s cycle.

T5: index.md's 4 independent polling loops (summaryState, sbomSnapState,
    regsState, wsChartState) consolidated into a single pageState generator
    with one Promise.all batch and a shared backoff counter.

T6: config.js gains waitForVisible(ms) — pauses polling entirely while the
    tab is hidden and fires immediately on visibilitychange.  pollDelay()
    simplified (hidden-tab POLL_HIDDEN logic removed).  All 16 polling pages
    migrated from await sleep(pollDelay(...)) to await waitForVisible(pollDelay(...)).

CUST-WP-0039 complete — all 6 tasks done.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-11 17:58:18 +02:00
parent 1603085792
commit 41ce4ede2c
19 changed files with 115 additions and 159 deletions

View File

@@ -3,7 +3,7 @@ id: CUST-WP-0039
type: workplan
title: "Dashboard Poll Optimization"
domain: custodian
status: active
status: done
owner: custodian
topic_slug: custodian
created: "2026-05-11"
@@ -122,7 +122,7 @@ Schema: `WorkstreamDepStub` already exists in `api/schemas/workstream_dependency
```task
id: CUST-WP-0039-T4
status: todo
status: done
priority: medium
depends_on: [CUST-WP-0039-T3]
state_hub_task_id: "b80dce9c-b1ef-4606-9460-5100d6f58bce"
@@ -143,7 +143,7 @@ Changes:
```task
id: CUST-WP-0039-T5
status: todo
status: done
priority: medium
state_hub_task_id: "7c2d5e01-9de5-48ad-aa0b-a37cf5332ad9"
```
@@ -169,7 +169,7 @@ Approach: single `pageState` generator that yields a flat object with all fields
```task
id: CUST-WP-0039-T6
status: todo
status: done
priority: low
state_hub_task_id: "31b6a353-040a-4f87-b2f1-1deab5cf6191"
```