Skip to content

fix(app-shell): the command palette offers create-as only for the page's own object, when the query finds nothing else - #39116

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-39038-palette-create-as
Dec 2, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-39038-palette-create-as

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread
Fixes #39038
Clause-②: no
Metadata-protocol: none
Ruling-ref: maintainer ruling recorded as comment 7340468629 on the card, option A — 「A 只给当前页对象」: a create-as row shows only for the current page's object, and only when the query finds nothing else.

维护者速读

  • 管理员和用户在 ⌘K 里输入词时,「新建『输入的词』为…」只在对象列表或记录页出现,而且只针对当前这个对象;搜到页面或其他条目时不再出现。系统设置里搜「邮件」「时区」「审计」不再冒出「新建为业务单元/共享规则/队列」。
  • 属于「系统设置导航两层十组」专题的第一行(⌘K 能搜到设置页并去掉无意义的新建行),这是该行的第二部分,前一部分已合并。
  • 若出错,最坏是某个对象页上该出现的「新建为…」没出现,用户仍可用列表的新建按钮或输入「新建」;可直接撤回。
  • 无。

What changes

Per the ruling (option A), the second half of the card: the "Create 'words' as OBJECT" rows.

  • paletteCreate.ts: new paletteCreateAsTargets(targets, currentObjectName, queryFindsEntry). A create-as row is offered only for the object of the page the palette was opened on (routeObjectName: its list, a named view, a record page), when the member may create one seeded with the words, and never while the query finds an entry of its own. CREATE_AS_MAX (three rows, any page) is deleted; it had no other user.
  • CommandPalette.tsx: queryFindsEntry is true when the query found a navigation entry of any type (including the component/url entries from the first half), an app report, an app to switch to, a theme or full-search command, or a "New OBJECT" entry. The route object is read once and fed to both the create targets and the create-as rule.
  • Unchanged: the "New OBJECT" entries (found by "new" or an object's name, every creatable object of the app), record hits, the preview pane.
  • Off an object's page (an app home, a dashboard, Setup's overview) no create-as row is offered: CRM home loses its create-as rows, as the ruling states.

Tests

  • CommandPalette.setupPages-39038.test.tsx, new describe: on Setup's dashboard 时区, 邮件, 审计 show no create row; on a business-unit list 华东区 offers exactly 「Create "华东区" as 业务单元」; on that list 邮件 finds 邮件投递 and offers no create row; CONTROL: 业务单元 still finds 「New 业务单元」.
  • Same file, the first review's optional nit: a _self url entry with an https:// address opens through window.location.assign, not window.open, and the router location does not move.
  • CommandPalette.previewCreate-36286.test.tsx: the three assertions the earlier create-from-typed-text card pinned are rewritten to the ruling, none deleted: on the Customer list 'Zhang San' offers create as customer only (was customer and contact); on /apps/crm it offers no create row (was contact and customer); 'contact' on /apps/crm offers create new contact and no create-as (was create as customer). One CONTROL added: on the Customer list 'contacts' finds the Contacts entry and no create-as row. The earlier card's own acceptance (on the Customer list an unknown name offers 新建『某某』为客户, Enter opens the form seeded) still holds.

Ablation, one run: CommandPalette.tsx and paletteCreate.ts restored to origin/main 4b8a67d, with the scheme branch of openNavEntry disabled → 7 of 52 red across the two files (the scheme pin, the two create-row cases of the new describe, the three rewritten assertions and the new CONTROL); restored with git restore --source=HEAD --staged --worktree, status clean.

Readings

All under bash scripts/pm/os-verify-lock.sh, head 1f5a644e, verdict lines quoted.

  • cd ui && pnpm exec vitest run --maxWorkers=2 packages/app-shell/src/chrome/ → Test Files 30 passed (30), Tests 213 passed (213), VERDICT command-exit 0.
  • pnpm --filter @object-ui/app-shell run type-check (tsc --noEmit and tsc -p tsconfig.test.json) → VERDICT command-exit 0.
  • Ablation run → Tests 7 failed | 45 passed (52).

Acceptance notes

  • This PR carries the finished change from the backup branch claude/issue-39038-palette-setup-pages-wip (change commit 946592b4, cherry-picked onto origin/main, byte-identical to that branch's tip for the four palette files), plus the scheme pin and this changeset.
  • doc and action navigation entries still do not count as entries the palette finds (it does not match them at all, as before) — noted in the first half, not filed.

Verification

Read first (by risk): paletteCreateAsTargets in paletteCreate.ts (the whole rule); the queryFindsEntry list in CommandPalette.tsx (which finds suppress the row); the three rewritten assertions in CommandPalette.previewCreate-36286.test.tsx.

Two-minute check: OS_PORT=3000 pnpm dev, open Setup, press ⌘K and type 时区: no 「新建…为…」 row. Open a business-unit list, press ⌘K and type a new name: one row, 「新建「…」为业务单元」.

Gates

node scripts/pm/dispatch-gates.mjs --commands derived 38 commands on tree 1f5a644e; each run with its exit code captured before any pipe; --ran → Run reconciliation — 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN. All 38 exit 0 (check:query-options-erasure first stopped by my own 300 s timeout, re-run alone → exit 0 in 393 s). pnpm --dir ui exec vitest run --maxWorkers=2 scripts/ → Test Files 172 passed | 2 skipped (174). overlap-check → VERDICT clean exit 0 against origin/main 634c598 (5 newer commits, none in the touched files). Type-check lanes, artifact rosters and the repo-wide lint are CI's.


🤖 Generated with Claude Code

https://claude.ai/code/session_01WGufzeZMKeDN64azVSgNLF

…he page's own object, and not when the query finds an entry

Claude-Session: https://claude.ai/code/session_01WGufzeZMKeDN64azVSgNLF
Co-authored-by: Claude <noreply@anthropic.com>
… a scheme; changeset

Claude-Session: https://claude.ai/code/session_01WGufzeZMKeDN64azVSgNLF
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 2, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzeZMKeDN64azVSgNLF

2026-12-02T10:34Z · Final green head for L1: 1f5a644e (every check run success or expected skip: 38 success, 15 skipped; mergeable clean). Zone osa-setup asks osa-L1-a for the L1 read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

L1 review — ACCEPT on 1f5a644e7f0c71c1e0a5fe4980624566e0c4ff5f

CI: 38 success, 15 expected-skip, 0 failed; mergeable_state clean. Not governed, 171 lines; l1-face clean. No L2 is owed: @object-ui/app-shell is private, Clause-②: no, and no governed path moves.

Verified on the tree, against maintainer ruling 7340468629 (option A):

  • Only the page's object. paletteCreateAsTargets returns nothing off an object's page and nothing while queryFindsEntry holds. Otherwise it keeps only the route object's target that has a prefillField, so the permission and prefill ladder in paletteCreateTargets is unchanged. routeObject is computed once and feeds both reads. CREATE_AS_MAX is gone and nothing else imports it.
  • "Finds nothing else" is every list the palette draws for the query: the "New OBJECT" rows, object, dashboard, page, report and address (component/url) entries, the app's reports, apps, theme commands and the full-search command. Each one is the query-matched list, not the raw navigation. Record hits do not count. That matches the changeset's list (entries, reports, apps, commands, "New") and 搜索面板(⌘K):搜到记录时右边显示详情,搜不到时可以直接新建,能搜到「新建客户」这类动作 #36286's "below the results" placement, where a record named like the words does not stop the member from creating another. I read the ruling's "nothing else" as entries, and the changeset says the same.
  • The 搜索面板(⌘K):搜到记录时右边显示详情,搜不到时可以直接新建,能搜到「新建客户」这类动作 #36286 rewrites (amendment 7340607671). There are three: the customer page offers only create as customer; /apps/crm offers none, read after a 400 ms settle, so an empty list is not a race; and "contact" on /apps/crm keeps its "New" row with no create-as. The new CONTROL checks that on an object's page, words that name an entry ("contacts") offer no create-as row. The Setup cells pin the case the card filed: 邮件 / 时区 / 审计 on Setup's overview, plus a business-unit page.
  • The fix(app-shell): the command palette finds Setup's component and url pages #39091 nit. A _self url entry with a scheme goes through location.assign. The test pins that it neither calls window.open nor moves the route. Test only: the code path was already on main.
  • Changeset. Each sentence is true against the code: the page's object, the entry list, off-page none, and "New OBJECT" unchanged.

Relation. Fixes #39038, the create-as half. The Setup-pages half is already merged in #39091, so merging this delivers the rest of the card. Not Tier H: the zone lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzeZMKeDN64azVSgNLF

Landing · 2026-12-02T10:36Z · zone osa-setup

  • L1 ACCEPT 7342718157 (osa-L1-a) on head 1f5a644e7f; the head has not moved. No L2 owed: app-shell private, Clause-② no, no governed path.
  • check-governed-merges.mjs --pr 39116: NOT governed, 171 changed lines ≤ 3000.
  • Checks: 38 success, 15 expected skip, 0 failed; mergeable clean. landing-k.mjs: can't answer (no Test Core shard ran on this ui-only diff); first-parent count from merge-base to main is 8 (< 15); no locale pack, no skills/**, no generated artifact, so neither K leg applies.
  • Ready, then auto-merge; the merge queue lands it. Fixes #39038: with fix(app-shell): the command palette finds Setup's component and url pages #39091 (nav half, merged) this delivers the whole card. The backup branch claude/issue-39038-palette-setup-pages-wip (@7e144525) is wholly inside this PR; the zone deletes it after MERGED.

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 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.

Console command palette finds no Setup page: searching 邮件, 时区 or 审计 returns only nonsensical quick-create rows

2 participants