Fix link/file 'Open link' tooltip not appearing on plain click in Agent Mode#13280
Fix link/file 'Open link' tooltip not appearing on plain click in Agent Mode#13280warp-dev-github-integration[bot] wants to merge 4 commits into
Conversation
…ersations Rich-content link and secret tooltips anchored their overlay to a single global save-position id. With 2+ rich-content blocks in a conversation, those anchors collided across blocks, so the tooltip overlay could not position itself on the clicked link/secret and no confirmation tooltip appeared (a plain click looked like it did nothing). Single-block conversations were unaffected. Give each AI block a per-view-unique anchor id (`tooltip_position_id` on DetectedLinksState / SecretRedactionState), set when the tooltip is shown and read at the save-position registration sites, so distinct blocks never collide. Co-Authored-By: Warp <agent@warp.dev>
…_tests WindowInvalidation.updated became an FxHashSet (faster-hasher change), but this test still constructed a std HashSet, breaking the warp test build on master. Collect into the field's type instead so the suite compiles. Co-Authored-By: Warp <agent@warp.dev>
Root cause of the tooltip not appearing on a plain click: the AI block's SelectableArea dispatches AIBlockAction::SelectText even for an EMPTY selection (a plain click, not a drag). SelectText called dismiss_ai_tooltips, which cleared the link/secret tooltip that the same click had just opened -- so the overlay was never rendered. This was most visible once a conversation had multiple blocks. Only treat SelectText as a real selection (and dismiss open tooltips) when there is actually a non-empty selection. Also notify the terminal view when the rich-content tooltip visibility changes so the overlay is (re)rendered. Verified via computer use on a running multi-block conversation: a plain click on a markdown/file link now shows and keeps the "Open link [Ctrl + Click]" tooltip; Cmd/Ctrl+click still opens directly. Co-Authored-By: Warp <agent@warp.dev>
|
@warp-dev-github-integration[bot] I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR updates Agent Mode rich-content link and secret tooltip handling so plain clicks preserve the tooltip, per-block anchor IDs avoid cross-block collisions, and terminal rendering is notified when tooltip visibility changes. I also reviewed the attached spec context and there is no approved or repository spec to compare against; the supplemental security pass found no security issues.
Concerns
- For this user-facing tooltip behavior change, please include screenshots or a short screen recording demonstrating it working end to end. The PR description includes textual UI verification, but the repository review guidance requires attached visual evidence for UI/behavior changes.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
Thanks for the review! Adding the requested visual evidence for this UI/behavior change. Verified via computer-use on a locally built app in a multi-block Agent Mode conversation (two response blocks, each with a link). A plain left-click on a markdown link now shows — and keeps — the "Open link [Ctrl + Click]" confirmation tooltip anchored directly above the clicked link. Before the fix, a plain click did nothing (the tooltip was dismissed by the same click's empty-selection Cmd/Ctrl+click still opens the link directly (no tooltip); |
|
/oz-review |
…p-multi-block-anchor # Conflicts: # app/src/settings_view/custom_inference_modal_tests.rs
![Plain click on the "beta docs" link in a two-block Agent Mode conversation shows the "Open link [Ctrl + Click]" tooltip](https://raw.githubusercontent.com/warpdotdev/warp/factory/link-tooltip-evidence/pr-13280-tooltip-fix.png)
Description
Clicking a highlighted link or file path in Agent Mode output did nothing on a plain (non-modifier) click — the "Open link [Ctrl + Click]" confirmation tooltip that used to appear no longer showed. This reproduced reliably once a conversation had more than one rich-content block (i.e. virtually every real conversation); a fresh single-block conversation sometimes appeared to work.
Root cause: On a plain click, the AI block's enclosing
SelectableAreadispatchesAIBlockAction::SelectTexteven for an empty selection (a click, not a drag).SelectTextcalleddismiss_ai_tooltips, which cleared the link/secret tooltip that the same click had just opened via the link click handler. The set-then-immediately-dismissed sequence meantopen_rich_content_link_tool_tipwasNoneby the time the overlay was rendered, so the tooltip never appeared. I confirmed this with temporary runtime tracing:link click handler fired→show_link_tooltip(sets it) →SelectText→dismiss_ai_tooltips→DismissLinkTooltip(clears it), and the overlay-add code never ran.Fix (primary): In the
SelectTexthandler, only treat it as a real selection — and only dismiss open link/secret tooltips — when there is actually a non-empty selection. A plain click (empty selection) no longer clobbers the tooltip it just opened.Fix (supporting):
ShowLinkTooltip/DismissLinkTooltip/ secret equivalents) so the overlay is (re)rendered on the following frame.tooltip_position_idonDetectedLinksState/SecretRedactionState) instead of a single global save-position id. This removes a latent cross-block anchor collision so the overlay always anchors to the clicked block's link. (This was the originally-specced direction; investigation during implementation showed the empty-selection dismiss above was the actual cause of the invisible tooltip.)Also includes one small unrelated fix required to make the
warptest suite compile:custom_inference_modal_tests.rsstill built a stdHashSetforWindowInvalidation.updated, which is now anFxHashSet(from the recent faster-hasher change) — it now collects into the field's type.Affected files
app/src/ai/blocklist/block.rs—SelectTextempty-selection guard; per-view tooltip id helpers + usage inshow_link_tooltip/show_secret_tooltip.app/src/util/link_detection.rs—tooltip_position_idonDetectedLinksState+ resolver; regression test.app/src/ai/blocklist/block/secret_redaction.rs—tooltip_position_idonSecretRedactionState+ resolver.app/src/ai/blocklist/block/view_impl.rs— register per-view anchor ids at the save-position sites.app/src/terminal/view.rs— notify on rich-content tooltip visibility changes.app/src/settings_view/custom_inference_modal_tests.rs— unrelated test-build fix.Testing
link_tooltip_anchor_ids_are_unique_per_blockinapp/src/util/link_detection_tests.rs— asserts distinct blocks resolve to distinct tooltip anchor ids.cargo test -p warp --features gui link_tooltip_anchor_ids_are_unique_per_blockpasses../script/format --checkclean;cargo clippy -p warp --features gui --all-targets --tests -- -D warningsclean.Validation criteria
./script/presubmit-level checks run locally where feasible (fmt + clippy + crate tests); full workspace nextest runs in CI.Conversation: https://staging.warp.dev/conversation/9eb52f26-8501-484b-9166-04f8f6e79212
Run: https://oz.staging.warp.dev/runs/019f19a0-3de0-7d8b-892f-54d74d866776
This PR was generated with Oz.