Skip to content

feat(console): the ⌘K palette previews the selected record, creates a record from the query, and names what Enter does - #36387

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-36286-palette-preview-create
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-36286-palette-preview-create

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread
Part of #36286 — this PR is step 1 (to-do items 1 to 4); item 5, the "current page" group on the empty palette, is left for a second PR on the same card.

repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ

Clause-②: yes (widening) — eight new published language-pack keys, in all eleven packs: console.commandPalette.create, createAs, previewEmpty, enterOpenRecord, enterCreate, enterSwitchApp, enterApplyTheme, enterOpen
Metadata-protocol: none

维护者速读

  • 在应用里打开搜索面板:搜到记录时右边显示选中记录的要点(标题和对象声明的关键字段),上下键跟着换;输入任意词,列表最后出现「新建『该词』为客户」等行,回车打开已填好名称的新建页;输入「新建」或对象名能找到「新建客户」这类入口;面板底部写明回车会做什么。
  • 属于外壳体验对标 Attio 专题,落实维护者「立」的四条改进里的第 1 条(必做的前四项)。
  • 出问题时用户最多看到预览或新建入口不对、点进一个空的新建页,不会改动任何数据,可以直接撤回。
  • 请看下面的截图,确认右侧详情和新建行的样子是否符合预期。

What changes

The ⌘K palette inside an app (CommandPalette, ui/packages/app-shell/src/chrome/) gains the card's items 1 to 4. Which records search finds and their order, the full search page, mobile and the AI entry are untouched.

  1. Record preview on the right (PalettePreviewPane.tsx). While the query finds records, the palette widens (sm:max-w-3xl) and draws the selected hit read-only through the existing RecordPreviewCard (object label, title by the ADR-0079 ladder, the object's declared highlightFields through the record page's highlight strip, field-level security applied). The selection is cmdk's own, now controlled (value / onValueChange), so ArrowUp/ArrowDown move the preview. When a new set of hits lands, the selection moves to the first hit. The pane is a CSS container query on the palette frame: below a 45rem (720px) frame it is display: none, so a narrow window shows the results alone and nothing scrolls sideways.
  2. Create "words" as OBJECT (paletteCreate.ts). Once something is typed, the last group, "Create", offers up to three of the app's navigation objects, the object of the page the palette was opened on first, then the navigation's order. Enter opens /apps/APP/OBJECT/new?TITLEFIELD=words, the create page that already reads its query string as the create prefill. An object is offered by the same verdict as the list's New: resolveAffordance('listNew', …) (bucket, userActions.create, effective API operations, create grant), then the create action's toolbar visibleWhen (fails closed) and disabledWhen bound with no record, as objectViewToolbarAffordances binds them. A "create as" row additionally needs the object's title field (resolveNameField) to be a text/textarea field, not readonly, that the member may write on create (createFormFields), so the words always land.
  3. New OBJECT entries, in the same group: one per creatable object whose label ("New Customer", the list button's own console.objectView.newObject key), object label, machine name or the words "create new" match the query. An object whose New entry the query found gets no "create as" row (the query names the action, not a record).
  4. Enter hint (PaletteEnterHint.tsx). A footer names what Enter does to the selected entry, read off the first word of its cmdk value: Open record (record, recent), Create, Switch app, Apply theme, or Open (every navigation entry).

Eight new published @object-ui/i18n keys in all eleven packs, a widening of the language packs (Clause-② yes): console.commandPalette.create, createAs, previewEmpty, enterOpenRecord, enterCreate, enterSwitchApp, enterApplyTheme, enterOpen (zh-Hant regenerated by gen:zh-hant). No props or package exports change. README section of the palette updated. Changeset: @object-ui/app-shell + @object-ui/i18n patch.

Screenshots (showcase app, 1440 wide, zh-CN; own --fresh backend + console dev server on this branch)

Hit: "north" on the Accounts list, the first hit previewed, footer 「打开记录 ↵」

hit

Miss: 「张三丰」, the page's object first, footer 「新建 ↵」

miss

「新建」: the New entries (below the navigation pages the word also finds)

new

Enter on the miss row: the create page with the name filled

create

A 700px window: results alone, no preview, no sideways scroll (measured scrollWidth - clientWidth = 0)

narrow

English: hit · miss. The images live on the orphan ref claude/issue-36286-screenshots (no code), so this PR's diff carries no binary.

Read first (by risk)

  1. ui/packages/app-shell/src/chrome/CommandPalette.tsx — the hunk that computes createTargets / newRecordRows / createAsRows, and the render-time block that moves the selection to the first record hit when hitSignature changes (state adjusted during render, not in an effect).
  2. ui/packages/app-shell/src/chrome/paletteCreate.ts — paletteMayCreate (the New verdict) and palettePrefillField.
  3. ui/packages/app-shell/src/chrome/PalettePreviewPane.tsx — the 150 ms settle before the by-id read.

Tests

New file CommandPalette.previewCreate-36286.test.tsx (15 tests) against the real CommandPaletteProvider over the find fanout and findOne: the preview draws title + declared key fields and Enter opens the record; ArrowDown moves the preview and only the settled records are read (findOne called for C1 then C2, nothing else); the container-query classes; no pane and no wide palette without a hit; create-as order (route object first, else navigation order), the invoice the member may not create never offered, Enter lands on /apps/crm/customer_36286/new?name=Zhang+San; the empty palette and a cleared query offer no create row; "new" finds one New entry per creatable object and no create-as row; an object's name finds its New entry; the footer per entry kind; visibleWhen / disabledWhen / title-field gates as units.

Local runs at 862d69b
  • pnpm --filter @object-ui/app-shell type-check (both tsc --noEmit and tsconfig.test.json), then vitest run packages/app-shell/src/chrome/ under the lock: VERDICT command-exit 0, Test Files 29 passed (29), Tests 173 passed (173).
  • vitest run packages/i18n/: Test Files 106 passed (106), Tests 1978 passed, 13 skipped. (First run had 3 reds, fixed in this branch: zh-Hant not regenerated, and the de quote-pair count pin 121 to 122 for the new createAs pair.)
  • Earlier on this branch: every CommandPalette.*.test.tsx, paletteMatch.test.ts and views/record-preview/*.test.tsx green (part of the 126-file run whose only reds were the two i18n files above).
  • ui: check:i18n-keys, check:i18n-drift (0 en values changed, 8 keys added), check:i18n-dead-keys: exit 0.
  • eslint --no-inline-config on the changed files: 0 errors; CommandPalette.tsx carries the same 10 warnings as on main.
  • Derived families run locally (exit 0): check-adr-0087-registration, check-changeset-no-major, check-empty-changeset, check-closing-keyword-parity, check-sdui-manifest, check-comment-mask-corpus, check:nul-bytes, check:published-files, check:cross-package-test-inputs, check:test-source-alias, check:undeclared-dep-imports, check:adr-anchors, check:role-word, check:watch-hint-literal, check:type-check-coverage. NOT MEASURED: check:type-check-debt (killed at its 300 s local timeout; CI's).
  • overlap-check: VERDICT clean, merges with origin/main and 6 open PRs sharing the locale packs.

Acceptance notes

  • Create opens the create page, not the list's modal. The palette navigates to /apps/APP/OBJECT/new (the route the bare data surface's New and a related list's New open; it reads the query string as prefill). The list page's New opens a modal through AppContent's handleEdit, which is outside this claim's file surface; reaching it from the palette would mean a new prop wired there. Worth a decision if the modal is wanted.
  • Key fields are the declared highlightFields only. An object that declares none previews its title alone: that is RecordPreviewCard's rule, from the record page's 「没声明就不挑」 ruling, not a new choice. The card's acceptance line (industry, phone, email) holds for an object that declares them.
  • At most three "create as" rows (CREATE_AS_MAX), a judgment to keep the list short in apps with many objects; every other creatable object is still one "New OBJECT" entry away by name.
  • The Create group comes last, so Enter on a query that finds anything opens that thing; with the English word "new", records whose status is "new" come first and the New entries sit below them (the 「新建」 screenshot shows the Chinese case).
  • Home's palette reads the host app's navigation, so it offers the same rows there; the Studio palette offers none (no records, no app).
  • One extra read per previewed record: the hit payload carries the row, but RecordPreviewCard reads by id with $expand on the reference fields it shows, so lookups render as names; holding an arrow key reads nothing until the selection rests 150 ms.
  • The showcase's account object is labelled "Account (Success Overlay)" by that example; the screenshots show it as served.
  • The de pack's quote-pair count pin moves 121 to 122; a sibling PR adding another „“ pair will need the same one-line bump on merge.
  • Item 5 of the card (the "current page" group on the empty palette) is not in this PR.
Readings at head a17d2c7 (after the first-push verification above)

Verification

Two minutes: cd examples/app-showcase && pnpm exec objectstack dev --seed-admin --fresh -p PORT, then in ui/apps/console DEV_PROXY_TARGET=http://localhost:PORT pnpm exec vite --port VPORT --strictPort; sign in, open Accounts, press ⌘K, type north: Northwind is selected and the right pane shows Lifecycle / Industry / Annual Revenue; type 张三丰 and press Enter: the account create page opens with Account Name filled.


Generated by Claude Code

Resolve the de quote-pair pin: main's two restore-factory pairs (123)
plus this branch's createAs pair make 124.

Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
The 768px cap the palette takes beside a record preview is wider than a
640px window holds with a margin; read DIALOG_VIEWPORT_GUTTER as every
other wide dialog does, and list the palette in the gutter census.

Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ

Final head for L1 · area f7-shell · 2026-11-22T10:26Z
Head-sha: a17d2c75bfddbbd6e5128f11aa30107b28251027

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 REWORK · head a17d2c75bfddbbd6e5128f11aa30107b28251027 · 2026-11-22T10:29Z

维护者速读

  • 用户能看到什么变化:应用里按 ⌘K 搜到记录时,面板变宽,右边只读显示选中那条记录;上下键切换时,右边跟着换。输入内容后,列表末尾会出现「新建『输入的词』为某对象」;输入「新建」或对象名,会出现「新建某对象」。面板底部写明按回车会做什么。
  • 为什么做:卡 搜索面板(⌘K):搜到记录时右边显示详情,搜不到时可以直接新建,能搜到「新建客户」这类动作 #36286 第一步(第 1–4 项)。第 5 项「当前页面」那一组留给同一张卡的第二个 PR。
  • 出错会怎样:最多是面板显示或跳转不对,不碰数据,可以整体撤回。搜什么、怎么排序都没变。
  • 要你做什么:无。
  • 席位意见:REWORK,只有一项:Clause-② 声明行要改。功能本身我读下来是对的,「新建为…」打开对象的新建页这一读法我认可,见下面。

要改的(1 项)

  1. Clause-② 应为 yes (widening)。 本 PR 在每个语言包里加了 8 个 console.commandPalette.* 键。@object-ui/i18n 构建出的 dist/locales/en.d.ts 会把每个键都类型成只读字面量,所以新增键就是放宽;本仓库一直按 yes (widening) 声明(grid: "select all matching" banner counts every match, but the bulk action processes only the first 5000 #28552、console FormPage: an edit form whose record read is refused draws the raw server body on its load banner ("Could not open record … for editing (403): {…}") #29186;今天的 feat(record-page): an empty field you can edit reads 「设置{字段名}」 and one click fills it; an editable value offers the copy icon #36385、feat(console): Change Owner on the record page, the list selection bar and the edit form (#35403) #36343 也都是这样)。请把 changeset 36286-palette-preview-create.md 和 PR 正文里的 Clause-②: no 都改成 Clause-②: yes (widening),并写明新增的 8 个键;changeset 里「No props or package exports change」这句可以保留,它本身是对的。这样声明面就要过一次 L2,请席位安排。只改文本,我做增量审核时只核这一行加 CI。

席位核对(本轮已读,增量时不重读)

  • 形态:l1-face --pr 36387:first-line 是 Part of #36286,并写明这是第一步、第 5 项留给第二个 PR,所以用 Part of 是对的;卡要保留 pm:dispatched。changeset 那一项的标记我清掉了:@object-ui/components 只改了两个 src/__tests__/ 测试,这个包的 files 是 dist、README.md、CHANGELOG.md、LICENSE,测试不会发布。读的时候 Check Changeset 还在跑(10:26 开始),其余 46 项 success。改动 20 个文件,+959 −11;check-governed-merges 判定 NOT governed。
  • 席位要我判断的读法:「新建为…」打开的是对象的新建页 /apps/APP/OBJECT/new?标题字段=输入的词,而不是列表上的新建弹窗。我认可这一读法,不算偏离卡面:卡上写的是「打开对应对象的新建表单,名称已填好」,验收写的是「回车后打开新建客户表单,客户名称已填好」,并没有要求弹窗。而且面板是全局的,不一定在列表页上打开;RecordFormPage 本来就会把 query string 读成新建预填(RecordFormPage.tsx:116–129),相关列表的「+ 新建」用的也是这条路。如果要改成在列表页上弹窗,需要改 AppContent 的 handleEdit,超出本 PR 的文件范围,dev 已在正文写明。
  • 一点提醒(不改判):右边详情只显示对象已声明的 highlightFields,没声明的对象只显示标题。这是 RecordPreviewCard 已有的规则,来自记录页「没声明就不挑」的裁决。卡上的验收「右边显示这家客户的行业、电话、邮箱」只有在那个「客户」对象声明了 key fields 时才成立。dev 在正文里写明了这一点;如果维护者是在自建应用「客户」上验收,席位最好事先确认那个对象有没有声明。
  • 实现读法:可新建的判断和列表的「新建」走同一套:resolveAffordance('listNew'),再加上新建动作在工具栏范围内的 visibleWhen(失败时关闭)和 disabledWhen(失败时放行);被灰掉的「新建」在面板里不出现。预填只写入 resolveNameField 解析出的字段,而且要求它是 text/textarea、不是只读、成员在新建时有写权限,这样输入的词一定能落到表单里。最多 3 行,当前页面的对象排第一。预览在选中项停留 150ms 后才读取记录,并丢弃已经过期的回答;45rem 以下靠容器查询隐藏右栏。
  • 文本:changeset 与 app-shell README 新增的那一段,逐句和 diff 一致(除第 1 项)。zh-Hans 的文案已核。
  • 测试证据:新文件 15 条用例,包括预览、下键只读停住的那条(findOne 依次是 C1、C2,没有多读)、容器查询、没命中时不显示右栏、新建行的顺序、无权限对象不出现、清空后新建行消失、回车提示,以及 visibleWhen/disabledWhen 和标题字段可写这两条判断。截图三张(搜到、搜不到、「新建」)已附在正文,另有英文版。这些用例我没有在本地重跑,读的是报告和 CI。
  • 落地条款:非受管;本项改完后做增量 L1,加上声明面 L2,之后由区 ready + auto-merge;Part of ⇒ 卡保留 pm:dispatched。

…ening

The eight console.commandPalette keys are new published language-pack
keys, so Clause-② is yes (widening), not no.

Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ

Final head for delta L1 + L2 · area f7-shell · 2026-11-22T10:59Z
Head-sha: dcb510f0a1686a61a0b35fdfb71698c281f97a5f

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 ACCEPT(增量)· head dcb510f0a1686a61a0b35fdfb71698c281f97a5f · 2026-11-22T11:03Z

维护者速读

席位核对(增量,只核 a17d2c75..dcb510f0 加 CI)

  • 本轮的 diff:一个提交,只改 .changeset/36286-palette-preview-create.md 的一行;代码、测试、README 与上次审核的 head 逐字相同,上一轮的读法(包括「新建为…」打开新建页这一读法)照旧有效。
  • 第 1 项已改好:changeset 和 PR 正文都写成 Clause-②: yes (widening),点名的 8 个键 create、createAs、previewEmpty、enterOpenRecord、enterCreate、enterSwitchApp、enterApplyTheme、enterOpen 与 en 包里新增的 8 个键逐个相同。readClause2Line 读这一行得到 {value:'yes', arm:'widening'},我在本机核过。Metadata-protocol: none 不变,仍然属实;「No props or package exports change」这句也仍然属实。声明面的 L2 由席位在跑。
  • CI @ dcb510f0:47 success · 15 expected skip · 0 failed · 0 pending;mergeable_state clean。
  • 落地条款:非受管;席位的 L2 PASS 后,由区 ready + auto-merge;Part of #36286,所以卡保留 pm:dispatched。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: TIER_DEFAULT
Head-sha: dcb510f0a1686a61a0b35fdfb71698c281f97a5f
Local-runs: none

Inputs read: card #36286 body and all six comments (triage, claim with its Clause-② amendment, both os-dev-reports), PR #36387 body and its three comments (final-head notes for a17d2c7 and dcb510f, L1 REWORK 7077829267), the 20-file list, the net diff against main (merge base ed33f8a), and the check-runs on this head. Check-runs: 47 success, 15 skipped, 0 failure, none pending. The skipped runs are the usual path-filtered and opt-in jobs.

① Derived judgments

  • Published language packs, right. @object-ui/i18n gains eight keys under console.commandPalette: create, createAs, previewEmpty, enterOpenRecord, enterCreate, enterSwitchApp, enterApplyTheme, enterOpen. Each of the eleven packs gets all eight. No existing key or English value changes. The built d.ts types each key as a literal, so this is a widening of a published surface.
  • The packs carry real translations, right. ar, de, es, fr, ja, ko, pt-BR, ru and zh-Hans each hold their own wording, with the locale's own quote marks around the query in createAs. zh-Hant is the gen:zh-hant output of zh-Hans, as the repo generates it. The de quote-pair pin moves to 124 for the one new pair. The i18n gates and the i18n test shards are green on this head.
  • @object-ui/app-shell public surface, right. No package export and no prop changes. paletteCreate.ts, PalettePreviewPane.tsx and PaletteEnterHint.tsx are not re-exported from the package entry. The package exports map is unchanged.
  • Create door, right. The palette adds no new way to create. A create row navigates to the existing /apps/APP/OBJECT/new route, which RecordFormPage already serves and already reads as a query-string prefill (the related-list New uses the same route). The save goes through that page's normal create path, and the server still checks the create grant. Nothing can be created that could not be created before.
  • Create permission check, right. paletteMayCreate calls resolveAffordance('listNew', ...) with the same object definition, the same usePermissions() reader and the same inputs that ObjectView passes for its New button. It then binds the create action's toolbar visibleWhen (fails closed) and disabledWhen (fails soft, declared-ness outside the eval) with no record, exactly as useObjectViewToolbarAffordances does through useRowPredicate. evalRowPredicate treats a null row and an empty row the same way. In the app shell the palette and ObjectView sit under the same ExpressionProvider, so the predicate scope matches. The objects offered are the app's navigation objects after the member nav gates. The test file pins an object without a create grant as never offered.
  • Prefill accept-set, right. The prefill writes only the title field from resolveNameField, and only when it is a text or textarea field, not readonly, that resolveFieldAffordance('createFormFields', ...) lets the member write. The value is URL-encoded with URLSearchParams. The typed words render as a React text node with escapeValue: false, so they are not read as markup.
  • Preview read path, right. The pane reuses RecordPreviewCard unchanged. It reads the record by id through the palette's own dataSource.findOne, the normal data path the server enforces. Its $expand list keeps only reference fields that perms.checkField(..., 'read') allows, and it draws only the object's declared highlightFields. A failed read draws one cause-free state. The pane only previews records the search already returned to this viewer.
  • Layout, right. The wide cap reads DIALOG_VIEWPORT_GUTTER and the palette is listed in the gutter census WIDE_SITES. The ui/packages/components change is a test file only, and that package publishes dist, so it needs no changeset entry.

② Semver level

  • Changeset .changeset/36286-palette-preview-create.md: @object-ui/app-shell patch and @object-ui/i18n patch. These are the two packages whose published files move. Right.
  • Clause-②: yes (widening) is right. The eight new pack keys are a widening of a published typed surface, and nothing narrows. The line sits at line start in both the changeset body and the PR body, and names the eight keys.
  • Metadata-protocol: none is right. Nothing a metadata author can write changes. The palette reads the existing highlightFields, userActions.create and title-field ladder.
  • AGENTS.md (Post-Task Checklist 3): a non-protocol change, widening or breaking, ships patch, and none takes patch. Patch on both packages matches. The change is not breaking, so no ADR-0087 marker or migration is owed. Check Changeset and the ADR-0087 registration gate are green on this head.
  • The L1 REWORK 7077829267 item (Clause-② no to yes) is done in both the changeset and the PR body. The claim on the card carries the amendment.

③ Boundary flags

  • Open question, palette create opens the /new page or the list's modal. Answered: keep the /new page (option A). L1 already accepted this reading, and I agree. The card asks that Enter opens the create form with the name filled, which the page does. The palette is global, so it is often not on a list page. A modal would need new wiring in AppContent, outside this claim.
  • Open question, the PR-body replacement lines. Answered: the PR body now carries both lines as given.
  • Dev flag, key fields are the declared highlightFields only. Escalated as a note for the seat, not a code finding. This is RecordPreviewCard's existing rule. The dev's survey says no shipped account or 客户 object declares industry, phone and email together. So the card's acceptance line holds only on an object that declares those fields. The seat should check this on the object the maintainer will accept against before handing it over.
  • Dev flags, the README paragraph outside the claimed surface (the ui docs rule), the screenshot orphan ref, and the signature line position. Accepted as stated.
  • Dev flag, the textual overlap with open PR fix(console): Shared in Add view only for administrators who can write it, and published at once (#36409) #36398 on the de quote-pair pin. Accepted. Whichever PR lands second takes a one-line bump. No change is needed here.
  • Reviewer note, not graded. The Home palette binds an empty features and app scope, unlike the app shell. A create action whose toolbar disabledWhen reads those keys would fail soft there and could be offered on Home where the list would grey it. visibleWhen still fails closed, the grant check is unchanged, and the target route already exists, so no permission widens. It only qualifies the changeset's "exactly where its list offers New" in that edge case.
  • SQL push-down. Clean. There is no new id materialisation and no in-app join. The preview is one by-id findOne with server-side $expand, and only once the selection rests 150 ms. A reason is given for not reusing the row the hit already carries: the card needs lookups expanded to names. The create rows read metadata and permissions only.
  • Security: none found.

No must-fix, no should-fix.

Implemented-by: claude/issue-36286-palette-preview-create
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Landing (seat 7, 2026-11-22T11:07Z): head dcb510f0a1686a61a0b35fdfb71698c281f97a5f · L1 ACCEPT 7078189965 (L1-d, delta after REWORK 7077829267) · L2 PASS 7078238047 (TIER_DEFAULT, declaration face, no must-fix or should-fix) · check-governed-merges --pr 36387: NOT governed, 970 changed lines ≤ 3000 · CI on the head: 47 success, 15 skipped, none failed. → pr_ready + automerge_enable (merge queue).
This is step 1 of #36286 (to-do items 1 to 4); item 5, the "current page" group, follows in a second PR on the same card. Noted for the acceptance check: the preview shows an object's declared highlightFields, and no shipped account object declares industry, phone and email together, so that line holds on an object that declares them.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 11:08
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit e8b494a Nov 22, 2026
63 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36286-palette-preview-create branch November 22, 2026 11:28
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…e it, and published at once (objectstack-ai#36409) (objectstack-ai#36398)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCxiFE11rsKwyNffJZKYqJs)_

Fixes objectstack-ai#36409

Clause-②: yes (widening)
Metadata-protocol: none

## 维护者速读

-
列表视图下拉的「添加视图」里,「共享」这个选项现在只给真正能保存共享视图的管理员;组织管理员以前能看到这个选项,点了却被服务器拒绝,现在不再显示。管理员新建的共享视图保存后立刻对所有人可见,不用另外发布。打开的视图如果已经不存在,会提示一次,然后显示默认视图。
-
属于「列表专题」,按维护者定的规则「只有管理员可以在前端界面创建共享视图」和「保存即生效」;把已有视图设为共享或取消共享,维护者说暂时不考虑,本
PR 不做。
- 若出错,影响的是管理员新建共享视图这一步:保存被拒时会提示原因,不会发布任何东西;本改动可以整体撤回,已存的视图不受影响。
- 无

## What changes

objectstack-ai#36371 closed as not planned: the rule it asked for already holds
(correction 7077377066), and sharing or unsharing an existing view is
not wanted now. Building it measured three real faults at `origin/main`
3faabd2, which objectstack-ai#36409 files; this PR fixes those three and nothing
else. The 「设为共享」 / 「取消共享」 row actions an earlier head carried are gone
(code, keys, tests, docs).

- **The server refusal already holds.** A shared view is `view` metadata
written through `PUT /api/v1/meta/view/:name`; that door, the publish
and the delete refuse any caller without `manage_metadata`
(`metaSaveVerdict`, ADR-0066 D1), answering `403 FORBIDDEN`. No server
code changes; the refusal is pinned with the shipped permission sets
(below).

1. **Who is offered Shared** (`mayShareViews`,
`objectViewViewSharing.ts`): an administrator whose session holds
`manage_metadata` (`useCanAuthorMetadata`). Add view used to ask
`isAdmin` alone, which is true for an organization administrator, who
does not hold the capability: they were offered Shared and the save
answered `403`.
2. **Shared at once.** A view created Shared used to be saved as a draft
(ADR-0034), invisible to everyone until someone published it. It is now
saved and published in one act through the door objectstack-ai#35955 uses
(`saveAndPublishRuntimeMetadata`, ruling record 7058616478, the
maintainer's 「保存即生效」). That helper now saves a new view into the app's
package when the caller passes the app, as `createRuntimeMetadata` does
(objectstack#35624); existing callers pass none and are unchanged. A
refused save publishes nothing.
3. **A view that is gone.** A reader whose address names a view the
server answers `not_found` for is told so once, and the list shows its
default view, as it already did silently. `useMetaItemRefusal` gains
`absent` for that verdict.

Two new `@object-ui/i18n` keys under `view.switcher` (`shareNameTaken`,
`viewGone`) in every pack (zh-Hant regenerated), so `Clause-②: yes
(widening)`. `content/docs/ui/views.mdx` gains a Shared views paragraph.
No published skill describes this surface (`git grep` of `skills/` for
My views / shared view: zero hits), so no `Skills-docs:` line is owed.

Not done here: 「设为共享」 / 「取消共享」 on existing views (not now, per the
maintainer), saving into a shared view (objectstack-ai#35955 step 2), the Manage views
page.

## Tests

- `packages/rest/src/meta-write-door-capability-enumeration.test.ts`,
new describe `objectstack-ai#36409`: with the systemPermissions the shipped sets grant
(`securityDefaultPermissionSets`), a member (`member_default`) and an
organization administrator (`member_default` + `organization_admin`) are
refused the view's save, publish and delete `403 FORBIDDEN` with the
protocol never reached; the control, `admin_full_access`, reaches all
three.
- `ui/packages/app-shell/src/views/objectViewViewSharing.test.tsx`
(new): who is offered Shared (an administrator holding
`manage_metadata`; neither half alone); Create shared saves with the
first-write pin and publishes, then opens the view; a refused save is
said, reported unsaved, and publishes nothing; a name an unpublished
draft already holds is said (`shareNameTaken`) and nothing is published,
refreshed or opened.
-
`ui/packages/app-shell/src/views/runtime-metadata-persistence.saveAndPublishIntoApp-36409.test.ts`
(new, a real `MetadataClient` over the package doors' measured bodies):
with an app, a writable app package is named on the save; an installed
one gets the pair the ensure door returns; an unlisted one, `packageId:
null` or no app gets none; the publish and a refused publish's discard
name no package (ADR-0146 D8); a `dashboard` call ignores the app and
asks no package door.

### Readings at head b09dc55 (main ff60149 merged); `65544511` adds
the two pins

- `objectViewViewSharing.test.tsx` 3/3; `@object-ui/i18n` with the
switcher, sharing, in-place-create and census tests: 110 files, 2,032
passed; every `ObjectView*` test with `runtime-metadata-persistence`,
the census, the switcher, the sharing and in-place-create tests: 114
files, 1,021 passed. `meta-write-door-capability-enumeration.test.ts`:
72 passed.
- Ablation: `mayShareViews` reduced to `return isAdmin;` turns the
organization-administrator test red (1 failed / 2 passed); restored,
green.
- Derived gates (`dispatch-gates.mjs --ran`): 96 derived, 94 run, 2 NOT
MEASURED, 0 unrun. NOT MEASURED (prerequisite exit 3), left to CI:
`check-plugin-teardown-shape --self-test` (shallow-clone fixture) and
spec `check:skill-examples` (needs client-react declarations). `ui
vitest run scripts/`, spec `check:docs` and `check:dts-closure` were red
only until `@objectstack/spec` was rebuilt with declarations after the
main merge, then green. `check:dual-build-cjs-loads` stays red on this
container's tree alone: 75 findings, each a `.d.ts`/`.d.cts` of a
package this PR does not touch (`core`, the drivers, …) never emitted
here; CI's build is its reading.
- `overlap-check.mjs`: clean against main and every open PR head.
- At `65544511`: the new package pins 5/5 and the sharing test 4/4;
`runtime-metadata-persistence*` 8 files, 63 passed. Ablations:
`saveAndPublishRuntimeMetadata` reading `ctx.app` for every type turns
the dashboard pin red; resolving no package turns the four view pins
red; `publishNew` ignoring `'pending-draft'` turns the `shareNameTaken`
pin red; each restored, green. The test-reading gate families (27)
re-run at this tree: green but the one NOT MEASURED above.

## Acceptance notes

- **Organization administrators elsewhere on the list page: objectstack-ai#36448.**
Manage views, the view settings panel and the Create View dialog still
gate on `isAdmin` alone, so an organization administrator without
`manage_metadata` is still offered those and refused by the server. This
PR narrows only the Shared choice objectstack-ai#36409 names; objectstack-ai#36448 carries the rest.
- **Organization administrators** were not driven live: the showcase
seeds no organization-administrator persona. Their gate is the unit pin
above and the server's `403` pin.
- **The de quote-pair count pin** (`de-quote-pairing-3876.test.ts`) is
no longer touched: the dropped German strings were the ones with quotes,
so objectstack-ai#36387 owns that pin alone.

## Screenshots

Taken at `a0dfe1a4` in a live Console (`ui/apps/console` Vite against
`examples/app-showcase` `objectstack dev --seed-admin`), 1400×900 at 2×,
two accounts: the dev administrator `admin@objectos.ai` and the seeded
member persona `auditor.demo@example.com`, on Projects. That head still
carried the dropped row actions; the shots below show only what this PR
keeps, which the slimming did not change. The files are kept with the
project, named here as they are attached there.

- `a2-admin-addview-shared.png`: administrator, Add view with **My views
/ Shared**, Shared chosen, the hint under it. Created, it opened at once
as `showcase_project.key_projects`.
- `m1-member-menu.png`, `m2-member-addview.png`: the member, opening
that view by its address, finds it under Shared views straight away (no
publish step), and Add view has no My views / Shared choice.
- `m3-member-view-gone.png`: the member reloads the address of a view
that was removed: 「The view you opened is no longer available, so the
list shows its default view.」 over All Projects.

## Verification

Two-minute check: as a platform administrator, open a list's view
dropdown, Add view, choose Shared and create; sign in as a member and
open the list: the view is under Shared views at once, and Add view
offers no Shared choice.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jTPMb2q2wRssyREqhQ)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jTPMb2q2wRssyREqhQ -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants