Skip to content

Commit 35494f3

Browse files
committed
docs(resources): record what the table migration actually did
Two corrections the plan got wrong, learned by doing it: the 4,420-line grid never needed to move (it is the shell), and the move needed four unblocking changes first — each of which was worth landing on its own. Also notes what is still open: the standalone share surface, the mothership panel, and the row page-size split.
1 parent 4e66399 commit 35494f3

1 file changed

Lines changed: 25 additions & 4 deletions

File tree

apps/sim/components/resources/MIGRATING-RESOURCES.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This is the migration plan.
1313
| --- | --- | --- | --- |
1414
| **file** | `components/resources/file-view` | Files page, mothership panel, interface module, `/f/[token]` | Done. The reference implementation. |
1515
| **interface** | `components/resources/interface-view` | editor page, mothership panel, `/i/[token]` | Done. |
16-
| **table** | | tables page only, **plus a hand-rolled copy** in the interface table module | Next, and the highest value. |
16+
| **table** | `components/resources/table-view` | interface module (workspace + share); tables page and mothership still mount the editing shell | Done for reading. The hand-rolled module copy is gone. |
1717
| **knowledge** || knowledge page, mothership panel | No public consumer yet. |
1818
| **log** || logs page, mothership panel, tables page | `LogDetailsContent` is already shared; it just leaks context. |
1919
| **schedule** || scheduled-tasks page, mothership panel | Smallest surface. |
@@ -112,7 +112,27 @@ fourteen authenticated mutation hooks.
112112
a pure `resolveCellRender()` returning a typed `CellRenderKind` union and a dumb `<CellRender/>`;
113113
`cells/cell-content.tsx` is only glue plus the inline editor. That split is the model for the rest.
114114

115-
### Suggested sequencing — three PRs, not one
115+
### What actually happened
116+
117+
PR 1 and PR 2 landed. Two corrections to the plan below, learned by doing it:
118+
119+
- **`table-grid.tsx` never moved, and did not need to.** It reads `useParams()`,
120+
`useUserPermissionsContext()` and ten mutation hooks — it *is* the shell. Only what
121+
it renders moved out from under it: 18 files, ~3.4k lines, at ~100% rename
122+
similarity. Splitting the grid was never a prerequisite for giving the view layer
123+
an address.
124+
- **The move needed four unblocking changes first**, each worth landing alone:
125+
`StatusBadge` out of `logs/utils` (it dragged the block registry into every table
126+
cell), `ChatMessageContext` read from its definition, `RemoteTableSelection` lifted
127+
out of the presence hook, and `CellContent` taking an `editor` slot instead of
128+
importing `InlineEditor` — with no `sideEffects: false`, that static import shipped
129+
the write path regardless of `isEditing`.
130+
131+
Still open: PR 3 (a standalone `/t/[token]` surface), the mothership panel (still
132+
mounts the whole editing page — a product decision, not a refactor), and the row
133+
page-size split documented on `TABLE_VIEW_PAGE_SIZE`.
134+
135+
### Original sequencing — three PRs, not one
116136

117137
**PR 1 — move, no behaviour change.** Relocate the presentational subtree to
118138
`components/resources/table-view/`: `TableColGroup`, headers, `DataRow`, `cells/` (minus
@@ -130,8 +150,9 @@ schema, `/t/[token]` or a table module inside a shared interface.
130150

131151
### Watch out for
132152

133-
- **`resolveCellRender` takes `currentWorkspaceId`** and emits a `sim-resource` chip for in-workspace
134-
URLs. `SimResourceCell` then fetches workspace lists to resolve names. In share scope pass
153+
- **`resolveCellRender` takes `currentWorkspaceId`** — now asserted in
154+
`table-view/cells/cell-render.test.ts`, which fails if the guard is removed. It emits a
155+
`sim-resource` chip for in-workspace URLs. `SimResourceCell` then fetches workspace lists to resolve names. In share scope pass
135156
`undefined`: the resolver never emits that kind, the URL falls through to a plain favicon link, and
136157
no workspace-authenticated query is mounted. Assert this in a test — it is the security property.
137158
- **Row execution metadata** (`exec`) carries run ids, statuses and costs. The public rows contract

0 commit comments

Comments
 (0)