feat(composer): add past chats reference flow#3336
Conversation
ScopeThis PR only adds the |
SivanCola
left a comment
There was a problem hiding this comment.
Thanks, this is directionally useful, but I don't think it is ready to merge yet.
Please address these before merging:
-
The new
past:chatsentry is rendered inside the@menu, but the menu state machine still only counts and picks file entries.menuModeonly opens whenatMatches.length > 0,countis stillatMatches.length, andpickActive()still routes Enter/Tab topickEntry(atMatches[active]). That means keyboard selection cannot openpast:chats, keyboard selection inside the past-chat list cannot choose a session, and the entry can disappear entirely when there are no file matches. Please makepast:chatsa real selectable item in the@menu state model, including keyboard navigation and the empty-file-list case. -
submit()now awaitsbuildSessionContext(sessionRefs)before callingonSend, but there is no local submitting guard while thosePreviewSessioncalls are pending. During that window, the send button remains enabled and Enter can trigger another submit, so users can duplicate the same message if session preview reads are slow. Please add a pending-submit state or otherwise disable duplicate sends until the async context build finishes. -
git diff --checkcurrently fails due to trailing whitespace indocs/SESSION_REFERENCE_ARCHITECTURE.mdat lines 71, 144, 164-166, 173, 200, 209, and 219.
Notes from review:
- I did not see new dependency, network, command execution, or provider/tool-schema cache-stability risk.
- The PR is behind latest
main-v2, but a merge-tree check against the latest base did not show a text conflict. Please still rebase or update before final verification. - Frontend
typecheckcould not be completed in a temporary worktree because this checkout lacks generated Wailswailsjstypes; that is not counted as a PR-specific failure here.
Once these are addressed and CI stays green, I will consider merging it into main-v2.
c51604a to
d05b034
Compare
|
Updated. Changes addressed:
|
d05b034 to
790414a
Compare
Squash the verified past:chats implementation chain into one reviewable feature commit for PR preparation. Includes: - Add past:chats entry to the @ reference menu - Show historical chat sessions and selected reference cards - Include referenced chat context at send time - Filter past chats locally in the reference menu - Preview referenced chats on hover with Tooltip Original verified commits: - cdec11d3 feat(composer): add past chats reference entry - bab0be5d feat(composer): include referenced chats in prompt - 81ca7602 feat(composer): filter referenced chats - a805e3bd feat(composer): preview referenced chats on hover
790414a to
19f9ccf
Compare
|
Updated again. Rebased onto the latest Verified:
Manual checks still pass for root-level |
SivanCola
left a comment
There was a problem hiding this comment.
Thanks for the updates. The previous blocking items are mostly addressed, but I found one remaining regression that should be fixed before merge:
- The root-level
@menu now always insertspast:chatsas the first item wheneveratDir === "". Becauseactiveresets to 0 as the query changes, typing something like@READMEor@srcand pressing Enter/Tab opens the past-chats picker instead of selecting the first matching file entry. This regresses the existing@filekeyboard flow and conflicts with the PR checklist item that file references still work. Please only show/selectpast:chatswhen the empty root@menu is open or when the current fragment actually matchespast:chats, or otherwise preserve the first file match as the default active item for non-empty file queries.
Also, please avoid closing #3185 from this PR as-is. The issue asks for a broader #past_chats flow and is tagged for desktop/TUI/agent, while this PR explicitly scopes itself to the desktop Composer. Part of #3185 or a follow-up issue for the remaining TUI/trigger behavior would be more accurate.
Once the @file keyboard regression is fixed and verification stays green, I will consider merging this into main-v2.
There was a problem hiding this comment.
Approved. The latest update addresses the remaining blocker from my previous review: past:chats is no longer unconditionally inserted ahead of file matches for non-matching @ fragments, so normal @README / @src style keyboard selection can keep resolving to file entries while @ and matching @past... fragments can still reach the past-chats picker.
Why this fits the architecture:
- The feature stays scoped to the desktop Composer and uses the existing
ListSessions/PreviewSessionbridge methods instead of adding new persistence, network, command execution, or permission surfaces. - Referenced chat content is added only to the dynamic submit payload after an explicit user selection; it does not change provider-visible stable prefixes, tool schemas, provider serialization, or cache-sensitive prompt setup.
- The PR body now correctly says
Part of #3185, which matches the desktop-only scope and leaves the broader TUI / trigger behavior open for follow-up.
Related work: #3338 is still the stacked follow-up for rendering selected references inside user message bubbles, so it should be rebased/reviewed after this core Composer flow lands.
Verified:
git diff --check origin/main-v2...origin/pr/3336passedgit merge-tree --write-tree origin/main-v2 origin/pr/3336produced a clean treepnpm --dir desktop/frontend check:csspassedpnpm --dir desktop/frontend test:allpassed (85 tests)
Caveat: pnpm --dir desktop/frontend typecheck still cannot complete in a temporary checkout because the Wails-generated wailsjs bindings are absent there; this is the same environment limitation as before, not a PR-specific failure.
Part of #3185
Summary
Add
@ → past:chatsflow to the Composer, allowing users to select a historical chat session and inject its context into the current conversation.What's included
@menu: Newpast:chatsentry in the@context menudocs/SESSION_REFERENCE_ARCHITECTURE.mddocumenting the data flowFiles changed
Composer.tsx@menu entry, session list, search, hover preview, reference card in ComposerFileMenu.tsxpast:chatsmenu itemtypes.tsSessionReferenceinterfacestyles.cssSESSION_REFERENCE_ARCHITECTURE.mdTest checklist
@menu showspast:chatsoptionpast:chatsopens session list@file references still work/command menu still works