Commit db1b08f
committed
refactor(tables): take the table's address as props, not route params
Step 2 of the migration. A canonical unit may not read route context (R6, held
at 0 with no annotation escape), and both of these would fail it the moment the
tree moves.
- `TableGrid` had `workspaceId`/`tableId` as optional props with a
`useParams()` fallback. Its only mount already passes both, so the fallback
was dead code that nonetheless made the grid unmountable more than once per
page. Props are now required and the fallback is gone.
- `RowModal` read `params.workspaceId` with no fallback at all — a hard route
dependency feeding three mutations. It now takes `workspaceId` as a required
prop from its two mount sites in `table.tsx`.
No behavior change: every call site already had the values, and the panel was
already passing them explicitly. What changes is that the panel's copy no longer
silently resolves the *host page's* params when a prop is missing.1 parent bdf61bb commit db1b08f
3 files changed
Lines changed: 27 additions & 12 deletions
File tree
- apps/sim/app/workspace/[workspaceId]/tables/[tableId]
- components
- row-modal
- table-grid
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
| |||
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
73 | | - | |
74 | | - | |
75 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
76 | 88 | | |
77 | 89 | | |
78 | 90 | | |
| |||
Lines changed: 9 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
165 | 164 | | |
166 | 165 | | |
167 | 166 | | |
168 | | - | |
169 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
170 | 174 | | |
171 | 175 | | |
172 | 176 | | |
| |||
419 | 423 | | |
420 | 424 | | |
421 | 425 | | |
422 | | - | |
423 | | - | |
| 426 | + | |
| 427 | + | |
424 | 428 | | |
425 | 429 | | |
426 | 430 | | |
| |||
456 | 460 | | |
457 | 461 | | |
458 | 462 | | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | 463 | | |
463 | 464 | | |
464 | 465 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1592 | 1592 | | |
1593 | 1593 | | |
1594 | 1594 | | |
| 1595 | + | |
1595 | 1596 | | |
1596 | 1597 | | |
1597 | 1598 | | |
| |||
1602 | 1603 | | |
1603 | 1604 | | |
1604 | 1605 | | |
| 1606 | + | |
1605 | 1607 | | |
1606 | 1608 | | |
1607 | 1609 | | |
| |||
0 commit comments