Repository navigation
feat(web): make the palette a reliable attention switcher - #1377
Merged
Merged
Conversation
danyaberezun
requested review from
Andrey Markin (Mark-Life),
Olga Lavrichenko (OLavrik),
artyomxx and
Rinat S (rsolmano)
as code owners
November 14, 2026 13:39
danyaberezun
force-pushed
the
attention-switcher-audit
branch
from
November 14, 2026 19:51
8922ff8 to
75e0f07
Compare
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.
Problem
The search palette (
Mod+K/ double Shift) is how the user switches attention, but as a switcher it misled:Chats(not localized, no hint that they belong to no project).Approach
buildWorkItemsemits chats and workspaces newest activity first, so Waiting's stable urgency sort, the@listing and equal-score ties all read newest first.lastActiveAt: agent runs, terminal writes and HEAD moves, at most a minute coarse. It's the signal the topbar switcher and the Chats section already sort by.SessionStateRecord. It would be exact, but needs a contract and host change for the rare tie of two waiting chats in one workspace.initSearchPreferenceswatches the store's location (the attention center chat tab; in a chat without a project, its one chat even before its layout resolves; else the workspace; else Project Home) and stamps a client-locallastUsedper id.Changes
apps/web/src/search/workItems.ts: freshness and rail-order sort;located()computes the subtitle emphasis spans from the interpolated values, so a locale template stays free to word itself.apps/web/src/search/learning.ts: optionallastUsedmap in the existing learning snapshot, capped like frecency. A snapshot without it reads as empty, so there's no version bump.recordVisit, andrecordPicknow stampslastUsedtoo.apps/web/src/search/places.ts(new): derives the current place from the store.preferences.tsstamps visits;sections.tsbuilds Recent fromlastUsedminus the current place.apps/web/src/search/SearchPalette.tsx:RowTitle's muted lead and the newPaletteItem.subtitleEmphasisshare onehighlightSpanssplitter. A pick reads the shared snapshot, so it can't overwrite a visit stamped while the palette was open.apps/web/src/shell/useSearchPalette.ts: the host-hit project name for the Chats container uses the new label.packages/locales/*:search.item.noProject.apps/web/src/search/SPEC.md: Freshness, Recent, row location, Preferences bound.Screenshots
Same scenario, same viewport: one chat without a project and two finished chats in the project folder, all unread.
Checklist
bun run lint,bun run typecheck,bun run testbun run e2e, orbun run e2e:fullwhen touching agent behavior)SPEC.md/ top-level specs updated to reflect any boundary, contract, or behavior changeTesting (on the rebased head):
bun run lint,bun run typecheck(26/26),bun run test(25/25) → greenbun run check:deps,check:boundaries,check:seams,check:spec-surface,check:i18n,check:compiler→ OKbun test apps/web/src/search→ 80 pass. New tests cover freshness and rail-order ties, the No project label and emphasis spans, visits andlastUsed, Recent ordering and exclusion, andcurrentPlaceIds.bun run e2e e2e/search-palette.spec.ts e2e/chats.spec.ts→ 32 passedbun run e2e(8 lanes) is not green on the dev machine, on the base commit either. Terminal shells never start (data-failed="true"), with knock-on failures in tool-rails, workspace-actions and voice-input: 35 failures on the unmodified base, 38 on this branch. The extra four (ask-user-question, extension-dialogs, no-webassembly, plan-ask) pass when rerun serially.bun run e2e e2e/search-palette.spec.ts -g "No project" --repeat-each=50→ 50 passed (it had flaked 1 in 15 before the project-less chat's place stopped depending on its layout)