Commit 634eef7
committed
refactor(tables): inject the cell editor instead of importing it
Completes the presentational/editing split at the row level. `DataRow` took an
`InlineEditor` import and constructed the editor itself, which would have carried
the whole write path — and its authenticated `useTimezone` — into the moved view
layer. It now takes a `renderCellEditor` callback and renders whatever the host
returns.
`TableGrid` supplies it, which is where it belongs: the closure needs the
pending-update state and the save/cancel handlers that own the mutation. A
surface with no write path passes nothing and renders no editor.
`DataRow.workspaceId` also becomes optional, matching `CellContent` — the two
together are the seam a share-scope surface needs.
Note the failure mode this deliberately avoids: making the prop optional means
`tsc` stays green whether or not the shell wires it, so the callsite and the
memo comparator were both updated in this change rather than left to a later one.1 parent d8b10aa commit 634eef7
2 files changed
Lines changed: 41 additions & 21 deletions
File tree
- apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid
Lines changed: 16 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
| |||
111 | 119 | | |
112 | 120 | | |
113 | 121 | | |
| 122 | + | |
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
| |||
156 | 165 | | |
157 | 166 | | |
158 | 167 | | |
| 168 | + | |
159 | 169 | | |
160 | 170 | | |
161 | 171 | | |
| |||
376 | 386 | | |
377 | 387 | | |
378 | 388 | | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
| 389 | + | |
394 | 390 | | |
395 | 391 | | |
396 | 392 | | |
| |||
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
3683 | 3683 | | |
3684 | 3684 | | |
3685 | 3685 | | |
| 3686 | + | |
| 3687 | + | |
| 3688 | + | |
| 3689 | + | |
| 3690 | + | |
| 3691 | + | |
| 3692 | + | |
| 3693 | + | |
| 3694 | + | |
| 3695 | + | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
| 3703 | + | |
| 3704 | + | |
| 3705 | + | |
| 3706 | + | |
| 3707 | + | |
| 3708 | + | |
3686 | 3709 | | |
3687 | 3710 | | |
3688 | 3711 | | |
| |||
4287 | 4310 | | |
4288 | 4311 | | |
4289 | 4312 | | |
| 4313 | + | |
4290 | 4314 | | |
4291 | 4315 | | |
4292 | 4316 | | |
| |||
0 commit comments