Commit ce234f4
committed
fix(log-view): keep the tab local when the host wired no setter
Cursor caught a real regression, and it was mine. The execution slideout
forwarded the table's `host` into `LogView` while deliberately passing no
`tab`/`onTabChange` — so on the tables page `hostOwnsUrl` was true, `activeTab`
was pinned to `tab ?? 'overview'`, and `setActiveTab` called an undefined
callback. The Trace tab was unreachable when opening a run from the tables page.
The panel host was unaffected, which is why the suite stayed green.
The slideout's own TSDoc already claimed the tab stayed local. The doc described
the intent; forwarding `host` contradicted it.
Fixed at both levels:
- The slideout mounts the log as `host='panel'` outright and no longer takes a
`host` prop. A run slid in beside a table is embedded no matter where that
table renders — it has no address on either surface, so the tab is local state
by definition, not by inheritance from whatever the table happens to be.
- `LogView` treats the tab as URL-owned only when the host actually wired the
controlled pair (`hostOwnsUrl(host) && onTabChange !== undefined`). A host that
owns its URL but supplies no setter is embedding this view somewhere
unaddressable; degrading to local state keeps the tabs working. Dead tabs are
strictly worse than a tab that does not persist.
The guard rather than a discriminated union on `host`, because the table passes
`host` as a variable — a type-level union would not have fired at that mount.
Suite: 20951 passed.1 parent 354c6df commit ce234f4
3 files changed
Lines changed: 18 additions & 9 deletions
File tree
- apps/sim/components/resources
- log-view
- table-view
- components/execution-slideout
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
328 | 336 | | |
329 | 337 | | |
330 | 338 | | |
| |||
Lines changed: 9 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
52 | | - | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| |||
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
102 | | - | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1599 | 1599 | | |
1600 | 1600 | | |
1601 | 1601 | | |
1602 | | - | |
1603 | 1602 | | |
1604 | 1603 | | |
1605 | 1604 | | |
| |||
0 commit comments