Skip to content

feat(console): the empty ⌘K palette leads with the current page's favorites entry - #36536

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-36286-palette-current-page
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-36286-palette-current-page

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

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

维护者速读

  • 用户在应用的列表页或记录页按 ⌘K、什么都不输入时,面板最上面多一组「当前页面」,里面是「添加到收藏」(已收藏时是「从收藏中移除」);其它页面和输入文字后都不变。
  • 这是「搜索面板对标 Attio」那张卡的第二步;本次只做了收藏这一项,「新建视图」和「编辑」没有做,等定做法。
  • 出错最多是这一行不出现或收藏没加上,页面自己的收藏星标照常能用;可以直接撤回,不影响数据。
  • 要你做的:定「新建视图」「编辑」两项是否让列表页和记录页把自己的按钮登记给面板(要改这两个页面)。

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.

  • New "Current page" group, first on the empty in-app palette, only while nothing is typed (PaletteCurrentPage.tsx, beside the palette).
    • On an object's list (/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 an object: favorite otherwise, exactly as the menu does.
    • On a record page (.../OBJECT/record/ID, and its named-page route): the record's star. The favorite item the record page builds is now one exported function, recordFavoriteItem in the favorites module (FavoritesProvider.tsx); the record page and the palette both call it, so both toggle the same record:OBJECT:ID entry. 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.
    • The page is read off the address against the console's own route table (APP_ROUTE_METADATA_READS, the objectViewRouteObject matcher), so search, reports, .../new, .../data, .../record/ID/edit and 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.
    • Visibility follows the page: both entries are drawn on those pages with no permission condition (the ⋮ More entry and the record star have none), so the palette adds none.
  • Enter hint: the row's value starts with favorite-add / favorite-remove; the footer says "Add to favorites ↵" / "Remove from favorites ↵", reusing the menu's existing common.addToFavorites / common.removeFromFavorites keys.
  • One new published key, console.commandPalette.currentPage ("Current page"), in all eleven packs (zh-Hant regenerated by gen:zh-hant).
  • Untouched, per the card: what the search searches and how it ranks, the full search page, no Ask-AI entry, the phone's search.

Read first (risk order):

  1. ui/packages/app-shell/src/chrome/PaletteCurrentPage.tsx — the page matcher and the group; the listFavorite / record branch is where "same entry as the page" lives.
  2. ui/packages/app-shell/src/views/RecordDetailView.tsx — one hunk: favoriteRecord now calls recordFavoriteItem (byte-identical item).
  3. 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 describe in the card's existing harness file CommandPalette.previewCreate-36286.test.tsx (the shared harness for this card's palette pins, so the new pins go there rather than a new file), real CommandPaletteProvider + FavoritesProvider + RecentItemsProvider:

  • list page: the group is first, its row selected, the footer says Add to favorites; Enter turns the list's own entry (useObjectListFavorite, probed beside the palette) on, as the nav: pin, and does not navigate;
  • a named view of the list is the list;
  • record page: Enter stores exactly recordFavoriteItem(app, object, id, visitedTitle);
  • an already-starred record offers Remove from favorites and Enter takes it off;
  • typing removes the group, clearing brings it back;
  • CONTROL: no group on the app landing, a dashboard, the search page, a create form, an unserved object;
  • the route matcher and the two footer kinds.

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).
  • Ablation (one, on the tested behaviour), via 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 HEAD empty.
  • ESLint --no-inline-config on the changed files: 0 errors; warning counts equal to main except FavoritesProvider.tsx +1 and the new PaletteCurrentPage.tsx 1, both react-refresh/only-export-components for the exported pure function, the same warning withFavoriteOrder already carries there.

Acceptance notes

  • New view and Edit are not built. Neither has an entry point the palette can call from where it is mounted (the console frame, beside the routes): "Add view" is the view switcher's in-place create card, page state inside ObjectView; the record page's Edit either enters the page's edit state or opens the form, and its visible/disabled verdict is computed inside RecordDetailView from 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, as advertisedShortcuts and usePublishPhonePageBar already do, which edits both pages and is outside this claim's file surface. Held for a decision.
  • "Favorite this view" is the list page's favorites entry (its ⋮ More, which favorites the list), not the per-view star in the view switcher; the per-view star needs the open view's id and the switcher's view list, which also live inside the page.
  • The group's row is now the first entry of the empty palette, so Enter on an empty palette over a list or record page toggles the favorite rather than opening the most recent record. This matches the card ("在最上面") and the footer says it.
  • A record opened in the drawer over a list (?recordId=) is still the list page to the palette: it offers the list's favorite, not the record's.
  • A host route (extraRoutes) whose path shadows an object name is not consulted: the palette is not handed hostRoutePaths. An object of that name would draw the list favorite there.
  • ui/AGENTS.md asks 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:

list page

Record page, empty palette:

record page

Record page after Enter: the page's own star is filled and the sidebar lists the record under Favorites:

record page after Enter

Same run, read off the page: the stored favorites were record:showcase_account:1MzJPKSv7BryLV8V labelled "Stark Industries" and the list's nav:nav_accounts pin; reopened, the row read "Remove from favorites"; typing "stark" removed it. Screenshots live on the code-free ref claude/issue-36286-current-page-screenshots, which can be deleted after merge.

🤖 Generated with Claude Code

…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>
@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 Nov 22, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm

Contract-review-claim: session_01ADHkmRB34k9WUWeGpRnVNm · head 9e95566 · 2026-11-22T18:55Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 9e9556611bb29c22f473a92bd223d79fe9007d22
Local-runs: none

The face is the Clause-②: yes (widening) declaration alone (PR body and changeset); no published schema, no governed path, no narrowing arm in the 18 changed paths (check-governed-merges.mjs --pr 36536: 0 of 18). Area s2-B writes this record itself under the seat's area order (rule 10).

① Derived judgments

  • The widening the declaration names is real and complete: one new key console.commandPalette.currentPage, added in all eleven packs (ar, de, en, es, fr, ja, ko, pt-BR, ru, zh-Hans, zh-Hant), each a one-line addition in the commandPalette block. @object-ui/i18n publishes its packs and the derived key type, so the key is published surface; nothing else in the packs moves.
  • The footer reuses the existing common.addToFavorites / common.removeFromFavorites keys; no other new key.
  • "No props or package exports change" holds: the new recordFavoriteItem export lives in ui/packages/app-shell/src/context/FavoritesProvider.tsx, and context/index.ts and the package index.ts re-export named symbols only (FavoritesProvider, useFavorites, type FavoriteItem), so it is not reachable from the . entry of exports. PaletteCurrentPage.tsx is internal to chrome/.

② Semver level

patch for @object-ui/app-shell and @object-ui/i18n, matching the step-1 precedent on this card (PR #36387, a keys-only yes (widening) graded patch after L1 7077829267). No breaking change.

③ Boundary flags

  • Dev open questions: (1) New view and Edit rows — not built; the PR says Part of #36286, the remainder stays on the card (the seat's route: page-advertised commands, after the seat-7 pulls that touch ObjectView.tsx and RecordDetailView.tsx land). (2) Row wording — the area takes A: the page menu's own common.* words, no new row keys. (3) List favorite — the area takes A: the list's ⋮ More favorite. Out-of-scope note (no hostRoutePaths in the palette) — no producer found; Acceptance note, not filed.
  • SQL push-down: not applicable — the diff reads no records; the record row's label comes from the recent-items store already in memory.
  • Author: objectstack-fleet[bot] (relay-written).

Implemented-by: claude/issue-36286-palette-current-page
Reviewed-by: session_01ADHkmRB34k9WUWeGpRnVNm

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 18:58
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 96b7975 Nov 22, 2026
59 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36286-palette-current-page branch November 22, 2026 19:20
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.

2 participants