generated from coulomb/repo-seed
Optimize dashboard overview loading
This commit is contained in:
@@ -10,7 +10,10 @@ All dashboard pages poll the State Hub API automatically. No manual refresh is e
|
||||
|
||||
## Poll interval
|
||||
|
||||
Every page fetches fresh data from `http://127.0.0.1:8000` every **15 seconds** using an async generator loop. The previous data stays visible while the next request is in flight, so the UI never goes blank.
|
||||
Most live pages fetch fresh data from `http://127.0.0.1:8000` every **15 seconds**
|
||||
using an async generator loop. The overview page uses a heavier bounded read
|
||||
model and refreshes every **60 seconds**. The previous data stays visible while
|
||||
the next request is in flight, so the UI never goes blank.
|
||||
|
||||
---
|
||||
|
||||
@@ -21,6 +24,7 @@ The **●** dot in the top-right corner of each page shows the current connectio
|
||||
| Indicator | Meaning |
|
||||
|---|---|
|
||||
| **● Live · updated HH:MM:SS** | Last poll succeeded — data is current as of that time |
|
||||
| **● Stale · last successful update HH:MM:SS** | Last refresh failed, but cached page data is still visible |
|
||||
| **● Offline — run: `make api`** | API is unreachable — the dot turns red |
|
||||
|
||||
The timestamp updates on every successful poll. If you see a time that is more than ~30 seconds in the past, the poll is stalled (browser tab backgrounded or network issue) — reloading the page resets the loop.
|
||||
@@ -48,7 +52,7 @@ make api # db + migrate + uvicorn (restarts if already running)
|
||||
|
||||
| Page | Endpoints |
|
||||
|---|---|
|
||||
| Overview | `/state/summary` |
|
||||
| Overview | `/state/overview`, `/decisions/?decision_type=pending` |
|
||||
| Workplans | `/workplans/`, `/topics/`, `/state/summary` |
|
||||
| Decisions | `/decisions/?limit=500`, `/topics/` |
|
||||
| Progress | `/progress/?limit=500` |
|
||||
@@ -57,4 +61,4 @@ All endpoints are read-only GET requests. The dashboard never writes to the API.
|
||||
|
||||
---
|
||||
|
||||
*Poll interval: 15 s. Data is refreshed in the background — the page never reloads itself.*
|
||||
*Poll interval: 15 s for most pages, 60 s for Overview. Data is refreshed in the background — the page never reloads itself.*
|
||||
|
||||
@@ -82,9 +82,13 @@ and summary.
|
||||
|
||||
## Data source
|
||||
|
||||
Polls `GET /state/summary` every **15 seconds**. The workstream chart also polls
|
||||
`GET /workplans/`, `GET /tasks/?limit=2000`, `GET /topics/`, `GET /repos/`,
|
||||
and `GET /workplans/index` for repository grouping, task counts, and
|
||||
workplan filename tooltips. Blocking decisions are fetched separately via
|
||||
`GET /decisions/?decision_type=pending` and only re-fetched after a successful
|
||||
resolve action — this prevents the inline form from being wiped on every poll.
|
||||
Polls `GET /state/overview` every **60 seconds**. This endpoint is a bounded
|
||||
dashboard read model: it returns summary totals, recent activity, registration
|
||||
milestones, SBOM totals, and chart-ready workplan rows with task counts already
|
||||
aggregated server-side.
|
||||
|
||||
The page keeps the last successful overview response visible if a refresh times
|
||||
out, and marks the view stale instead of clearing the dashboard. Blocking
|
||||
decisions are fetched separately via `GET /decisions/?decision_type=pending`
|
||||
and only re-fetched after a successful resolve action — this prevents the inline
|
||||
form from being wiped on every poll.
|
||||
|
||||
Reference in New Issue
Block a user