Skip to content

fix(desktop): queue a single pending send during streaming#460

Merged
Chevey339 merged 1 commit intoChevey339:masterfrom
luosc:feat/desktop-single-send-queue
Apr 10, 2026
Merged

fix(desktop): queue a single pending send during streaming#460
Chevey339 merged 1 commit intoChevey339:masterfrom
luosc:feat/desktop-single-send-queue

Conversation

@luosc
Copy link
Copy Markdown
Contributor

@luosc luosc commented Apr 9, 2026

Block desktop shortcut sends from starting a second generation while the current turn is still streaming. Queue one pending composer input instead, show a three-line preview, and allow canceling the queued item back into the editable composer with attachments restored.

Move the guard into the controller/view-model send path so keyboard shortcuts cannot bypass the stop-state protection, and automatically dispatch the queued input when the active generation finishes or is stopped.

Closes #458

Files changed:

  • lib/core/models/chat_input_data.dart: add single-queue submission result and queued input model
  • lib/features/home/controllers/home_page_controller.dart: return send submission results and restore queued input back into the composer on cancel
  • lib/features/home/controllers/home_view_model.dart: add single pending-send queue, block concurrent sends, and auto-drain after streaming stops
  • lib/features/home/pages/home_page.dart: pass queued input state and preview text into the shared chat input section
  • lib/features/home/widgets/chat_input_bar.dart: make send async-result aware, lock the composer while queued, and render queued preview/cancel UI
  • lib/features/home/widgets/chat_input_section.dart: thread queued-input state and preview props into ChatInputBar
  • lib/l10n/app_en.arb: add queued pending/cancel strings
  • lib/l10n/app_localizations.dart: regenerate localization accessors for queued-input strings
  • lib/l10n/app_localizations_en.dart: regenerate English queued-input strings
  • lib/l10n/app_localizations_zh.dart: regenerate Chinese queued-input strings
  • lib/l10n/app_zh.arb: add queued pending/cancel strings
  • lib/l10n/app_zh_Hans.arb: add queued pending/cancel strings
  • lib/l10n/app_zh_Hant.arb: add queued pending/cancel strings
  • test/features/home/widgets/chat_input_bar_queue_test.dart: cover queued send clearing, rejected send retention, and queued preview/cancel UI

Block desktop shortcut sends from starting a second generation while the current turn is still streaming. Queue one pending composer input instead, show a three-line preview, and allow canceling the queued item back into the editable composer with attachments restored.

Move the guard into the controller/view-model send path so keyboard shortcuts cannot bypass the stop-state protection, and automatically dispatch the queued input when the active generation finishes or is stopped.

Closes Chevey339#458

Files changed:
- lib/core/models/chat_input_data.dart: add single-queue submission result and queued input model
- lib/features/home/controllers/home_page_controller.dart: return send submission results and restore queued input back into the composer on cancel
- lib/features/home/controllers/home_view_model.dart: add single pending-send queue, block concurrent sends, and auto-drain after streaming stops
- lib/features/home/pages/home_page.dart: pass queued input state and preview text into the shared chat input section
- lib/features/home/widgets/chat_input_bar.dart: make send async-result aware, lock the composer while queued, and render queued preview/cancel UI
- lib/features/home/widgets/chat_input_section.dart: thread queued-input state and preview props into ChatInputBar
- lib/l10n/app_en.arb: add queued pending/cancel strings
- lib/l10n/app_localizations.dart: regenerate localization accessors for queued-input strings
- lib/l10n/app_localizations_en.dart: regenerate English queued-input strings
- lib/l10n/app_localizations_zh.dart: regenerate Chinese queued-input strings
- lib/l10n/app_zh.arb: add queued pending/cancel strings
- lib/l10n/app_zh_Hans.arb: add queued pending/cancel strings
- lib/l10n/app_zh_Hant.arb: add queued pending/cancel strings
- test/features/home/widgets/chat_input_bar_queue_test.dart: cover queued send clearing, rejected send retention, and queued preview/cancel UI

Files changed: 14

Signed-off-by: Shuchen Luo <[email protected]>
@luosc luosc marked this pull request as ready for review April 9, 2026 00:30
@Chevey339 Chevey339 merged commit c6df2bd into Chevey339:master Apr 10, 2026
1 check passed
@luosc luosc deleted the feat/desktop-single-send-queue branch April 11, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

桌面端生成中仍可通过 Cmd+Enter 发送下一条消息,导致并发流式生成、停止失效并破坏消息链路

2 participants