Skip to content

fix(ai-chat-turbo): drop the virtual-file tray after a send - #264

Merged
CYoJkoY merged 1 commit into
mainfrom
issue-263-virtual-file-tray-after-send
Nov 28, 2026
Merged

CYoJkoY merged 1 commit into
mainfrom
issue-263-virtual-file-tray-after-send

Conversation

@CYoJkoY

@CYoJkoY CYoJkoY commented Nov 28, 2026

Copy link
Copy Markdown
Owner

Linked Issue

Closes #263

Change summary

  • Dismiss the prompt-only virtual-file tray ("文本转文件" / "转文本") when the composer is cleared by the site after a send. The host clears the editor silently, without dispatching input, so the previous input-only check never fired.
  • Let the tracking loop sweep the prompt-only tray while no virtual files are pending: a cheap value / textContent length probe gates the innerText read, so a long composer is not re-laid-out every frame, and a confirmed short text removes the tray.
  • Recognise send controls on the click path even when only the offer is on screen, dismiss it, and let the click through unchanged instead of returning early.
  • Keep the existing merged-send behaviour: pending virtual files still fuse into the message and are unaffected.
  • Add hasConversionOffer() / dismissConversionOffer(), wire them through lifecycle.ts, bump ai-chat-turbo-engine to 0.23.14, and document the tray lifecycle and sweep.

Verification & Dependencies

  • All 57 test files / 877 tests pass; pnpm typecheck and pnpm build pass, and the bundle reports @version 0.23.14.
  • New regression cases cover the silent-clear disappearance and the long-text retention guard in the virtual-file suite, plus the offer-only send click in the send suite.
  • Browser evidence: an Edge headless + CDP harness intercepted https://chatgpt.com/ and reproduced the silent clear (host clears the composer without an input event). Four scenarios - click send, Enter send, file-click send, file-Enter send - all ended with trayAfter:false, textAfter:"", sent:1, and the file cases still carried the token into the sent text.
  • Control run: the 0.23.13 bundle built from the same harness left the tray visible after click and Enter sends (trayAfter:true), confirming the defect and the fix.
  • No new runtime dependencies and no new network endpoints. The harness page was a controlled simulation, not a logged-in ChatGPT session.

Review conclusion

  • Reviewed head: 6c52035.
  • Single-agent source review: PASS, calculated score 5.00/5.00 from zero confirmed findings. No unresolved P0, P1, P2, P3, or P4 findings. This is not an independent review attestation.
  • Reviewed the dismissal path, the length-probe guard against per-frame innerText reads, the merged-send preservation, the lifecycle wiring, and the version/documentation consistency.
  • C1: explicit element and text guards; C2: spaces only; C3: new control flow stays within two levels; C4: early exits on empty text; C5: existing tracking loop reused; C6: focused helpers with narrow parameters; C7: existing typed config reused, with no new tunable business data.

Permission Notice

This change is limited to the ai-chat-turbo-engine composer tray lifecycle and its send click handling. It adds no grants, network endpoints, telemetry, or outgoing message writes. No user content is collected or transmitted.

The prompt-only tray (the "文本转文件" offer shown for long composer
text) outlived the message it belonged to. It was only re-checked on
`input`, and the hosts clear the composer on send without dispatching
one; the 90ms tracking loop skipped the text check whenever the cached
editor was still painted; and a send click was ignored entirely when no
virtual files were pending, so the click never reached the dismissal.

Retire the offer from both sides. The click path now recognises send
controls while only the offer is on screen, dismisses it, and lets the
click through to the site unchanged. The tracking loop sweeps the
prompt-only tray when there are no pending files: a cheap `value` /
`textContent` length probe gates the `innerText` read, so a long
composer is never re-laid-out every frame, and a confirmed short text
removes the tray. Pending files keep their previous behaviour and are
still fused into the message.

Refs: #263
@CYoJkoY
CYoJkoY merged commit be56e5e into main Nov 28, 2026
1 check passed
@CYoJkoY
CYoJkoY deleted the issue-263-virtual-file-tray-after-send branch November 28, 2026 14:08
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.

fix(ai-chat-turbo): 消息发送后输入框上方的虚拟文件托盘不消失

1 participant