feat(message): show referenced past chats in user message#3338
feat(message): show referenced past chats in user message#3338SuMuxi66 wants to merge 3 commits into
Conversation
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
SivanCola
left a comment
There was a problem hiding this comment.
Thanks, this is directionally useful, but I cannot approve it yet.
Required changes:
-
The send path waits for
PreviewSession/buildSessionContextbefore callingonSendor clearing the composer. While that await is pending, the input and send button remain enabled, so pressing Enter or clicking send again can submit duplicate turns with the same referenced sessions. It also breaks the PR's stated "display immediately after send" behavior for referenced sends. Please snapshot/lock/clear the composer before the async session reads, or add an explicit sending guard that makes duplicate submission impossible. -
The new
past:chatsUI is not wired into the existing keyboard menu state.menuModeonly opens the@menu whenatMatches.length > 0,countstill excludes the special/session rows, andpickActive()always callspickEntry(atMatches[active]). This means the past-chat option can disappear when there are no file matches, and Enter/Tab cannot select a highlighted past-chat session. Please make past-chat rows first-class menu items for open/active/count/pick handling. -
New visible UI strings are hard-coded in Chinese in
Composer.tsxandMessage.tsx. The desktop frontend has an existing en/zh dictionary contract, so English locale users will see mixed Chinese. Please add the required i18n keys in both locale files and uset(...)/useT()for visible text. -
git diff --check origin/main-v2...origin/pr/3338currently fails becausedocs/SESSION_REFERENCE_ARCHITECTURE.mdcontains trailing whitespace. Please clean that up before merge.
Integration notes:
- This PR is still draft and stacked on #3336; it should be rebased after the core past-chats PR is finalized.
- It also overlaps #3356 on user-message bubble styling, so one of the two PRs should become the integration source for that layout.
Verified locally:
wails generate modulepassed after creating the expected temporaryfrontend/distplaceholder in a throwaway worktree.npm run buildpassed indesktop/frontend.go test . -run 'TestPreviewSession|TestListSessions|TestHistory|TestSession'passed indesktop.git merge-tree --write-tree origin/main-v2 origin/pr/3338produced an auto-merge tree with no textual conflicts.
Summary
Display selected
past:chatsreferences inside the user message bubble, and restructure user messages as right-aligned chat bubbles.What's included
past:chatsreferences through:ComposerAppuseControllerTranscriptUserMessageScope
This PR only covers user message bubble layout and
past:chatsreference display.It does not add file-reference bubbles.
It does not change the CLI/TUI flow.
It depends on the past-chats core Composer PR.
Files changed
desktop/frontend/src/App.tsxdesktop/frontend/src/components/Composer.tsxdesktop/frontend/src/components/Message.tsxdesktop/frontend/src/components/Transcript.tsxdesktop/frontend/src/lib/useController.tsdesktop/frontend/src/styles.cssTest checklist
past:chatsreferences appear inside the user message bubble@file references still work/command menu still works