Fix desktop clipboard and scroll edge cases - #38109
Closed
LiWithDream wants to merge 1 commit into
Closed
Conversation
LiWithDream
force-pushed
the
fix/desktop-clipboard-scroll
branch
from
June 3, 2026 10:10
b6544a1 to
40865f7
Compare
LiWithDream
force-pushed
the
fix/desktop-clipboard-scroll
branch
from
June 3, 2026 10:15
40865f7 to
8f8d53a
Compare
Author
|
This PR is ready for review. Since it comes from a fork, the required GitHub Actions workflows are awaiting maintainer approval before they can report statuses. I ran the targeted desktop checks locally on Windows 11: Both passed locally. |
Contributor
|
Thanks for the focused desktop regression coverage. This automated hermes-sweeper review found both changes superseded on current
Closing as implemented on main. |
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.
What does this PR do?
Fixes two desktop chat edge cases observed on Windows/Electron:
DataTransfer.itemsandDataTransfer.filesas differentFileobjects.scrollTopupward without an actual user scroll gesture.The clipboard fix dedupes images by stable metadata and only falls back to
clipboard.fileswhenclipboard.itemsdid not provide image blobs. The scroll fix only treats upward scroll movement as user intent when it follows recent wheel/touch input.Related Issue
N/A - no linked issue.
Type of Change
Changes Made
apps/desktop/src/app/chat/composer/text-utils.ts: dedupe pasted image blobs bytype:sizeand avoid double-readingclipboard.fileswhenclipboard.itemsalready yielded images.apps/desktop/src/app/chat/composer/text-utils.test.ts: add regression coverage for duplicate screenshot paste paths.apps/desktop/src/components/assistant-ui/thread-virtualizer.tsx: require recent wheel/touch intent before disarming sticky-bottom due to upwardscrollTopmovement.apps/desktop/src/components/assistant-ui/streaming.test.tsx: add regression coverage for programmatic upward scroll movement while sticky-bottom remains armed.How to Test
npm run test:ui -- src/app/chat/composer/text-utils.test.ts src/components/assistant-ui/streaming.test.tsx.npm run type-check.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) - N/Acli-config.yaml.exampleif I added/changed config keys - N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows - N/AScreenshots / Logs
Targeted test output:
Also verified
npm run type-checkpasses.