Skip to content

feat(app-shell): the page designer's add-block picker offers the list view block - #26915

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-ot4blw
Oct 27, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-ot4blw

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #26794

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:页面设计器的「添加区块」选择器里新增「列表视图」(list-view),放在「数据」分类下,和表格、表单、指标、看板并列;中英文名称齐全。
  • 为什么改:上一张卡(PR feat(app-shell): the page designer can set a list block's object, view and row cap #26793)给列表区块加了属性面板(对象、视图、条数上限),但选择器里没有这一项,设计器只能编辑页面里已有的列表区块,不能新加。
  • 风险与回滚:低。只加了选择器里的一行和两种语言的名称,删掉测试里为它留的豁免表;不新增元数据键,渲染端不动。回滚即 revert 本 PR。
  • 先看:ui/packages/app-shell/src/views/metadata-admin/previews/block-types.ts 新增的 'list-view' 一行;previews/PageBlockCanvas.addListView-26794.test.tsx;previews/__tests__/block-config.test.ts 删掉的 PANEL_WITHOUT_PALETTE。
  • 两分钟验证:cd ui && pnpm exec vitest run packages/app-shell/src/views/metadata-admin/previews/PageBlockCanvas.addListView-26794.test.tsx,预期 3 个用例全绿;或在 Studio 打开一个页面,点「添加区块」,在「数据」下选「列表视图」,右侧出现对象、视图、条数上限三个空框,画布上的列表提示先选对象。
  • 需要你做的:无,席位落地。

What changes

  • The picker offers list-view. BLOCK_TYPE_META gains a list-view row: category data, the LayoutList icon (the one its registration in plugin-list names), and the type label engine.pageBlockCanvas.type.listView, "List view" / "列表视图". BlockTypeId gains the id. TYPES_BY_CATEGORY, which the picker renders, is derived from that table, so nothing else changes in the picker.
  • The label lives in the studio namespace of @object-ui/i18n (en + zh), beside the block's three inspector rows, as the claim's file surface names. Its sibling engine.pageBlockCanvas.type.* rows are still in app-shell's designer table (views/metadata-admin/i18n.ts); the designer's t() asks that table first and the namespace second, so the picker reads either home the same way.
  • The exemption goes. previews/__tests__/block-config.test.ts loses PANEL_WITHOUT_PALETTE and its self-deleting case; "a block with a config panel is a block the palette offers" now reads the palette with no exemption.
  • A fresh block carries no binding. Measured on main: addBlock writes { type } and selects it, and ListViewBlock with neither data nor dataSource draws its existing hint ("No object named: set data.object or dataSource.object.") rather than an empty list. So the chosen behaviour is "asks for its object": the block is written bare, and the panel's Object control writes dataSource.object. No canvas default was added.

Tests

previews/PageBlockCanvas.addListView-26794.test.tsx drives the real picker in PageBlockCanvas and the real PageBlockInspector:

  • the list-view row sits under the Data heading, named in en and zh (zh read from the catalogue and checked to differ from en);
  • picking it writes [{ type: 'list-view' }] into the region, the draft passes PageSchema.safeParse, and the canvas selects regions[0].components[0];
  • that selection and draft, handed to the inspector, open Object, View and Row limit, all empty (Row limit hints 5), and typing an object writes dataSource.object.

Acceptance notes

Verification

All readings at head 1959511d, on merge base 6090bb73 (main has since moved to 1708115e without touching any file of this diff).

New test, and the ablation that proves it can fail
  • cd ui && pnpm exec vitest run packages/app-shell/src/views/metadata-admin/previews/PageBlockCanvas.addListView-26794.test.tsx: Test Files 1 passed, Tests 3 passed.
  • Ablation (one-time, under the verify lock, restored by trap): the 'list-view' row deleted from BLOCK_TYPE_META (anchor count after mutation 0), then the new file plus __tests__/block-config.test.ts: Tests 4 failed, 44 passed, the three new cases and "a block with a config panel is a block the palette offers". Restored: git diff HEAD empty, git hash-object equals the HEAD blob f6153ab1.
Touched suites and type-checks
  • Narrowed suite, declared: every app-shell test naming block-types, PageBlockCanvas, BLOCK_CONFIG or PageBlockInspector, every app-shell or i18n test naming the studio namespace, plus all of packages/i18n: Test Files 181 passed, Tests 2387 passed, 13 skipped. The rest of app-shell is left to CI's Test UI shards.
  • pnpm --filter @object-ui/i18n run type-check and pnpm --filter @object-ui/app-shell run type-check: exit 0 (both cover test files).
  • cd ui && pnpm run check:i18n-designer-parity: exit 0, every en row has a zh row. check:i18n-dead-keys: exit 0, the new key is not reported. check:new-line-citations: 0 new citations.
Derived gates

node scripts/pm/dispatch-gates.mjs --commands derived 34 commands; all 34 ran locally with exit 0 (PR-body gates against this body through GITHUB_EVENT_PATH), and --ran reconciles 34 derived, 34 run, 0 NOT-MEASURED. check-partof-closing-keyword with PR_BODY: exit 0. CI's lint and type-check farms are left to CI.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (n/a: no packages/spec change)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jVDGfqqDsAhmZbg6aF


Generated by Claude Code

… view block

The list-view block has had an inspector panel (Object, View, Row limit) but
no BLOCK_TYPE_META row, so the add-block picker never offered it. Add the row
under the data category with its type label (en + zh, studio namespace), drop
the PANEL_WITHOUT_PALETTE exemption the coverage test carried for it, and pin
the picker -> canvas -> inspector path in a new test.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVDGfqqDsAhmZbg6aF
…st-view palette case

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVDGfqqDsAhmZbg6aF
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对

ACCEPT · seat domain:ui#4 · session_01QsR2jTfvjNTaR29ehLk26T · 2026-10-27T21:22Z · head 1959511dcc517a135c0dc7141483c2f493b6b9fc

  1. Shape: draft, base main, Fixes #26794. Clause-②: no and Metadata-protocol: none are in the body and the changeset, and they match the claim. Six files, all inside the claimed surface: previews/block-types.ts (+7), the studio namespace en.ts/zh.ts (+4 each, one label row), previews/__tests__/block-config.test.ts (+3/−23, the exemption removed), the new PageBlockCanvas.addListView-26794.test.tsx, and one root changeset (@object-ui/app-shell and @object-ui/i18n, both patch). No packages/spec/**, no server package, no metadata key.
  2. Premise, measured: the seat read the diff. BLOCK_TYPE_META gains list-view (category data, LayoutList, engine.pageBlockCanvas.type.listView), and TYPES_BY_CATEGORY derives from it, so the picker offers it. PANEL_WITHOUT_PALETTE and its self-deleting case go, and "a block with a config panel is a block the palette offers" now holds with no exemption. A fresh block is written bare ({ type: 'list-view' }), and ListViewBlock's existing hint asks for the object until the panel writes dataSource.object. The new test drives the real picker and inspector, and the ablation (row deleted) reddens 4 cases.
  3. Gates, pinned to the head: check-runs?filter=latest 43 success, 9 skipped, 0 failing or pending · check-governed-merges --pr 26915: NOT governed, 197 changed lines (+174/−23). mergeable_state: clean. origin/main 94e29cd1 has no 'list-view' row in block-types.ts, so nothing here is already landed.
  4. Accepted deviations: the label row lives in the studio namespace while its sibling engine.pageBlockCanvas.type.* rows are still in app-shell's designer table. The claim's surface named the namespace; the designer's t() reads both homes, and the app-shell: a published library that is 66% Console product surface — retire the 67 zero-reference exports now, decide the split, and fold the second i18n table into @object-ui/i18n #25922 slice that moves the family takes the rest. The @object-ui/i18n patch bump follows from the row living there.
  5. Out of scope: none. No skip, quarantine or raised timeout. Skills-docs: is not owed.
  6. Prose face, checked against the diff: the block-types.ts comment and both catalogue comments say what the diff does, and they cite Page designer: the add-block palette does not offer list-view, though the block now has an inspector panel #26794. The changeset and the 维护者速读 describe a picker row and two labels, with no key declared.

Landing: no contract review is owed (no published schema, no governed text, Clause-②: no). The seat marks the PR ready and arms auto-merge. On MERGED, Fixes #26794 closes the card.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Page designer: the add-block palette does not offer list-view, though the block now has an inspector panel

2 participants