What you'll learn: By the end of this case you will be able to design the front end of an admin dashboard made of many independent widgets that share filters: where the filters live (the URL), how each widget declares what it depends on, how requests are started, limited, cancelled and cached, how one slow or failing widget stays contained, how saved views survive change, and how the screen stays accessible while numbers update. You will also run the whole design as a pure TypeScript core with a thin React layer, tested with a virtual clock and a fake backend.
Picture a control-room wall of gauges. The operator turns one dial, "show the last 7 days", and every gauge that depends on the period should move. A gauge that shows the current number of open alerts should not move at all. One gauge has a broken pipe and goes grey, and the wall carries on. The risky moments are the in-between ones: a gauge still showing 30 days of data under a "7 days" label, or a slow answer for last week landing after the answer for last month. A dashboard front end is that wall. Most of the design is about those in-between moments.
Frame. This is an educational reference design, not the verified internal architecture of any company. The running product is a generic admin dashboard for a subscription software product, used by operations and customer-success staff: five widgets (recurring revenue, active users, request error rate, top accounts, open alerts), two shared filters (date range and regions), saved views, and widgets that some viewers are not allowed to see. No company is named. Every number, name and latency is illustrative, chosen to make the example concrete and to be replaced by your own measurements, unless a source is linked. A sibling case, Front-End Case Study: Banking Dashboard, covers a different dashboard problem (session timers, masked values, step-up checks); this case is about many widgets and shared filters.
The core idea
Three statements carry the design.
- A dashboard is a set of independent queries that share a filter object, not one page load. Each widget declares which filters it depends on, and only a change to one of those filters makes it ask again. A widget that shows live alerts depends on none.
- An answer belongs to a key, not to the screen. Every number is stored with the filters it answers. That makes "the number on screen is for the old range, the new one is loading" a state you can render, and makes "show whatever arrived last" impossible.
- Failure and permission are states of one widget. A widget that fails, or that the viewer may not see, says so in its own box. The rest of the board carries on. The server is the real gate for permissions; the screen only declines to ask.
Requirements and targets
Requirements. Staff open the dashboard, see all permitted widgets load, change the date range or regions and see every dependent widget update, share the URL so a colleague sees the same view, save and reopen a named view, hide and reorder widgets, retry one widget that failed, and use all of it with a keyboard and a screen reader. Out of scope: the chart-drawing library, drag-and-drop layout, export, streaming updates (the real-time analytics dashboard case, named here in plain text, covers a stream), and the analytics API and its rollups.
Targets (all illustrative):
| Target | Value | Why it is a target |
|---|---|---|
| Requests running at once | at most 2 in the lab | Protects the analytics API from a burst of one request per widget |
| Reuse of an earlier answer | 60 seconds | Going back to a recent range feels instant, and old data is not trusted for long |
| Widgets that reload on a region change | only those that depend on regions | A correctness and cost rule, not a number |
| A failing widget blanks another | never | Isolation is the point of the design |
| A viewer sees a widget they lack the feature for | never requested | Courtesy only; the server still refuses |
| One URL | one view | A shared link must reproduce what the sender saw |
Architecture
Figure 1. The browser side of the dashboard
How to read this: the view forwards events to the board store and renders its state. The store keeps the filters (mirrored in the address bar), the layout, and one state per widget; it asks the cache first and the API second. The API, drawn with a warning tone, is where permissions are decided.
The board is plain TypeScript with no DOM. The React layer is a few dozen lines that read the store with useSyncExternalStore. React's documentation describes that hook as a way to subscribe to an external store, and says repeated calls to getSnapshot must return the same value while the store has not changed: returning a new object each time leads to an infinite loop. The board therefore replaces its state object only when something changes.
Data and state
| Data | Owner | Freshness | Lives in |
|---|---|---|---|
| Date range and regions | The staff member | Live | The URL, read into the board |
| Widget order and hidden widgets | The staff member | Changes rarely | The board; a saved view stores it |
| Per widget: status, data, the filter key the data belongs to, the key it should show | The board | Seconds old is fine | The board |
| Earlier answers | The analytics API | A fixed lifetime | The cache, keyed by widget and filter key |
| Which features the viewer holds | The server | Per session | A session response, used only to decide what to ask |
| Saved views | The staff member | Months | Server storage, as versioned JSON |
Each widget has a status (idle, queued, loading, ready, error or forbidden) and keeps the last data it has while newer data is on its way.
Figure 2. The states of one widget
How to read this: the edge from ready back to queued is the important one. The widget keeps showing the previous numbers, labelled, while the new request waits for a slot and runs. Nothing returns to a blank state unless the widget never had data.
Filters belong to the URL
The date range and regions are shared by many widgets, can be bookmarked and sent to a colleague, and should work with the Back button. That is the case for putting them in the address bar; URL State covers the general pattern and its trade-offs, and this case adds what a dashboard needs on top.
The URL is input. Anyone can type anything after the question mark, so parsing falls back to a default for every field instead of throwing. The lab's parseFilters ignores an unknown range and unknown regions and returns regions in a fixed order; toSearch omits values equal to the default (so the default view has a clean URL), appends one region parameter per region, and keeps parameters it does not own, such as a campaign tag. MDN describes URLSearchParams as the utility for working with a query string, with getAll() returning every value of a repeated parameter and append() adding a pair as-is; both are what a multi-value filter needs.
Push versus replace. A change the person would want to undo with Back adds a history entry. MDN says pushState() adds an entry to the session history stack. MDN also says that calling pushState() or replaceState() does not fire popstate; the event fires on a browser action such as the Back or Forward button. The consequence is a clear rule for the binding between the board and the address bar. A filter change in the board writes the URL; a popstate reads the URL into the board; and a change that came from the URL is not written back, so there is no loop. The binding takes a small LocationPort (read, write, listen for pop) so a test can drive it without a browser. The URL given to pushState() must be of the same origin as the current URL, MDN adds.
Illustration 1, the minimal example: every widget fetches on any change
The smallest version, common in tutorials, gives each widget its own effect that depends on all the filters:
// inside every widget component
useEffect(() => {
fetch(`/api/revenue?range=${range}®ions=${regions.join(",")}`)
.then((r) => r.json())
.then(setData);
}, [range, regions]);
It has four problems. A widget that does not use regions still reloads when regions change, because the effect lists them. Two quick changes start two requests and the slower one can land last, so the widget shows data for old filters under a new label. A server error response is parsed as if it were data, because MDN says a fetch() promise does not reject on an HTTP error status. And there is nowhere to say "this widget failed" or "you may not see this". The rest of the case moves these decisions out of the widgets and into one store.
Each widget declares what it depends on
A widget is described by data: an id, a title, the filters it dependsOn, and the feature it requires (or none). The board never needs to know what a widget draws.
export interface WidgetDef {
readonly id: string;
readonly title: string;
readonly dependsOn: readonly FilterKey[]; // which filters change this widget's answer
readonly requires: string | null; // a feature the viewer must hold
}
From the filters and dependsOn, filtersKey(filters, keys) builds a string that is equal exactly when two filter objects agree on those keys. The widget's data is stored under that key. On a filter change the board computes the new key for each visible widget; if it equals the key the widget already shows, is loading, or has failed on, nothing happens.
Expected output, captured from a real run (the region EMEA is chosen; error-rate and alerts do not depend on regions):
-- region emea chosen (error-rate and alerts do not depend on regions)
t= 1000 start revenue range=30d®ions=emea
t= 1000 start active-users range=30d®ions=emea
t= 1120 done active-users range=30d®ions=emea
t= 1120 start top-accounts range=30d®ions=emea
t= 1300 done revenue range=30d®ions=emea
t= 1520 done top-accounts range=30d®ions=emea
requests for that change: 3
Three requests, not five. Revenue, active users and top accounts depend on regions; the error rate depends only on the range and the alerts widget on nothing. The times are virtual milliseconds and the latencies are chosen by the lab (illustrative). Note "start" for top accounts at t=1120: only two requests may run at once, so it waited for a slot.
Illustration 2, the realistic example: first load, a limit, one failure
The five widgets have different latencies (illustrative: 80 to 400 ms). The board starts them in layout order, never more than two at a time, and one of them, the error rate, fails.
Expected output, captured from a real run (first load):
== first load: two requests at a time, one widget fails ==
t= 0 start revenue range=30d®ions=
t= 0 start active-users range=30d®ions=
t= 120 done active-users range=30d®ions=
t= 120 start error-rate range=30d
t= 300 done revenue range=30d®ions=
t= 300 start top-accounts range=30d®ions=
t= 320 error error-rate range=30d
t= 320 start alerts (no filters)
t= 400 done alerts (no filters)
t= 700 done top-accounts range=30d®ions=
revenue ready 360k (30d, all regions, as of 300)
active-users ready 1200 (30d, all regions, as of 120)
error-rate error - "Could not load this widget"
top-accounts ready 5 accounts (30d, all regions, as of 700)
alerts ready 3 open (live, as of 400)
requests sent: 5
At t=0 only the first two widgets start. At t=120 the active-users answer frees a slot and the next widget in layout order starts, and the same happens at t=300 and t=320. The error rate fails at t=320 and ends in the error state; the other four are ready. The wording that goes with that state comes from a pure function, describeWidget, so a test can check it without rendering: "Could not load this widget". A retry for that widget alone is a separate call, retry(id).
Why a limit at all. The limit is a design choice about the API's capacity and about order: the widgets at the top of the layout are asked first, so the first screen fills before a table far below the fold. The value 2 is illustrative and should come from measuring the API; nothing here claims what a browser or a server allows.
One request per widget, and an answer belongs to a key
When a widget needs new data, the board does three things: it aborts the widget's previous request if one is running, it starts the new one, and it remembers the id of the single request whose answer may still be shown. MDN says AbortController.abort() aborts an asynchronous operation before it has completed and can abort fetch requests, the consumption of response bodies and streams. An abort is a courtesy to the network and the server; a proxy may ignore it and an answer can already be on its way. So the store also drops any answer that is not for the widget's current request. Shortened from the lab:
const reqId = ++nextReqId;
running.set(id, { reqId, controller, key });
load(id, state.filters, controller.signal).then(
(data) => {
if (running.get(id)?.reqId !== reqId) { emit("drop", id, key); return; } // not the newest request
running.delete(id);
cache.set(`${id}|${key}`, { data, at: clock.now() });
patch(id, { status: "ready", data, dataKey: key, error: null });
pump(); // a slot is free: start the next queued widget
},
/* error and forbidden handling */
);
The distinction matters: the abort saves work and the id check keeps the screen correct. This is the same rule as in the Search Autocomplete case, applied per widget, and Request Cancellation, Retries and Timeouts covers the mechanics.
Figure 3. Two quick range changes
How to read this: each widget keeps its own current request id. A late answer is compared with that id, never with the time it arrived.
Illustration 3, the failure case: slow answers for old filters
The lab ignores the abort on purpose, as a proxy that does not cancel would, and allows five requests at once so that all four widgets start together. The staff member picks 7 days and, 100 ms later, 90 days, before any 7-day answer has arrived.
Expected output, captured from a real run (the endpoint ignores the abort; the end state follows):
-- range 7d, then 90d before the 7d answers arrive
t= 1000 start revenue range=7d®ions=
t= 1000 start active-users range=7d®ions=
t= 1000 start error-rate range=7d
t= 1000 start top-accounts range=7d®ions=
t= 1100 abort revenue range=7d®ions=
t= 1100 abort active-users range=7d®ions=
t= 1100 abort error-rate range=7d
t= 1100 abort top-accounts range=7d®ions=
t= 1100 start revenue range=90d®ions=
t= 1100 start active-users range=90d®ions=
t= 1100 start error-rate range=90d
t= 1100 start top-accounts range=90d®ions=
t= 1120 drop active-users range=7d®ions=
t= 1200 drop error-rate range=7d
t= 1220 done active-users range=90d®ions=
t= 1300 drop revenue range=7d®ions=
t= 1300 done error-rate range=90d
t= 1400 drop top-accounts range=7d®ions=
t= 1400 done revenue range=90d®ions=
t= 1500 done top-accounts range=90d®ions=
revenue ready 1080k (90d, all regions, as of 1400)
active-users ready 3600 (90d, all regions, as of 1220)
error-rate ready 1.10% (90d, all regions, as of 1300)
top-accounts ready 5 accounts (90d, all regions, as of 1500)
alerts ready 3 open (live, as of 80)
Four requests are abandoned at t=1100 and four new ones start. The 7-day answers still arrive, at 1120, 1200, 1300 and 1400, and each is dropped. Every widget ends up showing 90-day data, and the open-alerts widget still says "as of 80": it was never asked again, because no filter it depends on changed. The server would have handled eight requests for this one change, so the abort has a cost the guard does not remove; a back-end rate limit is the answer to that, not a front-end change.
Show the old number, and say so
When filters change, a widget has three honest choices: blank until the new data arrives, keep the old number as if nothing happened, or keep the old number and say it is being replaced. The first loses context; the second is the bug this case exists to avoid. The design keeps the old data, marks the widget as stale, and puts a plain sentence in its status line: "Updating; showing the previous filters". Each widget stores the key its data belongs to and the key it should show, so "stale" is dataKey not equal to wantKey, not a guess. HTTP caching has a related idea, stale-while-revalidate, which MDN describes as allowing a cache to reuse a stale response while it revalidates in the background; that is a rule for HTTP caches, while the stale label in the board is a rule for what a person sees. See Server State, Caching and Revalidation.
The board also keeps an in-memory cache by widget and filter key with a lifetime. Going back to a range the staff member looked at a moment ago needs no request; going back after the lifetime has passed shows the old data labelled stale and asks again.
Expected output, captured from a real run (cache lifetime 5000 ms in this run):
-- back to 30d inside the 5000 ms lifetime of the cache
t= 2000 cache revenue range=30d®ions=
t= 2000 cache active-users range=30d®ions=
t= 2000 cache error-rate range=30d
t= 2000 cache top-accounts range=30d®ions=
-- 7d again after 8 seconds: the cached answer is too old
t=11000 start revenue range=7d®ions=
t=11000 start active-users range=7d®ions=
t=11000 start error-rate range=7d
t=11000 start top-accounts range=7d®ions=
revenue right now: status=loading shows "360k" for range=30d®ions=, wants range=7d®ions=
screen says: "Updating; showing the previous filters"
At t=2000 four widgets came from the cache and none started a request. After eight more seconds the entries were too old, so the four requests started again, and at that moment the revenue widget was still showing the number for 30 days, wanted 7 days, with the sentence "Updating; showing the previous filters". The alerts widget does not appear in either block: it depends on no filter.
Permissions: a courtesy on the screen, a rule on the server
A widget declares the feature it requires. If the viewer's session does not list that feature, the board never asks for the widget and renders "Not available for your account". If the server refuses anyway, answering a request with a refusal, the widget ends in the same state, because the screen's copy of the viewer's features can be stale or wrong. Neither case is shown as an error: there is nothing to retry. RBAC and ABAC on the UI covers the model; the point here is the two states that carry it.
Expected output, captured from a real run (a viewer without the billing feature):
== a viewer without the billing feature ==
t= 0 forbidden revenue range=30d®ions=
t= 0 forbidden top-accounts range=30d®ions=
t= 0 start active-users range=30d®ions=
t= 0 start error-rate range=30d
t= 120 done active-users range=30d®ions=
t= 120 start alerts (no filters)
t= 200 done error-rate range=30d
t= 200 done alerts (no filters)
revenue forbidden - "Not available for your account"
active-users ready 1200 (30d, all regions, as of 120)
error-rate ready 0.50% (30d, all regions, as of 200)
top-accounts forbidden - "Not available for your account"
alerts ready 3 open (live, as of 200)
requests sent: 3 (the two billing widgets were never asked)
Two widgets were never requested, and the other three loaded normally. A server-side refusal is tested separately: a fake endpoint refuses one widget and it ends forbidden, with no data.
Saved views are versioned data
A saved view is filters plus which widgets are shown and in what order. It lives for months while the widget catalogue changes underneath it, so it is stored with a version and read like any untrusted input.
Figure 4. Reading a stored view
How to read this: the two refusals are deliberate. A view saved by a newer version of the app is not guessed at, because a wrong guess silently changes what a person sees.
Expected output, captured from a real run (parse, migrate, repair):
== saved views: parse, migrate, repair ==
version 2, current: "EMEA weekly" range=7d regions=[emea]
order=[alerts,revenue,active-users,error-rate,top-accounts] hidden=[error-rate]
version 1, number of days: "Old view" range=90d regions=[]
order=[revenue,alerts,active-users,error-rate,top-accounts] hidden=[]
notes: migrated from version 1; dropped unknown widgets: legacy-chart; added new widgets: active-users, error-rate, top-accounts
saved by a newer app: refused (saved by a newer version (3))
not JSON: refused (not valid JSON)
In the second case an old view that stored days: 90 is migrated to the 90-day range, a widget that no longer exists is dropped, and the three widgets added since are appended, each repair reported as a note. A view shared as a URL carries filters only, because layout is a personal choice.
The interface and accessibility
Structure. Each widget is a section with its title as a heading and aria-labelledby pointing at it. MDN says an element with the region role should have a label, preferably through aria-labelledby referencing a visible heading, and that a section communicates the region role when it is given an accessible name. A screen-reader user can then jump between widgets as landmarks; too many landmarks stop being useful, so a long board should group widgets.
Loading. The widget sets aria-busy="true" while loading. MDN describes aria-busy as indicating that an element is currently being modified, which tells assistive technology that it may want to wait before informing users, and says it can be used outside live regions, for example in widgets or feeds.
Messages. Each widget has a small status line (loading, updating, failed, not available). WCAG 4.1.3 (Status Messages, level AA) asks that status messages can be presented by assistive technology without receiving focus; the W3C's understanding document gives "Searching..." and a results count as examples. Five widgets announcing at once on first load would be noise, so a single summary region ("4 of 5 widgets loaded, 1 failed") is a design choice worth testing with real users. The lab asserts roles and text, not what a screen reader says.
Not by colour alone. WCAG 1.4.1 (Use of Color, level A) says colour must not be the only visual means of conveying information, and the W3C's understanding document names an error shown only in red as an example of a failure. A stale or failed widget therefore carries words, not just a tint. Charts add a second rule: WCAG 1.4.11 (Non-text Contrast, level AA) asks for at least 3:1 against adjacent colours for graphical objects needed to understand the content. The lab draws no charts; see Accessibility and Compliance and Keyboard, Focus and Screen Readers.
Controls. The filters are a labelled form: a select for the range, a fieldset with a legend and checkboxes for regions, and a retry button per failed widget whose name includes the widget title.
Delivery and performance
The page should render its frame (titles, filter controls, boxes with reserved height) before any data arrives, so it does not jump when numbers land; see Core Web Vitals. Each widget's drawing code can be a separate lazy chunk, loaded when the widget is first shown, so a heavy chart library is not paid for on every page; the size decision is a measurement, so no number is given. A large table widget needs List Virtualization, and updates should keep main-thread work short; see The Event Loop and the Main Thread and Performance Budgets and Profiling.
Failure modes
| Failure | What the person sees | Response |
|---|---|---|
| One widget's request fails | That widget says it could not load, with a Retry button | Per-widget error state; the others are untouched |
| A slow answer for old filters | Nothing wrong | Abort plus the current-request check |
| The server ignores the abort | Nothing wrong | The check still drops the answer; rate limits are a back-end concern |
| The viewer lacks a feature | "Not available for your account" | Never requested; a server refusal gives the same state |
| A stale saved view | The view opens, a note says what changed | Version, migrate, drop unknown widgets, append new ones |
| A hand-edited URL | The default value for the bad part | Parse with defaults; never throw |
| Back button after a filter change | The previous filters return | popstate reads the URL into the board |
| A widget hidden while loading | Nothing | Abort and free the slot so queued widgets can start |
| The page unmounts | Nothing | Dispose of the board; later answers change nothing |
Trade-offs
| Decision | Choice | Cost | Revisit when |
|---|---|---|---|
| Where filters live | The URL | Every filter needs a parser, defaults and tests | A filter becomes too large or too private for a URL |
| Reload rule | Per-widget dependency keys | Each widget must declare its dependencies truthfully | Widgets are generated or user-defined |
| Old data while loading | Keep it, labelled | A person could still misread it | User research shows the label is missed |
| Request limit | A small limit, in layout order | The last widgets wait | The API can handle more, or latency data says otherwise |
| Answer cache | In memory, 60 seconds | Numbers can be a minute old | The data must be fresher, or an HTTP cache does this job |
| Permissions | Hide on the screen, enforce on the server | Two places to keep in step | A shared policy library is adopted |
Build it
The lab is examples/frontend/labs/saas-dashboard-core: a pure TypeScript core and a thin React component. It reuses the virtual clock of the autocomplete-combobox lab by import, and complements two existing labs instead of repeating them: url-state (one filter object for one list) and banking-dashboard-session (session, step-up and masked values). Time is a virtual clock that moves only when a test says so, and the backend is a deterministic fake with latencies the test chooses. The files are filters.ts, widgets.ts, fakeApi.ts, board.ts (the store), views.ts, urlBinding.ts and Dashboard.tsx (the view).
cd examples/frontend/labs/saas-dashboard-core
pnpm test # 32 tests
pnpm typecheck
node src/demo.ts # prints the blocks shown in this lesson
The 32 tests passed in the run made for this lesson: 26 in test/core.test.ts (filters and the URL, the limit, failure and permission states, the stale guard, the cache, layout, saved views, the URL binding) and 6 in test/react.test.tsx, which render into jsdom with Testing Library and check one named region per widget, the busy and status text, that a range change reloads only dependent widgets, that a failed widget has its own Retry button, and Strict Mode. jsdom is a JavaScript model of the DOM, not a browser: there is no layout, no charts and no real screen reader.
Break it. In board.ts, change the keyOf helper so every widget uses the same key (filtersKey(state.filters, ["range", "regions"])). In the run made for this lesson five tests failed, including "reloads only the widgets whose own filters changed". Revert it. A second experiment: change if (!stillWanted()) { in the success handler to if (false) {, and the test "aborts the older request and drops its answer even when the server ignores the abort" fails. Revert that too.
The output blocks above are verbatim excerpts of examples/frontend/golden/saas-dashboard-core.txt, captured with node examples/frontend/tools/capture-golden.mjs.
In practice: a dashboard that went blank
The situation
A platform team ships an operations dashboard with six widgets. In week three, the endpoint behind the top-accounts table starts taking about twenty seconds (illustrative). Staff report that the whole dashboard sits on a spinner, and that after they change the range some numbers are for the new range and some are not.
Starting architecture
- One loader that fetches all six endpoints with
Promise.alland sets one page state. - Filters held in component state, so a refresh loses them.
- No per-widget status, no cancellation, no record of which filters an answer is for.
Options considered
- Add a timeout to the loader and show an error for the whole page when it expires.
- Split the loader per widget, but keep filters in component state and let each widget fetch on any change.
- Give each widget its own state and dependency list in one board store, start requests per widget with a limit and a current-request check, and put filters in the URL.
The decision
Option 3. A page-level timeout still blanks five healthy widgets. Option 2 fixes the blank page but not the mixed ranges, because answers are not tied to filters. The store makes both problems states of one widget.
Rollout and verification
The team writes failing tests first with the fake backend: one slow widget must not delay the others; a slow answer for an old range must not replace a newer one even when the abort is ignored; a region change must not reload the error-rate widget. It ships behind a flag and watches the share of page views where a widget ends in error, and the request count per filter change.
The 2 a.m. failure
The top-accounts endpoint begins to fail outright after a deploy. The dashboard stays usable: five widgets load, the sixth shows "Could not load this widget" with a Retry button, and the alert is on the endpoint's error rate, not on a blank page. The on-call engineer checks that retries do not make things worse (each is one request, started by a person), pauses the widget with a server-side flag, and opens a ticket with the API owner.
This is a realistic scenario, not a case history.
The other side of this topic
The back end decides whether each widget can answer quickly: pre-aggregated rollups, query limits, cache headers and the permission checks the screen only mirrors. The back-end analytics pipelines lesson (named here in plain text) covers how the numbers are produced; the two meet at the contract: what a filter means, how fresh an answer is, what a refusal looks like, and what the server does when the client gives up.
Architect's notes
- Keep a correctness mechanism (the current-request check) separate from an optimisation (the abort, the cache). The first must never depend on the second.
- Make every widget declare its dependencies in data. A dependency written inside component code cannot be tested or audited.
- Store the key an answer belongs to. It makes stale a state you can render and local reuse safe.
- Treat the URL and saved views as untrusted input with a version, and say what was repaired.
Common mistakes
- One loader for the whole page. One slow widget then blanks all of them.
- Effects that list every filter. Widgets reload for filters they ignore.
- Showing the last answer to arrive. Show the answer for the current request.
- Blank while loading. The page jumps and the person loses context; keep the old data, labelled.
- Treating "not allowed" as an error. There is nothing to retry; say it is not available.
- Unversioned saved views. The first catalogue change breaks every stored view.
Key takeaways
- A dashboard is independent widgets sharing a filter object; each declares what it depends on.
- An answer belongs to a key; stale is
dataKeydifferent fromwantKey, not a guess. - Abort for efficiency, check the current request for correctness.
- Failure, loading and permission are per-widget states, so one problem never blanks the board.
- Filters live in the URL, parsed as untrusted input with defaults; saved views are versioned.
- Say what the lab cannot show: layout, charts, real screen readers, real networks.
Practice exercises
Exercise 1: Beginner (30 minutes). Run the lab's demo and, for each block, write which rule of the board produced each line (limit, dependency key, cache, current-request check).
Exercise 2: Intermediate (2 hours). Add a widget that depends on a third filter (a plan) and extend the URL parser and filtersKey. Write the tests before the code, including a case where the new filter is ignored by the existing widgets.
Exercise 3: Intermediate (2 hours). Add refreshEveryMs to the alerts widget and make it pause while the tab is hidden. Decide what the stale label should say.
Exercise 4: Advanced (3 hours). Score this case against the ten-part rubric from the case study method lesson, and write the paragraph that would raise its lowest part.
Related reading
Official documentation
- React:
useSyncExternalStore. - MDN:
AbortControllerandURLSearchParams. - MDN:
History.pushState()and thepopstateevent. - MDN:
aria-busyand theregionrole. - W3C: Understanding SC 4.1.3 Status Messages, SC 1.4.1 Use of Color and SC 1.4.11 Non-text Contrast.
- MDN:
Cache-Control.
In this course
- How to Read and Reproduce a Front-End Case Study: the ten parts this case follows.
- State Libraries Compared: Context, Redux, Zustand, Signals and Local vs Global State: where a store like the board fits.
- URL State: the pattern behind the filter binding.
- Front-End Case Study: Banking Dashboard: the session and sensitive-data side of dashboards.
- Error, Loading and Empty States: designing the states in Figure 2.
- Front-End Case Study: Search Autocomplete: the same stale-answer rule in a smaller setting.