Skip to content

feat(message): show referenced past chats in user message#3338

Draft
SuMuxi66 wants to merge 3 commits into
esengine:main-v2from
SuMuxi66:feature/user-message-reference-bubble
Draft

feat(message): show referenced past chats in user message#3338
SuMuxi66 wants to merge 3 commits into
esengine:main-v2from
SuMuxi66:feature/user-message-reference-bubble

Conversation

@SuMuxi66
Copy link
Copy Markdown

@SuMuxi66 SuMuxi66 commented Jun 6, 2026

Draft PR.
Depends on: feat(desktop): add past chats reference flow

This branch is stacked on top of feature/past-chats-reference.
Please review/merge the past-chats core PR first, then this branch can be rebased onto main-v2.

Summary

Display selected past:chats references inside the user message bubble, and restructure user messages as right-aligned chat bubbles.

What's included

  • Right-align user messages as chat bubbles
  • Add a speech-bubble tail for user messages
  • Preserve left-aligned assistant messages
  • Pass selected past:chats references through:
    • Composer
    • App
    • useController
    • Transcript
    • UserMessage
  • Render referenced past chats inside the user message bubble
  • Show title, turn count, and file name
  • Show full path on hover
  • Display user messages immediately after send

Scope

This PR only covers user message bubble layout and past:chats reference 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.tsx
  • desktop/frontend/src/components/Composer.tsx
  • desktop/frontend/src/components/Message.tsx
  • desktop/frontend/src/components/Transcript.tsx
  • desktop/frontend/src/lib/useController.ts
  • desktop/frontend/src/styles.css

Test checklist

  • User messages appear on the right side
  • User messages have a bubble layout
  • User message text remains left-aligned inside the bubble
  • Assistant messages remain left-aligned
  • Long user messages wrap correctly
  • past:chats references appear inside the user message bubble
  • Reference cards show title, turn count, and file name
  • Hover shows full path
  • Messages without references do not show a reference area
  • Deleting a reference before send removes it from the sent user message
  • @ file references still work
  • / command menu still works
  • Assistant Markdown streaming still works
  • CopyButton still works
  • Reasoning fold/unfold still works

SuMuxi66 added 3 commits June 6, 2026 11:44
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
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 6, 2026
Copy link
Copy Markdown
Collaborator

@SivanCola SivanCola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is directionally useful, but I cannot approve it yet.

Required changes:

  • The send path waits for PreviewSession/buildSessionContext before calling onSend or 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:chats UI is not wired into the existing keyboard menu state. menuMode only opens the @ menu when atMatches.length > 0, count still excludes the special/session rows, and pickActive() always calls pickEntry(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.tsx and Message.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 use t(...)/useT() for visible text.

  • git diff --check origin/main-v2...origin/pr/3338 currently fails because docs/SESSION_REFERENCE_ARCHITECTURE.md contains 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 module passed after creating the expected temporary frontend/dist placeholder in a throwaway worktree.
  • npm run build passed in desktop/frontend.
  • go test . -run 'TestPreviewSession|TestListSessions|TestHistory|TestSession' passed in desktop.
  • git merge-tree --write-tree origin/main-v2 origin/pr/3338 produced an auto-merge tree with no textual conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants