Repository navigation
feat(console): the empty ⌘K palette leads with the current page's favorites entry - #36536
Conversation
…favorites entry first Part of the current-page group: on an object's list the list's favorites entry, on a record page the record's star, both through the page's own entry. Claude-Session: https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm Co-authored-by: Claude <noreply@anthropic.com>
…eset Claude-Session: https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm Co-authored-by: Claude <noreply@anthropic.com>
…lette-current-page
|
repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm Contract-review-claim: session_01ADHkmRB34k9WUWeGpRnVNm · head 9e95566 · 2026-11-22T18:55Z |
|
repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm Contract reviewServed-tier: The face is the ① Derived judgments
② Semver levelpatch for ③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm 席位核对ACCEPT — PR #36536 @ 9e95566 · card #36286 (item 5, partial) · L1 first read by area s2-B (area order rule 9) · contract review PASS 7083997404 (TIER_DEFAULT, declaration face) · 2026-11-22T18:57Z
|
Requested by Steve · project thread
Part of #36286
Clause-②: yes (widening) — one new published language-pack key, in all eleven packs: console.commandPalette.currentPage
Metadata-protocol: none
维护者速读
What changes
Item 5 of the card ("current page" group on the empty palette), the part that has an entry point the palette can reach today: the favorites entry. The other two rows the card names, New view (list page) and Edit (record page), are not built here; see Acceptance notes. Hence
Part of, not a closing keyword: merging this must not close the card.PaletteCurrentPage.tsx, beside the palette)./apps/APP/OBJECT, or/apps/APP/OBJECT/view/VIEW): "Add to favorites" / "Remove from favorites", running the list's own ⋮ More favorites entry,useObjectListFavorite, with the plural title the list is drawn under (servedObjectPluralLabel). Same hook, same inputs, so it pins the app's navigation entry where the app has one and keeps anobject:favorite otherwise, exactly as the menu does..../OBJECT/record/ID, and its named-page route): the record's star. The favorite item the record page builds is now one exported function,recordFavoriteItemin the favorites module (FavoritesProvider.tsx); the record page and the palette both call it, so both toggle the samerecord:OBJECT:IDentry. The label is the title the record was last visited under (the page records that visit under the same id), else the id, which the page heals on its next visit as before.APP_ROUTE_METADATA_READS, theobjectViewRouteObjectmatcher), sosearch,reports,.../new,.../data,.../record/ID/editand dashboards draw no group; an object the console does not serve opens the not-found state, which offers no favorites entry, so it draws none either.favorite-add/favorite-remove; the footer says "Add to favorites ↵" / "Remove from favorites ↵", reusing the menu's existingcommon.addToFavorites/common.removeFromFavoriteskeys.console.commandPalette.currentPage("Current page"), in all eleven packs (zh-Hant regenerated bygen:zh-hant).Read first (risk order):
ui/packages/app-shell/src/chrome/PaletteCurrentPage.tsx— the page matcher and the group; thelistFavorite/ record branch is where "same entry as the page" lives.ui/packages/app-shell/src/views/RecordDetailView.tsx— one hunk:favoriteRecordnow callsrecordFavoriteItem(byte-identical item).ui/packages/app-shell/src/chrome/CommandPalette.tsx— the group is mounted above the recent records, only for an empty query.Tests
New top-level
describein the card's existing harness fileCommandPalette.previewCreate-36286.test.tsx(the shared harness for this card's palette pins, so the new pins go there rather than a new file), realCommandPaletteProvider+FavoritesProvider+RecentItemsProvider:useObjectListFavorite, probed beside the palette) on, as thenav:pin, and does not navigate;recordFavoriteItem(app, object, id, visitedTitle);No existing test was changed.
Local runs (head 9e95566, after merging origin/main 0b2118f)
vitest run packages/app-shell/src/chrome/ packages/i18n/+ the favorites / record-page / route-reads pins (RecordDetailView.favoritesEntry-12427,.phoneFace-27058,.recordPageTiers-26678,.printPageHeaderActions-12906,ObjectView.favoritesEntry-12427,FavoritesProvider.test,appRouteMetadataReads-12809): Test Files 142 passed (142), Tests 2257 passed, 13 skipped; lock VERDICT command-exit 0.pnpm --filter @object-ui/app-shell type-check(tsc --noEmit+tsconfig.test.json): VERDICT command-exit 0 (at 6b01f4f, before the merge).scripts/ablation-replace.mjs: the record row's toggle rewritten to store a palette-own id (palette:record:…). Anchor x1 to x0, blob b6ae734d to f104aa13; the file goes red, 2 failed / 25 passed ("on a record page: Enter stars the record…", "a record already starred offers to take the star off"); restored, blob equals HEAD,git diff HEADempty.--no-inline-configon the changed files: 0 errors; warning counts equal to main exceptFavoritesProvider.tsx+1 and the newPaletteCurrentPage.tsx1, bothreact-refresh/only-export-componentsfor the exported pure function, the same warningwithFavoriteOrderalready carries there.Acceptance notes
ObjectView; the record page's Edit either enters the page's edit state or opens the form, and its visible/disabled verdict is computed insideRecordDetailViewfrom the loaded record (approval lock,edit.disabledWhen, state lock, edit-state eligibility). Re-deriving either in the palette would be a second verdict, which the dispatch rules out. The sound shape is the page advertising its own handler to the palette while it is mounted, asadvertisedShortcutsandusePublishPhonePageBaralready do, which edits both pages and is outside this claim's file surface. Held for a decision.?recordId=) is still the list page to the palette: it offers the list's favorite, not the record's.extraRoutes) whose path shadows an object name is not consulted: the palette is not handedhostRoutePaths. An object of that name would draw the list favorite there.ui/AGENTS.mdasks a feature to update the package README; the README is outside this claim's file surface and is not edited.Verification
Two-minute check: open any object's list in the console, press ⌘K without typing. Expected: "Current page" first, "Add to favorites" selected, footer "Add to favorites ↵"; Enter adds the list to the sidebar's Favorites. On a record page the same row fills the star beside the record's name.
Showcase app on its own fresh backend and the console dev server, Chromium at 1440×900:
List page, empty palette:
Record page, empty palette:
Record page after Enter: the page's own star is filled and the sidebar lists the record under Favorites:
Same run, read off the page: the stored favorites were
record:showcase_account:1MzJPKSv7BryLV8Vlabelled "Stark Industries" and the list'snav:nav_accountspin; reopened, the row read "Remove from favorites"; typing "stark" removed it. Screenshots live on the code-free refclaude/issue-36286-current-page-screenshots, which can be deleted after merge.🤖 Generated with Claude Code