Migrate table block to the structurer and BlockModelV3 - #57
Conversation
Run `block-tools structure refresh` + `pnpm fmt` (block-tools 2.11.0): adopt the canonical tool-managed layout — tsconfig/turbo/oxlint/oxfmt configs, block index, managed package.json and catalog across all packages, eslint/prettier removed in favour of oxlint/oxfmt. Full SDK upgrade forced by the require-latest gate: @platforma-sdk/model and ui-vue 1.48 -> 1.79.14, workflow-tengo 5.7 -> 6.6.3, tengo-builder 2 -> 4, block-tools -> 2.11.0, vue pinned to 3.5.24. Author-code fixes required by the SDK bump follow in a separate commit.
- model: emit `pTable` via `.outputWithStatus` so it satisfies the new
`usePlDataTableSettingsV2({ model })` signature, which now expects
`OutputWithStatus<PlDataTableModel | undefined>` instead of the bare value.
- ui: drop `import '@platforma-sdk/ui-vue/styles'` — the `./styles` subpath
export was removed; styles now ship via the package entry.
- model: declare `@milaboratories/helpers` a direct dependency to resolve
TS2742 on the inferred `model` type (SDK pframe-builder return types leak a
helpers type that must be nameable from a direct dep).
- catalog: align `@milaboratories/helpers` to ^1.14.2 (the SDK's version) so
the model dedupes to a single copy.
Patch bump for block, model, ui, workflow (test is private).
Convert the table block from the legacy V1 model API to BlockModelV3: - Unified `data` model (model/src/types.ts, model/src/dataModel.ts). A one-time `.upgradeLegacy` carries over the V1 `uiState` (group + tableStateV2) and drops the obsolete keys the old UI-side upgrader used to delete. - All block state is UI-only (column selection + table grid state); `.args` projects to an empty object and never gates the block (the workflow has no inputs). - pTable is built with createPlDataTableV3, sourcing column snapshots via ColumnCollectionBuilder + collectCtxColumnSnapshotProviders (primary/secondary via the per-column isPrimary flag, replacing V2's coreColumnPredicate). - UI moves from defineApp/app.model.ui to defineAppV3/app.model.data; the legacy UI-state upgrader IIFE is removed.
There was a problem hiding this comment.
Code Review
This pull request migrates the table block to the block-tools structurer and upgrades the SDK to BlockModelV3. Key changes include updating package configurations, adopting tool-managed layouts (oxlint/oxfmt), migrating the data model from legacy V1 to BlockModelV3 with a unified data model, and moving UI bindings from app.model.ui to app.model.data. A critical issue was identified in model/src/index.ts where disposing of the ColumnCollection immediately will invalidate the returned snapshots; it is recommended to use ctx.use() to manage its lifetime instead.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Reviewed the automated comments. Assessment below — no code changes warranted; reasoning with evidence:
|
…tart Respect the structurer's test: true instead of disabling the lane. The block smoke test runs against a CI-provisioned pl backend whose cold start has no readiness gate (pl-compose uses a bare `sleep 1`), so a single attempt loses the startup race -> RpcError ECONNREFUSED 127.0.0.1:6345. Match the green test:true blocks (clonotype-browser, mixcr-clonotyping): add retry: 2 + testTimeout to test/vitest.config.mts and a per-test timeout to the smoke test. No pl-docker-tag pin (default image). Verified green on the graph-maker block.
Modernizes the
tableblock in two stages, each as its own commit for review.1. Structurer migration + SDK upgrade
block-tools structure refreshadopts the tool-managed layout (oxlint/oxfmt replacing eslint/prettier, managed tsconfig/turbo/catalog, block index,upgrade-sdkscript).@platforma-sdk/model&ui-vue1.48 → 1.79.14,workflow-tengo5 → 6.6.3,tengo-builder2 → 4,block-tools→ 2.11.0, vue pinned to 3.5.24.@milaboratories/helpersa direct model dep + align its catalog pin (fixes TS2742 on the inferred model type); drop the removed@platforma-sdk/ui-vue/stylesimport; remove an unused test param flagged by oxlint.2. V1 → V3 model migration
BlockModel(V1) toBlockModelV3with a unifieddatamodel. A one-time.upgradeLegacycarries over the V1uiState(group+tableStateV2) and drops obsolete keys the old UI-side upgrader used to delete..argsprojects to an empty object and never gates the block (the workflow has no inputs).pTableis built withcreatePlDataTableV3, sourcing column snapshots viaColumnCollectionBuilder+collectCtxColumnSnapshotProviders(primary/secondary via the per-columnisPrimaryflag, replacing V2'scoreColumnPredicate).defineApp/app.model.uitodefineAppV3/app.model.data.Commits
.structuremarker)Verification
pnpm build8/8 green;pnpm checkgreen (oxlint/oxfmt/type-check).test/src/wf.test.ts) passes against a local backend. Storage confirms the V3 shape:{"dataVersion":"v1","data":{group,tableStateV2}}.Caveats
findColumns → createPlDataTableV3path uses canonical SDK helpers but isn't runtime-exercised by the trivial test..upgradeLegacywasn't run against a real on-disk V1 project (no V1 fixture available) — worth a manual check by loading a pre-existing V1 project before relying on the upgrade in production.Greptile Summary
This PR modernizes the
tableblock in two stages: a structurer/SDK upgrade (oxlint/oxfmt, SDK 1.79, workflow-tengo 6, tengo-builder 4) and a full migration from the legacyBlockModelV1 API toBlockModelV3with a unifiedDataModelBuilderdata model.BlockDatatype viaDataModelBuilder; a one-time.upgradeLegacycarries over V1uiStatefields (group+tableStateV2) and drops obsolete keys.createPlDataTableV2+ manualcoreColumnPredicateis replaced byColumnCollectionBuilder+collectCtxColumnSnapshotProviders+createPlDataTableV3, with primary/secondary distinction now expressed via the per-columnisPrimaryflag; output type changes fromoutputtooutputWithStatus.defineApp/app.model.ui→defineAppV3/app.model.data; the exported model identifier changes frommodeltoplatforma.Confidence Score: 4/5
Safe to merge for new projects; the populated pTable path and the V1-to-V3 upgrade path are both untested and should be validated manually before this block is used with real data or upgraded V1 projects in production.
The structurer migration and all tooling changes are mechanical and low-risk. The UI wiring and data-model plumbing are straightforward. The one concern is in model/src/index.ts: collection.dispose() is called before the extracted snapshots are passed to createPlDataTableV3, and that entire code path is explicitly unexercised by the integration test. If snapshots carry live references to the collection's internal state, the table would receive stale or invalid data silently.
model/src/index.ts (pTable outputWithStatus — dispose ordering and untested snapshot path), model/src/dataModel.ts (upgradeLegacy — no V1 fixture test)
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[BlockModelV3.create blockDataModel] --> B[.args - empty BlockArgs] A --> C[.output pColumns] A --> D[.output pFrame] A --> E[.output sheets] A --> F[.outputWithStatus pTable] F --> G[ColumnCollectionBuilder + collectCtxColumnSnapshotProviders] G --> H[collection.findColumns] H --> I[collection.dispose] I --> J[byId Map lookup primary + secondary snapshots] J --> K[createPlDataTableV3 isPrimary flag per column] subgraph DataModelBuilder L[.from BlockData v1] L --> M[.upgradeLegacy V1 uiState to group + tableStateV2] M --> N[.init emptyGroup + createPlDataTableStateV2] end A -.uses.-> DataModelBuilder%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A[BlockModelV3.create blockDataModel] --> B[.args - empty BlockArgs] A --> C[.output pColumns] A --> D[.output pFrame] A --> E[.output sheets] A --> F[.outputWithStatus pTable] F --> G[ColumnCollectionBuilder + collectCtxColumnSnapshotProviders] G --> H[collection.findColumns] H --> I[collection.dispose] I --> J[byId Map lookup primary + secondary snapshots] J --> K[createPlDataTableV3 isPrimary flag per column] subgraph DataModelBuilder L[.from BlockData v1] L --> M[.upgradeLegacy V1 uiState to group + tableStateV2] M --> N[.init emptyGroup + createPlDataTableStateV2] end A -.uses.-> DataModelBuilderPrompt To Fix All With AI
Reviews (1): Last reviewed commit: "Migrate model to BlockModelV3 and create..." | Re-trigger Greptile
Context used: