Skip to content

feat(composer): add past chats reference flow#3336

Open
SuMuxi66 wants to merge 2 commits into
esengine:main-v2from
SuMuxi66:feature/past-chats-reference
Open

feat(composer): add past chats reference flow#3336
SuMuxi66 wants to merge 2 commits into
esengine:main-v2from
SuMuxi66:feature/past-chats-reference

Conversation

@SuMuxi66
Copy link
Copy Markdown

@SuMuxi66 SuMuxi66 commented Jun 6, 2026

Closes #3185

Summary

Add @ → past:chats flow to the Composer, allowing users to select a historical chat session and inject its context into the current conversation.

What's included

  • @ menu: New past:chats entry in the @ context menu
  • Session list: Browse recent chat sessions with title and turn count
  • Search: Filter sessions by keyword
  • Hover preview: Preview session content on hover before selecting
  • Context injection: Selected session's conversation is appended to the prompt as context
  • Architecture doc: docs/SESSION_REFERENCE_ARCHITECTURE.md documenting the data flow

Files changed

File Change
Composer.tsx @ menu entry, session list, search, hover preview, reference card in Composer
FileMenu.tsx Wire past:chats menu item
types.ts SessionReference interface
styles.css Composer reference card styles
SESSION_REFERENCE_ARCHITECTURE.md Architecture documentation

Test checklist

  • @ menu shows past:chats option
  • Clicking past:chats opens session list
  • Search filters sessions by keyword
  • Hover preview shows session content
  • Selecting a session adds reference card above Composer input
  • Reference card shows title, turn count, file name
  • Hover on reference card shows full path
  • Sending with reference: AI can reference the selected session content
  • Sending without reference: normal behavior unchanged
  • Deleting reference card before send: no reference injected
  • @ file references still work
  • / command menu still works
  • No regression in existing Composer behavior

SuMuxi66 added 2 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
@SuMuxi66
Copy link
Copy Markdown
Author

SuMuxi66 commented Jun 6, 2026

Scope

This PR only adds the past:chats reference flow to the desktop Composer UI (desktop/frontend). It does not change the CLI/TUI input flow.

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 don't think it is ready to merge yet.

Please address these before merging:

  • The new past:chats entry is rendered inside the @ menu, but the menu state machine still only counts and picks file entries. menuMode only opens when atMatches.length > 0, count is still atMatches.length, and pickActive() still routes Enter/Tab to pickEntry(atMatches[active]). That means keyboard selection cannot open past: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 make past:chats a real selectable item in the @ menu state model, including keyboard navigation and the empty-file-list case.

  • submit() now awaits buildSessionContext(sessionRefs) before calling onSend, but there is no local submitting guard while those PreviewSession calls 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 --check currently fails due to trailing whitespace in docs/SESSION_REFERENCE_ARCHITECTURE.md at 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 typecheck could not be completed in a temporary worktree because this checkout lacks generated Wails wailsjs types; 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.

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.

[Feature]: 添加 #past_chats 功能,支持引用历史会话上下文

2 participants