Skip to content

feat(chat): queue repeated messages from trailing xN intent#341

Open
ijry wants to merge 3 commits into
xintaofei:mainfrom
ijry:feat/repeat-intent-queue
Open

feat(chat): queue repeated messages from trailing xN intent#341
ijry wants to merge 3 commits into
xintaofei:mainfrom
ijry:feat/repeat-intent-queue

Conversation

@ijry

@ijry ijry commented Jul 15, 2026

Copy link
Copy Markdown

Summary

Detect trailing repeat multipliers like 继续X10 / continue x 3 in the chat composer, confirm with a dialog, and enqueue N identical base messages into the existing pending queue.

English

  • Parse trailing x / X + digits (optional spaces) on send
  • Valid count range: 2..50
  • Confirm dialog before expanding; cancel keeps the original composer text
  • On confirm, bulk-enqueue N base drafts via atomic enqueueMany
  • Skip detection while editing a queue item
  • If no enqueue path is available, fall back to normal single send of the original draft
  • i18n strings added across all locales under Folder.chat.messageQueue

中文

  • 发送时识别末尾的 x / X + 数字(兼容大小写与空格),例如 继续X10继续 x 10
  • 合法次数范围:2..50
  • 弹出确认框后再展开;取消/关闭时保留原始输入(含 xN
  • 确认后通过原子 enqueueMany 一次性生成 N 条待发送基础消息
  • 队列项编辑模式下不触发识别
  • 若当前界面没有入队能力,则回退为正常单次发送原始草稿
  • 全部语言包补齐 Folder.chat.messageQueue 下的文案

Behavior examples

Input Result
继续X10 dialog → queue 10 × 继续
继续 x 10 dialog → queue 10 × 继续
continue X 3 dialog → queue 3 × continue
继续x1 / 继续x51 no match, normal send
继续X10 请 no match (not trailing)

Test plan

  • pnpm exec vitest run src/lib/repeat-intent.test.ts
  • pnpm exec vitest run src/hooks/use-message-queue.test.ts
  • pnpm exec vitest run src/i18n/messages.test.ts
  • pnpm exec vitest run src/components/chat/message-input.test.tsx
  • Manual: type 继续x10, confirm → 10 pending messages appear
  • Manual: cancel dialog → composer text unchanged
  • Manual: queue-item edit with xN suffix → saves edit, no dialog

jry added 2 commits July 15, 2026 08:39
Capture the approved design for trailing xN/XN multiplier recognition,
confirm dialog, and bulk enqueue into the pending message queue.
Detect trailing xN / XN multipliers in the composer, confirm with a dialog,
and enqueue N identical base drafts into the pending message queue.
@ijry
ijry force-pushed the feat/repeat-intent-queue branch from 9703a47 to 44b9422 Compare July 15, 2026 01:09
Collapse multi-line import, wrap cancel label, and drop extra blank
lines so frontend eslint/prettier CI passes.
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.

1 participant