Skip to content

feat(console): the ⌘K palette's Current page group offers Add view and Edit - #36711

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-xw2xoc
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-xw2xoc

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

Fixes #36286
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户在列表页按 ⌘K,「当前页面」组里多了「新建视图」,回车直接打开视图切换器的新建卡片;在记录页按 ⌘K 多了「编辑」,回车等同点页面右上角的编辑按钮。
  • 属于外壳专题(去掉顶栏那一层)里搜索面板这张卡的最后一项,做完这张卡就关闭。
  • 面板里的这两行完全跟着页面上的按钮走:按钮不出现它就不出现,按钮变灰它也变灰并写明原因;出问题只影响这两行,撤回本 PR 即恢复原样。
  • 无。

What changes

The empty ⌘K palette's "Current page" group (its favorites row landed earlier) now carries the page's own main entry:

  • On an object's list: "Add view". Listed exactly where the view switcher offers "Add view". Enter opens the switcher on its in-place create card; for a host whose switcher offers only the Create View dialog, it opens that dialog. Opened the switcher's own way afterwards, the dropdown shows the views again.
  • On a record page: "Edit". The header's own sys_edit entry: Enter runs its onClick (the record form, or the page's edit state where the page draws body tables). It is listed off exactly when the header's button is off (userActions.edit.disabledWhen, the state lock, a live inline draft the header greys Edit for), with the header's reason under it. An approval-locked record, a record already in its edit state and a record in a drawer or pane over a list list no Edit row, because the page draws no Edit there (or the page behind the palette is the list).
  • The footer names what Enter does ("Add view ↵", "Edit ↵"), in the controls' own words. No new locale keys: both rows reuse the controls' labels (view.switcher.addView, detail.edit).

How: nothing is recomputed in the palette. The page publishes the command beside the control that runs it, for as long as it draws that control (usePublishPageCommand, new chrome/paletteCommands.ts, a module store like advertisedShortcuts), and the palette lists what is published. ObjectViewTitleSwitcher publishes "Add view" under the same condition its footer button is drawn (create || onAddView); RecordDetailView publishes the header's sys_edit entry through PublishRecordEditCommand (new views/recordPaletteEdit.tsx), mounted inside the page's InlineEditProvider so the inline-draft greying is read where the header reads it. ObjectViewSwitcherMenu gains an optional startOnCreate prop (package-internal, not exported). This is the route the card's release comment recorded (seat 2: pages advertise their own command and verdict; the palette lists them).

Tests

  • Palette harness (CommandPalette.previewCreate-36286.test.tsx), new top-level describe, 10 tests, over the real CommandPaletteProvider with the real ObjectViewTitleSwitcher and the real PublishRecordEditCommand in an InlineEditProvider: row order and selection, Enter opens the switcher on the create card; dialog-only host runs onAddView; CONTROL no row when the switcher offers no Add view; Edit runs the entry's handler; an off Edit is listed off with its reason and does nothing; a live inline draft turns it off; CONTROL a draft leaves it on where the header does; withdrawn when the page stops drawing it, and never listed on the wrong kind of page; footer kinds.
  • RecordDetailView.harness.test.tsx, new block RecordDetailView.paletteEdit-36286 (4 tests) over the real record page: the page publishes Edit and running it calls the same onEdit the header button calls; off exactly when the header button is off (edit.disabledWhen holds); CONTROL a predicate that does not hold leaves both on; CONTROL an embedded record publishes nothing.
Runs at d8c8135
  • vitest run of packages/app-shell/src/chrome/ + the RecordDetailView harness + objectViewTitleSwitcher (2 files), inPlaceViewCreate-35553, ObjectView.titleViewSwitcher-27594, RecordDetailView.phoneFace-27058, .favoritesEntry-12427, .headerActionGates, .drawerLevelEdit-33111 under the verify lock: Test Files 38 passed (38), Tests 398 passed (398), VERDICT command-exit 0 (at 27f5347; the last commit touched only the palette harness's imports, re-run there: 37 passed).
  • pnpm --filter @object-ui/app-shell type-check (tsc --noEmit + tsconfig.test.json): VERDICT command-exit 0.
  • Ablation 1, scripts/ablation-replace.mjs on recordPaletteEdit.tsx, the disabled: verdict replaced with disabled: false: 3 failed (the disabledWhen, off-with-reason and inline-draft tests), restored blob 282bf9e8 equals HEAD.
  • Ablation 2, setStartOnCreate(true) deleted from objectViewTitleSwitcher.tsx: 2 failed (the two create-card tests), restored blob c9b9cf65 equals HEAD. Source-resolved relative imports, no dist leg.

Acceptance notes

  • The card's acceptance lines for step 2 read "列表页上是收藏这个视图、新建视图;记录页上是收藏这条记录、编辑". The favorites rows landed earlier; this PR adds the other two, so it closes the card.
  • Row words are the controls' own ("Add view", "Edit"), as the favorites rows reuse the menu's words; Attio's "New view" wording would need two new keys, not added.
  • An authored record page that draws no page:header still publishes Edit, as the header entry is built for every face; I found no such page in the examples.
  • The phone's palette is out of the card's scope and unchanged; the switcher's phone sheet takes the same startOnCreate, adjusted during render so a kept-mounted body is asked again.

Verification

Two-minute check: run the showcase, open Accounts, press ⌘K, ArrowDown to "Add view", Enter: the view switcher opens on its create card. Open any account, ⌘K, ArrowDown to "Edit", Enter: the page enters its edit state (Cancel / Save in the header), as the header's Edit does.

Browser run (showcase on its own --fresh backend + console vite, Playwright Chromium 1440x900, signed in through /login): list page group rows favorite-add, view-add; footer "Add view ↵"; after Enter the palette is closed, the switcher menu and create-view-card are present. Record page group rows favorite-add, record-edit; footer "Edit ↵"; after Enter the header shows Cancel and Save. Four screenshots are attached to the project thread (GitHub's image store takes browser uploads only), not committed.

Gates at d8c8135: dispatch-gates --commands derived 38 families; all 38 run, each exit 0 (pnpm --dir ui exec vitest run scripts/ was OOM-killed on the first pass beside the dev servers and re-run under the lock: Test Files 172 passed, 2 skipped; check:test-source-alias went red on the first pass and is fixed in d8c8135); --ran reconciliation 38 derived, 38 run, 0 NOT-MEASURED. ESLint on the changed source files: 0 errors. check:new-line-citations: 0 new. overlap-check: VERDICT clean (origin/main and #36629, which shares RecordDetailView.tsx, merge cleanly).

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. (not touched)
  • 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 by Claude Code

@github-actions github-actions Bot added size/l 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 Nov 23, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

维护者速读

按 ⌘K 打开命令面板、什么都不输入时,「当前页」一组现在多了页面自己的主操作:在对象列表上是「添加视图」,在记录页上是「编辑」。它们执行的就是页面上那个按钮本身的动作;按钮被禁用时,这里也显示为禁用并给出同样的原因。属于 ux 专题卡的最后一项。
要你做的:无。

席位核对 — ACCEPT (L1) · repo:objectstack#1 · head d8c8135b · 2026-11-23T13:31Z

  • Shape: Fixes #36286 (item 5, the rows left after release 7084319518). ui/packages/app-shell: a module store chrome/paletteCommands.ts (usePublishPageCommand / usePageCommands), the Current page rows in PaletteCurrentPage.tsx, the Enter hint, recordPaletteEdit.tsx, the list's view switcher (startOnCreate, internal prop), RecordDetailView.tsx, README and tests; @object-ui/app-shell patch changeset. Clause-②: no (nothing reaches the package index, no new i18n keys). Metadata-protocol: none. Not governed.
  • Read: pages publish their command beside the control while they draw it, with the control's own handler and verdict, so the palette recomputes nothing. "Edit" is off exactly when the header's Edit is off (a holding disabledWhen, the state lock, a live inline draft) and shows the header's reason; a record locked by an approval, one already in its edit state, or one in a drawer/pane over a list gets no Edit row. "Add view" opens the switcher on its create card, or the Create View dialog on a dialog-only host.
  • Evidence (thread): 398/398 targeted tests; two ablations red as expected (Edit verdict forced off: 3 red; create-card open removed: 2 red); app-shell type-check green; 38/38 derived gates exit 0; overlap-check clean (incl. feat: an object's action layout per scope, pinned and more, set from the design mode (#36366) #36629 on RecordDetailView.tsx); browser on showcase, 4 frames in project files.
  • Gates: 52 check-runs on d8c8135b: 39 success, 13 skipped, 0 failed. K = 8 behind main (< 15).
  • Landing: ready + auto-merge now. On merge, 搜索面板(⌘K):搜到记录时右边显示详情,搜不到时可以直接新建,能搜到「新建客户」这类动作 #36286 closes and the seat clears its label.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 13:31
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit e5213e7 Nov 23, 2026
53 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-xw2xoc branch November 23, 2026 13:51
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 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.

搜索面板(⌘K):搜到记录时右边显示详情,搜不到时可以直接新建,能搜到「新建客户」这类动作

2 participants