Commit f89a6f5
committed
refactor(tables): give the editing shell the host axis and an explicit address
Both surfaces that mount the table keep every capability they had. The mothership
panel still mounts the full editing shell — editing a table from chat is a
product decision, not something to drop as a side effect of a refactor — it just
says `host='panel'` instead of `embedded`.
Three prop smells go with it:
- `embedded?: boolean` becomes `host: 'page' | 'panel'`, the same vocabulary the
canonical views use. `'public'` is deliberately unrepresentable: the shell
holds a write path, and an anonymous surface mounts `TableView`.
- `workspaceId` / `tableId` become required instead of optional-with-a-
`useParams()`-fallback. That fallback was documented as "page mode reads from
useParams", which is another way of saying the component could only ever exist
once per page.
- `page.tsx` now names `tableId` in its params type. It always had it — the type
just did not say so.
The ids stay plain rather than becoming a `ResourceSource`: `page.tsx` is a
Server Component and a source carries functions, so it cannot cross the RSC
boundary. That is the same reason the public interface page hands over a plain
seed and lets the client mint the source, and the prop doc now says so.
Behaviour is identical by construction — `embedded` is simply derived as
`host !== 'page'`, and the permission context the panel reads is untouched.1 parent 35494f3 commit f89a6f5
3 files changed
Lines changed: 43 additions & 18 deletions
File tree
- apps/sim/app/workspace/[workspaceId]
- home/components/mothership-view/components/resource-content
- tables/[tableId]
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
267 | 268 | | |
268 | 269 | | |
269 | | - | |
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| |||
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
Lines changed: 33 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
101 | 120 | | |
102 | 121 | | |
103 | 122 | | |
| |||
208 | 227 | | |
209 | 228 | | |
210 | 229 | | |
211 | | - | |
212 | | - | |
213 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
214 | 233 | | |
215 | 234 | | |
216 | | - | |
217 | | - | |
| 235 | + | |
218 | 236 | | |
219 | | - | |
220 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
221 | 240 | | |
222 | 241 | | |
223 | 242 | | |
| |||
0 commit comments