Skip to content

Fix link/file 'Open link' tooltip not appearing on plain click in Agent Mode#13280

Open
warp-dev-github-integration[bot] wants to merge 4 commits into
masterfrom
factory/link-tooltip-multi-block-anchor
Open

Fix link/file 'Open link' tooltip not appearing on plain click in Agent Mode#13280
warp-dev-github-integration[bot] wants to merge 4 commits into
masterfrom
factory/link-tooltip-multi-block-anchor

Conversation

@warp-dev-github-integration

@warp-dev-github-integration warp-dev-github-integration Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

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 SelectableArea dispatches AIBlockAction::SelectText even for an empty selection (a click, not a drag). SelectText called dismiss_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 meant open_rich_content_link_tool_tip was None by the time the overlay was rendered, so the tooltip never appeared. I confirmed this with temporary runtime tracing: link click handler firedshow_link_tooltip (sets it) → SelectTextdismiss_ai_tooltipsDismissLinkTooltip (clears it), and the overlay-add code never ran.

Fix (primary): In the SelectText handler, 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):

  • Notify the terminal view when the rich-content tooltip visibility changes (ShowLinkTooltip / DismissLinkTooltip / secret equivalents) so the overlay is (re)rendered on the following frame.
  • Give each AI block a per-view-unique tooltip anchor id (tooltip_position_id on DetectedLinksState / 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 warp test suite compile: custom_inference_modal_tests.rs still built a std HashSet for WindowInvalidation.updated, which is now an FxHashSet (from the recent faster-hasher change) — it now collects into the field's type.

Affected files

  • app/src/ai/blocklist/block.rsSelectText empty-selection guard; per-view tooltip id helpers + usage in show_link_tooltip / show_secret_tooltip.
  • app/src/util/link_detection.rstooltip_position_id on DetectedLinksState + resolver; regression test.
  • app/src/ai/blocklist/block/secret_redaction.rstooltip_position_id on SecretRedactionState + 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

  • Regression test: link_tooltip_anchor_ids_are_unique_per_block in app/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_block passes.
  • fmt + clippy: ./script/format --check clean; cargo clippy -p warp --features gui --all-targets --tests -- -D warnings clean.
  • UI verification (computer use, real surface): built and ran the app logged in, created a multi-block Agent Mode conversation with two link-bearing blocks. Before the fix a plain click on a link showed nothing; after the fix a plain click on a link in either block shows (and keeps) the "Open link [Ctrl + Click]" tooltip anchored at the clicked link. Cmd/Ctrl+click still opens directly (no tooltip).

Validation criteria

  • Plain click on a markdown link in a multi-block conversation shows the "Open link [Ctrl + Click]" tooltip.
  • Plain click on a file-path link shows its tooltip; clicking a link in a different block shows that block's tooltip.
  • Cmd/Ctrl+click opens directly with no tooltip.
  • Regression test fails-before / passes-after and guards the per-view anchor id.
  • ./script/presubmit-level checks run locally where feasible (fmt + clippy + crate tests); full workspace nextest runs in CI.
  • Single-block conversations still work.

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.

oz-agent and others added 3 commits July 1, 2026 16:19
…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>
@oz-for-oss

oz-for-oss Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@warp-dev-github-integration

Copy link
Copy Markdown
Contributor Author

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 SelectText).

Plain click on the "beta docs" link in a two-block Agent Mode conversation shows the "Open link [Ctrl + Click]" tooltip

Cmd/Ctrl+click still opens the link directly (no tooltip); ./script/format --check and cargo clippy -p warp --features gui --all-targets --tests -- -D warnings are clean. The same screenshot is also attached in the linked triage thread.

@warp-dev-github-integration

Copy link
Copy Markdown
Contributor Author

/oz-review

…p-multi-block-anchor

# Conflicts:
#	app/src/settings_view/custom_inference_modal_tests.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant