fix(desktop): render pinned search sessions#37590
Open
ferminquant wants to merge 7 commits into
Open
Conversation
Contributor
|
One thing I would change before merge: this only caches the search result in component state. It fixes the immediate pin action, but the pin can disappear again after a full app reload if the session is still outside the normal loaded page. The API already has GET /api/sessions/{id}; hydrating missing pinned ids from that endpoint would make the fix durable without widening the sidebar list. |
19 tasks
- Keep both pin-rendering fixes (getMissingPinnedSessionIds, resolvePinnedSessions) and upstream's mergeWorkingSessions - Both sets of tests preserved - session.ts: indexSessionsByPinnedId + mergeWorkingSessions coexist
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.
Summary
GET /api/sessions/{id}after app reload._lineage_root_idbehavior.Root Cause
Pinned session IDs were persisted correctly, but the Desktop sidebar rendered pinned rows by resolving those IDs only against the current loaded
$sessionslist. Search can return sessions that are not in that loaded list, so pinning a search-only result stored the pin but left the pinned section with no session record to render. The previous component-local search-result cache fixed the immediate render, but did not survive a full app reload.Fix
GET /api/sessions/{id}.SessionInfoobject.Test Plan
npm run buildnpm run test:ui -- src/store/session.test.tsnpm run type-checknpx eslint src/store/session.ts src/store/session.test.ts src/hermes.ts src/app/chat/sidebar/index.tsxgit diff --checkVerification Notes
The regression tests now cover:
_lineage_root_idfallback resolution;Verified against the actual affected local session from [Bug]: Desktop pinned search result does not appear when session is hidden from normal list #37582:
20260602_133018_d1c043/desktop ui bugexists in the local session DB;list_sessions_rich(..., include_children=False)sidebar list;bug*FTS query pattern used by/api/sessions/search?q=bugreturns that session;GET /api/sessions/20260602_133018_d1c043-equivalent DB lookup returns the raw session record;/api/sessions/20260602_133018_d1c043, and then resolves it into the pinned session list.Headless Desktop UI repro was run for real on this PR branch/build:
npm run build, producing install stamp8d134f7502a0 (fix/desktop-pinned-search-session).bugand shift-click pinned the search result for the affected session (20260602_133018_d1c043).localStorage['hermes.desktop.pinnedSessions']as["20260602_133018_d1c043"].PINNEDdesktop ui bugSESSIONS 4/12Negative control on current
origin/mainwithout this PR fix was also run with the same real local state DB:origin/mainatb34ee80741db2fdf188dcdc5c5caa78ee72642ffwith a clean install stamp (dirty: false).["20260602_133018_d1c043"]) and reloaded the Desktop app.Shift click to pin a chat) and did not renderdesktop ui bug.desktop ui bugafter reload.Portable fresh-fixture negative control was also run on unpatched
origin/mainso the repro does not depend on the reporter's private local DB:repro_parent_20260602_newpinand child sessionrepro_child_20260602_newpintitlednew pinned child reprointo a backed-up localstate.dbtest run.GET /api/sessions/repro_child_20260602_newpinreturned the raw child session record withparent_session_id = repro_parent_20260602_newpinandmessage_count = 1./api/sessions?limit=50&offset=0&min_messages=1&archived=exclude&order=recent) did not include the child session.origin/mainatb34ee8074headlessly with CDP, persistedlocalStorage['hermes.desktop.pinnedSessions']as["repro_child_20260602_newpin"], and reloaded.PINNEDwithShift click to pin a chatand did not rendernew pinned child repro.Security / Privacy Impact
Scope Boundaries
_lineage_root_iddurable pin behavior.parent_session_idbehavior described in the issue context.Checklist
Code
fix(scope):,feat(scope):, etc.).npm run build,npm run test:ui -- src/store/session.test.ts,npm run type-check, targetednpx eslint, andgit diff --check.Documentation & Housekeeping
cli-config.yaml.exampleupdate: N/A — no config keys changed.CONTRIBUTING.md/AGENTS.mdupdate: N/A — no architecture or workflow changed.For New Skills
Screenshots / Logs
Fixes #37582