Repository navigation
fix(bots): keep attachment previews open on hover - #516
Merged
Merged
Conversation
Keep the selected editor attachment stable across pointerover events on the same chip. A preview that grows after loading can cross the pointer; selecting its anchor again tore down the hover listeners and closed it. Both bot and thread composers already share this preview component. Fixes: #398
This was referenced Nov 13, 2026
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.
Hovering an attachment in the bot composer could briefly flash a preview and close it while the pointer stayed on the chip. Keep the selected attachment and anchor stable when pointerover reaches the same chip again.
Bot and thread composers already use the same
EditorAttachmentPreviewandAttachmentPreview. When loaded content increases the card's height, the card can briefly cross the pointer before repositioning. Returning to the chip recreatedselected, reran the anchor effect and closed the preview during cleanup. Pointer movement between the chip's icon and text had the same failure path. The shared component now updates selection only for a different chip or attachment key. Existing 300 ms open / 180 ms close delays, keyboard focus, Escape, viewers and motion tokens are preserved.Validation:
bun install --frozen-lockfile,bun run typecheck,bun run lint,bun run format,bun run format:check, andbun run --filter @canopy/web buildpassed. No UI tests were added or run./var/tmp/canopy-bot-attachment-hover/.6ddec9ef559ee0095ac33e94ff9418a942053b17; Android5f6eae3ab278f1cd543e9ed763f923a319b65ec9. Native mobile already sharesAttachmentChipsbetween bots and threads. No native or mobile source changes.Native device interaction remains unverified: device support twice returned “Could not communicate with device support. Try refreshing devices.” Phone-width browser interaction was checked. Full integration/temporary-directory checks and generated-contract checks were left to CI; this change only touches the shared web editor preview. Copy audit: no UI copy changed.
The faulty selection assignment was introduced by the attachment-preview implementation in #398; verified in its original diff. Bot attachment PRs reused that component.
Fixes: #398
Related: #449, #469