Repository navigation
fix(desktop): ⌘K session search honours renames and groups pinned sessions first - #120925
Merged
Merged
Conversation
…tely The palette fetched its own 200-row page through react-query with the client's 60s staleTime, and nothing invalidated it: a rename, pin, or archive lands in the sidebar's session stores while the palette is unmounted, so ⌘K kept showing the old title (or an archived row) for up to a minute, and painted it stale-first even after. Revalidate on every open (staleTime 0; the cached page still paints instantly) and overlay the sidebar's live stores on the fetched page by id, so title and pin come from what the sidebar already knows and rows the user just archived or deleted are dropped.
Pinned sessions were mixed into Sessions with no group, icon, or ranking advantage. Resolve them the way the sidebar's Pinned section does (resolvePinnedSessions: local pin order, then server-flagged pins, minus in-flight unpins) and list them under a Pinned heading ahead of Sessions; rankGroups' stable sort then lets a pin win a tie on equal scores.
૮ >ﻌ< ა ci reviewran on 3fd4960 — feat(desktop): ⌘K groups pinned sessions first debug infoCI timingsCI timings · View report · View jobWall time 3m37s vs 5m30s (-34.2%). 4 job(s) slower, 3 faster,
|
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.
What does this PR do?
⌘K session search was showing stale titles and ignoring pins.
Renames / archives. The palette fetched its own 200-row page through react-query with the client's 60s
staleTime, and nothing ever invalidated it: a rename, pin, or archive lands in the sidebar's session stores while the palette is unmounted, so ⌘K kept the old title (or a just-archived row) for up to a minute, and painted it stale-first even after that. The two session queries now revalidate on every open (staleTime: 0; the cached page still paints instantly), and the sidebar's live stores ($sessions/$cronSessions/$messagingSessions) are overlaid on the fetched page by id, so title and pin come from what the sidebar already knows and ids in$removedSessionIdsare dropped.Pins.
pinnedwas never read: pinned sessions sat in Sessions with no group, icon, or ranking advantage. They are now resolved the same way the sidebar's Pinned section resolves them (resolvePinnedSessions: local pin order, then server-flagged pins, minus in-flight unpins) and listed under a Pinned heading ahead of Sessions with thePinicon.rankGroupsis a stable sort, so on equal scores a pin wins the tie.Also folds the three copies of the session keyword array into one
sessionKeywordshelper.Related Issue
None filed; found while using the app.
Type of Change
Changes Made
apps/desktop/src/app/command-palette/index.tsxstaleTime: 0on the['command-palette', 'sessions' | 'archived']queriesliveRows: fetched page overlaid with the sidebar stores' title/pin, minus removed idspinnedSessionsviabuildSessionByAnyId+resolvePinnedSessions; new Pinned group before SessionssessionKeywordshelper shared by Pinned / Sessions / Archived rowsHow to Test
Verified in a live dev instance over CDP against real
~/.hermesdata:triagewith several matching sessions: Pinned listsTriage(exact) aboveReview hermes-triage …, then Projects, then Sessions; the Pinned rows match the sidebar's Pinned section exactly.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests pass — N/A, renderer-only;tsc -p ., eslint and prettier pass on the touched fileDocumentation & Housekeeping
cli-config.yaml.example— N/ACONTRIBUTING.mdorAGENTS.md— N/A