Repository navigation
fix(app-shell): a draft-only object's new or first-edited list view starts from its first five fields - #30507
Merged
Merged
Conversation
…ts from its first five fields (#30317) useObjectListViewDraft seeded a view's columns from the shell's merged objects, which hold published objects only, so on a draft-only object the first edit of a not-yet-created view and New view started from no columns. When the merged definition is missing, the hook now reads the package's drafted definition with the drafts overlaid and seeds from it. Claude-Session: https://claude.ai/code/session_01L6bhgXNFpXQRAPXfpTaqkV Co-authored-by: Claude <noreply@anthropic.com>
… in the same file) Claude-Session: https://claude.ai/code/session_01L6bhgXNFpXQRAPXfpTaqkV Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#5 · os-sales · session_01L6bhgVwQZbHRRM9CaXeKif 维护者速读
席位核对 — ACCEPT · domain:ui#5 · head
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
domain:ui#5 · os-sales · session_01L6bhgXNFpXQRAPXfpTaqkV
Requested by Sales · project thread
Fixes #30317
Clause-②: no
Metadata-protocol: none
维护者速读
useObjectListViewDraft的默认列这一段。合并元数据里找不到对象时,多读一次本包的草稿对象定义(GET /meta/object/:name?preview=draft&package=,字段选择器已在读同一个地址);已发布对象不多发请求;读失败或读不到时仍是空,和以前一样。回滚即还原本 PR。ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.tsx里seedColumns上方新增的draftedDef一段。pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/ObjectListViewInspector.draftObjectSeed-30317.test.tsx,预期 4 个用例全绿;在 main 上同一文件 3 个失败。What changes
In Studio › Interfaces,
useObjectListViewDraftseeds the columns of a list view created in the panel (the first edit of a view that does not exist yet, and New view with no columns picked) withdefaultListColumnsFromObject(objectDef, 5).objectDefcame only from the shell's mergedmetadata.objects, which holds published objects, so on a draft-only object the seed was[].client.withPreviewDrafts(true).get('object', name, { packageId }), the readuseObjectFieldsalready makes for the panel's field picker) and seeds from it. The answer is keyed on[packageId, objectName]and re-read after a publish.Changeset:
.changeset/30317-draft-only-object-view-seed.md,@object-ui/app-shellpatch.Branch: the harness-assigned
claude/project-thread-9n7hb1, notclaude/issue-30317-*; the card is #30317.Tests
New file
ObjectListViewInspector.draftObjectSeed-30317.test.tsx: the real hook over a realMetadataClient, whose transport is an in-memory server that servesGET /meta/object/:name?preview=draftin its envelope and 404 otherwise, and records the PUTs.acmetrial_deal(absent from the merged metadata, a hidden field first):seedColumnsis its first five visible fields, the canvas shows them, and the first edit (made as the panel makes it, addingnotes) PUTsview/acmetrial_deal.defaultwith those five plusnotes;createViewwith a grid payload and no columns) PUTsview/acmetrial_deal.open_dealswith the same five;GET /meta/object/...is sent for it;[], no failure, the buffer still loads.On
origin/main(989ae42d) the file reads 3 failed, 1 passed (the seed is[]; the 404 control fails because no read is sent). With the fix, 4 passed. Since the pre-fix run is the same file over the unpatched hook, no separate ablation was run.Test runs and gates
0be094aa(fix, before mergingmain): every app-shell test file importingObjectListViewInspectororStudioDesignSurface, 241 files,--maxWorkers=2, under the verify lock:Test Files 241 passed (241),Tests 1751 passed (1751), VERDICT command-exit 0. eslint on the two touched files: 0 errors (22 warnings, all on lines this PR does not touch).node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat0be094aa(3 paths): 35 commands, run serially, every one exit 0, includingpnpm --dir ui exec vitest run scripts/(Test Files 170 passed | 2 skipped (172),Tests 4985 passed | 2 skipped).--ranwith the recorded exit codes: 35 derived, 35 run, 0 NOT-MEASURED (a derived zero). Also run:pnpm --filter @object-ui/app-shell run type-check,pnpm --dir ui run check:spec-symbols,pnpm check:changeset-fixed, each exit 0.af914a2d(after mergingmaina1d0b1ee, which carries PR feat(app-shell): configure a list view's selection-bar actions in Studio (#30089) #30339's edit of this file; no conflict; app-shell closure rebuilt):pnpm --filter @object-ui/app-shell run type-check, every test file underpackages/app-shell/src/views/studio-design/(Test Files 330 passed (330),Tests 2473 passed (2473)) andpnpm --dir ui run check:spec-symbols, one chained run, VERDICT command-exit 0.Not run locally: the full ui suite (CI's Test UI shards run it).
Verification
Dev boot of
examples/app-showcase(objectstack dev --seed-admin --fresh) after the@object-ui/app-shelland showcase build closure, console Vite pointed at it, Playwright Chromium at 1440×900, signed in as the dev admin. Seeded over REST: writable packagecom.example.acme-trial(POST /api/v1/packages), then with?mode=draftthe objectacmetrial_deal(fields name, amount, stage, close_date, probability, notes) and the appacmetrial_app, whose one nav entry is the object. Opened the entry in Studio › Interfaces. Before =origin/main's hook; after = this branch's, served by Vite HMR; the view drafts were discarded (DELETE …?state=draft) between the two.view/acmetrial_deal.defaultwith columns[{ field: notes }][name, amount, stage, close_date, probability, notes]view/acmetrial_deal.open_dealswith columns[][name, amount, stage, close_date, probability]Shots (1440 wide) and the recorded PUT bodies are in the project's
issue-30317/folder (before-1-opened-1440.png,before-2-first-edit-1440.png,before-3-new-view-1440.png, the threeafter-*shots,puts.json); this repository has no place to commit them, perui/AGENTS.mdHousekeeping.Acceptance notes
{ field, label }and the after leg's as a bare name: the column editor keeps the shape of the list it is handed, and the seed is bare names, as it is for a published object today. Not changed here.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgXNFpXQRAPXfpTaqkV