Skip to content

feat(tui): message queue navigation with ↑/↓ during streaming#3143

Closed
lanshi17 wants to merge 2 commits into
esengine:main-v2from
lanshi17:feat/message-queue-navigation
Closed

feat(tui): message queue navigation with ↑/↓ during streaming#3143
lanshi17 wants to merge 2 commits into
esengine:main-v2from
lanshi17:feat/message-queue-navigation

Conversation

@lanshi17

@lanshi17 lanshi17 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

What

When a turn is running and the user queues messages (Enter during streaming), pressing ↑/↓ now lets them browse and edit queued messages, instead of only being able to append new ones.

Why

Closes #2551 — during streaming, queued messages were fire-and-forget with no way to review or correct them before they were sent.

How

  • **↑/↓ during ** navigates through queue (↑ saves the current draft, jumps to the last queued item; subsequent ↑/↓ moves through the list; past the end restores the draft)
  • Enter while browsing saves the edited text back to the queue slot (notice: 'queue [N] updated'); Enter without browsing still queues a new message
  • Queue indicator renders in dim grey above the input box showing for each queued item, with ▸ marking the currently browsed entry
  • Reset guards on any non-↑/↓ key, on Enter, on TurnDone dequeue, and on turn finish

Tests

  • — ↑ saves draft, navigates last→first, ↓ restores draft
  • — ↑ clamps at index 0
  • — no-op when queue is empty
  • — editing a queued message saves back to the slot
  • — Enter without browsing appends as before
  • — any other key resets the browse cursor
  • / — view correctness

When a turn is running, users can now press ↑/↓ to browse and edit
queued messages instead of only being able to queue new ones.

Closes esengine#2551

Changes:
- Add queueEditCursor/queueEditDraft fields to chatTUI for tracking
  which queued message is being browsed/edited
- ↑ during tuiRunning saves the current draft and jumps to the last
  queued message; subsequent ↑/↓ moves through the queue
- Editing a queued message and pressing Enter saves the edit back to
  the queue slot (shows 'queue [N] updated' notice)
- Pressing Enter without browsing still queues a new message as before
- Queue indicator rendered in dim grey above the input box showing all
  queued messages with [N] numbering; the currently browsed item gets a
  ▸ highlight marker
- Queue navigation resets on any non-↑/↓ key, on Enter, on TurnDone
  dequeue, and when the turn finishes
@lanshi17 lanshi17 requested a review from SivanCola as a code owner June 4, 2026 17:03
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 4, 2026
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.

[Bug]: 桌面端缺少消息排队,处理中追发的消息被静默吞掉

1 participant