Repository navigation
feat(console): the ⌘K palette's Current page group offers Add view and Edit - #36711
Merged
Merged
Conversation
…and README (#36286) Claude-Session: https://claude.ai/code/session_01JQwxbXBGc8PQRp6Q7TM7EU Co-authored-by: Claude <noreply@anthropic.com>
…ork (#36286) Claude-Session: https://claude.ai/code/session_01JQwxbXBGc8PQRp6Q7TM7EU Co-authored-by: Claude <noreply@anthropic.com>
…oads at import Claude-Session: https://claude.ai/code/session_01JQwxbXBGc8PQRp6Q7TM7EU Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj 维护者速读按 ⌘K 打开命令面板、什么都不输入时,「当前页」一组现在多了页面自己的主操作:在对象列表上是「添加视图」,在记录页上是「编辑」。它们执行的就是页面上那个按钮本身的动作;按钮被禁用时,这里也显示为禁用并给出同样的原因。属于 ux 专题卡的最后一项。 席位核对 — ACCEPT (L1) · repo:objectstack#1 · 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.
Requested by Warren · project thread
Fixes #36286
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
The empty ⌘K palette's "Current page" group (its favorites row landed earlier) now carries the page's own main entry:
sys_editentry: Enter runs itsonClick(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).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, newchrome/paletteCommands.ts, a module store likeadvertisedShortcuts), and the palette lists what is published.ObjectViewTitleSwitcherpublishes "Add view" under the same condition its footer button is drawn (create || onAddView);RecordDetailViewpublishes the header'ssys_editentry throughPublishRecordEditCommand(newviews/recordPaletteEdit.tsx), mounted inside the page'sInlineEditProviderso the inline-draft greying is read where the header reads it.ObjectViewSwitcherMenugains an optionalstartOnCreateprop (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
CommandPalette.previewCreate-36286.test.tsx), new top-level describe, 10 tests, over the realCommandPaletteProviderwith the realObjectViewTitleSwitcherand the realPublishRecordEditCommandin anInlineEditProvider: row order and selection, Enter opens the switcher on the create card; dialog-only host runsonAddView; 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 blockRecordDetailView.paletteEdit-36286(4 tests) over the real record page: the page publishes Edit and running it calls the sameonEditthe header button calls; off exactly when the header button is off (edit.disabledWhenholds); CONTROL a predicate that does not hold leaves both on; CONTROL an embedded record publishes nothing.Runs at d8c8135
vitest runofpackages/app-shell/src/chrome/+ the RecordDetailView harness +objectViewTitleSwitcher(2 files),inPlaceViewCreate-35553,ObjectView.titleViewSwitcher-27594,RecordDetailView.phoneFace-27058,.favoritesEntry-12427,.headerActionGates,.drawerLevelEdit-33111under 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.scripts/ablation-replace.mjsonrecordPaletteEdit.tsx, thedisabled:verdict replaced withdisabled: false: 3 failed (the disabledWhen, off-with-reason and inline-draft tests), restored blob 282bf9e8 equals HEAD.setStartOnCreate(true)deleted fromobjectViewTitleSwitcher.tsx: 2 failed (the two create-card tests), restored blob c9b9cf65 equals HEAD. Source-resolved relative imports, no dist leg.Acceptance notes
page:headerstill publishes Edit, as the header entry is built for every face; I found no such page in the examples.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
--freshbackend + console vite, Playwright Chromium 1440x900, signed in through/login): list page group rowsfavorite-add,view-add; footer "Add view ↵"; after Enter the palette is closed, the switcher menu andcreate-view-cardare present. Record page group rowsfavorite-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 --commandsderived 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-aliaswent red on the first pass and is fixed in d8c8135);--ranreconciliation 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 sharesRecordDetailView.tsx, merge cleanly).Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code