Fix text selection not starting over markdown tables#12841
Open
zachlloyd wants to merge 1 commit into
Open
Conversation
Mark the WarpUI Table's body layer click-through so its row/header background and divider rects (drawn with hit recording) don't make an enclosing SelectableArea treat a mouse-down over the table as covered. Previously, starting a selection inside a table did nothing because SelectableArea bails on a covered LeftMouseDown; dragging in from outside worked because drag events aren't subject to that check. This matches the notebook/editor table, which already marks its paint layer click-through. Co-Authored-By: Oz <oz-agent@warp.dev>
Contributor
|
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 |
Contributor
There was a problem hiding this comment.
Overview
This PR marks the WarpUI table body paint layer as click-through so table chrome no longer prevents the enclosing SelectableArea from receiving mouse-down events that start text selection inside rendered markdown tables.
Concerns
⚠️ [IMPORTANT] For this user-facing behavior change, the attached review context does not include a direct screenshot or screen recording. The description only says the screenshot is attached in the originating Oz conversation, so please attach visual evidence to the PR demonstrating selection starting inside a rendered markdown table.- 💡 [SUGGESTION] Consider adding the deterministic
SelectableArea/Tableregression test described in the PR so this hit-testing path remains covered.
Verdict
Found: 0 critical, 1 important, 1 suggestion
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
zachbai
approved these changes
Jun 19, 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.
Description
Fixes being unable to start a text selection inside a rendered Markdown table in agent output (e.g. clicking and dragging within a table no longer does nothing).
Root cause: The WarpUI
Tablepaints its row/header backgrounds and dividers withdraw_rect_with_hit_recording, in a paint layer above the enclosingSelectableArea. OnLeftMouseDown,SelectableAreabails when the point is "covered" (event.at_z_index(...).is_none()), so a mouse-down that originates over the table never starts a selection. Drag events aren't subject to that coverage check, which is exactly why starting a selection outside the table and dragging in worked, but starting inside the table did nothing.Fix: Mark the
Table's body paint layer click-through (set_active_layer_click_through) so its decorative chrome no longer makes the underlyingSelectableAreatreat the point as covered. This mirrors the notebook/editor table renderer (crates/editor/src/render/element/table.rs), which already marks its paint layer click-through.https://www.loom.com/share/7dd109b714324afb82d08c88adb758e1
Linked Issue
#12751
ready-to-specorready-to-implement.Testing
cargo fmtandcargo clippy -p warpui_core -- -D warningspass.Verified the behavior with computer use using the
table-sampleexample's selection demo (screenshot below): a click-drag that starts inside the table now selects text.Follow-up: a deterministic regression test can be added in
crates/warpui_core/src/elements/table/mod_tests.rs(App::test harness) asserting that aLeftMouseDownover aTableinside aSelectableAreastarts a selection.I have manually tested my changes locally
Screenshots / Videos
Computer-use verification screenshot attached in the originating Oz conversation.
Agent Mode
Conversation: https://staging.warp.dev/conversation/9b55249d-1f57-4c94-87d0-c696c19628bf
Run: https://oz.staging.warp.dev/runs/019ed67b-be88-7b9d-94f4-24714fca3f2e
This PR was generated with Oz.