Skip to content

feat(mobile-web): send a prompt suggestion with one tap - #3656

Merged
bobleer merged 4 commits into
GCWing:mainfrom
gordon-gs:feat/prompt-suggestion-one-tap-send
Nov 2, 2026
Merged

bobleer merged 4 commits into
GCWing:mainfrom
gordon-gs:feat/prompt-suggestion-one-tap-send

Conversation

@gordon-gs

@gordon-gs gordon-gs commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

问题与改动

Remote web 聊天页的建议气泡原先只能填入输入框,触屏需要再点一次发送。本 PR 保留气泡主体的“采纳并编辑”,在旁边新增独立的发送箭头,一次点击提交建议。

  • 气泡主体只填入、聚焦,不自动发送。
  • 发送箭头通过 handleSend(suggestion) 复用既有消息提交路径;普通发送仍通过无参数包装调用 handleSend()。
  • 显式建议文本不清空输入草稿;等待回执期间的新输入会保留。请求失败保留建议并显示错误;离线、发送中、回复中仍受现有显示/提交门禁约束。
  • 英文、简体中文、繁体中文的发送标签同步添加。只改 mobile web,不改变原生移动 composer。

审查补充

已合并 main 到 32715e45d 的更新,并补充真实 ChatPage + RemoteSessionManager + HostDialogQueue / durable outbox 的浏览器集成测试,只模拟 host IO:

  • 未点击时无提交;点击后发送正确建议、模式和目标 device,只有一次 submit。
  • 等待 host 回执时,不把建议写进草稿;成功后保留新输入,清空新草稿也不会让已发送建议复现。
  • host 请求失败时保留建议、显示错误,不伪造成功。
  • 320 / 390 / 768 / 1200 宽度及展开状态切换,同时检查采纳按钮和发送按钮的布局边界。

验证

以下命令在本 PR 工作树运行(使用 corepack pnpm):

  • pnpm --dir src/mobile-web run type-check — passed。首次因新工作树缺少 design-system package 的依赖链接失败,补齐本地依赖链接后通过,未修改依赖清单。
  • pnpm --dir src/mobile-web run test:prompt-suggestion-browser — 3 passed,包含真实聊天/队列成功与失败路径。
  • pnpm --dir src/mobile-web run test:workspace-identity — 35 passed。
  • pnpm --dir src/mobile-web run test:account-browser — 21 passed,覆盖共享 fixture 的既有行为。
  • pnpm run i18n:audit — passed,0 warnings。
  • git diff --check — passed。
  • pnpm --dir src/mobile-web run test:host-queue — 16 passed,1 failed。 失败为既有 queue stays above the measured composer... 的正文/思考图标左边界断言:textLeft=16, iconLeft=28。在独立的未打补丁 main 32715e45d 工作树、相同依赖环境,用 node --test --test-name-pattern='queue stays above' tests/host-dialog-queue-browser.test.mjs 得到完全相同的失败。该失败尚未修复;没有修改断言或宣称整套测试全绿。

浏览器测试使用本机 Chrome 的一次性 profile,另检查了 320px 长文本截图;没有操作用户浏览器或使用真实账号/relay。远程场景仅有 mobile remote-control 的本地模拟 host IO 集成验证,未做真实手机/双机、SSH workspace、Peer Device 或 Detached Dispatch 实机验证。

Generated with OpenBitFun

gordon-gs and others added 4 commits November 1, 2026 16:54
The suggestion bubble only accepts the text into the composer, so sending
a suggestion always costs a second tap on the send button, and accepting
first hides the bubble because it is gated on an empty editor.

Keep the bubble as the accept affordance and add a trailing control that
submits the suggestion directly. The send path reuses the existing
submission handler with an explicit text override, so toast/queue/error
handling stays in one place, and the draft is left untouched — a
half-typed message must never be clobbered by a suggestion.

Covered by the existing prompt-suggestion browser fixture plus a new case
asserting one tap records a send and does not fill the textarea.

iOS, Android and HarmonyOS composers still accept-only; this change
covers the Remote web surface.
Co-authored-by: OpenBitFun <318544290+bitfun-ai@users.noreply.github.com>
@bobleer

bobleer commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Review note: pushed 8cbda7ac2. The send arrow also picked up images pending in the composer, because the suggestion is visible when the text is empty even if images are attached. The explicit suggestion path now sends text only and leaves those images in the draft, with a browser regression test.

Verified locally: type-check, test:prompt-suggestion-browser (4/4, the new test fails without the fix), test:workspace-identity (35/35), i18n:audit. The test:host-queue 'queue stays above' failure you recorded reproduced here with the same values; it is not caused by this PR. Only simulated host IO was exercised, no real device or relay.

@bobleer
bobleer merged commit d74a811 into GCWing:main Nov 2, 2026
9 checks passed
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.

2 participants