Repository navigation
fix(ai-chat-turbo): drop the virtual-file tray after a send - #264
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked Issue
Closes #263
Change summary
input, so the previous input-only check never fired.value/textContentlength probe gates theinnerTextread, so a long composer is not re-laid-out every frame, and a confirmed short text removes the tray.hasConversionOffer()/dismissConversionOffer(), wire them throughlifecycle.ts, bump ai-chat-turbo-engine to 0.23.14, and document the tray lifecycle and sweep.Verification & Dependencies
pnpm typecheckandpnpm buildpass, and the bundle reports@version 0.23.14.https://chatgpt.com/and reproduced the silent clear (host clears the composer without aninputevent). Four scenarios - click send, Enter send, file-click send, file-Enter send - all ended withtrayAfter:false,textAfter:"",sent:1, and the file cases still carried the token into the sent text.trayAfter:true), confirming the defect and the fix.Review conclusion
innerTextreads, the merged-send preservation, the lifecycle wiring, and the version/documentation consistency.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.