Commit a8ec578
authored
perf(web): stop the hidden Automations tab fetching on launch (#7413)
`EntryShell` keeps every entry view mounted and hides the inactive ones with
`display: none` + `inert` + `aria-hidden`. `TasksView` is therefore live from
the first paint of Home, and its mount effect pulls four endpoints — the
automation catalog, pending proposals, routines, and the project picker — for a
tab the user has not opened.
It also runs the whole set twice per launch. `refresh` is keyed on
`tasksWorkspaceIdentity`, which changes when `/api/workspace/context` resolves,
so the identity-change pass repeats every request the pre-context pass made.
That accounts for `/api/automation-templates`, `/api/automation-proposals` and
`/api/routines` each appearing twice in a cold Home load.
The repository already has the answer for this: `ProjectsView` receives
`isActive`, and `DesignSystemsTab` early-returns on it. `TasksView` was simply
never given the prop. Add it and gate the refresh effect.
`isActive` defaults to true, so the six suites that render `<TasksView />`
directly — and any other caller — keep their current behaviour; only
`EntryShell` passes the real value. The effect depends on `isActive` as well as
`refresh`, so an identity change while hidden re-enters it, returns early, and
the fetch happens when the tab is opened. This delays the work, it does not
suppress it.
Nothing outside the component depends on it having loaded: `TasksView` takes no
callbacks and reports no counts upward, and it has a single mount site.1 parent 7965b75 commit a8ec578
3 files changed
Lines changed: 111 additions & 2 deletions
File tree
- apps/web
- src/components
- tests/components
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1763 | 1763 | | |
1764 | 1764 | | |
1765 | 1765 | | |
| 1766 | + | |
1766 | 1767 | | |
1767 | 1768 | | |
1768 | 1769 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
63 | 73 | | |
64 | 74 | | |
65 | 75 | | |
| |||
384 | 394 | | |
385 | 395 | | |
386 | 396 | | |
387 | | - | |
| 397 | + | |
388 | 398 | | |
389 | 399 | | |
390 | 400 | | |
| |||
514 | 524 | | |
515 | 525 | | |
516 | 526 | | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
517 | 537 | | |
518 | | - | |
| 538 | + | |
519 | 539 | | |
520 | 540 | | |
521 | 541 | | |
| |||
Lines changed: 88 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
0 commit comments