#16642

Fix chat input cursor reset on empty AI selections

Openshortontechwants to merge intofrom

Description

Preserve the chat input I-beam when an AI block receives an empty or cleared selection update. Move the unconditional cursor reset in AIBlockAction::SelectText inside the existing non-empty selection guard, retaining reset behavior for actual text selections.

Extend the AI selection regression with cursor assertions for empty, non-empty, and cleared selections. Expose the existing cursor getter through test-util. No temporary tracing is included.

Linked Issue

Closes #16641

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Screenshots or a short video are included.

Draft pending issue triage/readiness.

Testing

  • Extended copy_selected_text_from_ai_block: failed before the fix (Arrow instead of IBeam), passed afterward.
  • cargo +1.96.0 test --locked -p warp --features gui --lib copy_selected_text_from_ai_block — passed.
  • cargo +1.96.0 test --locked -p warpui_core --lib elements::gui::hoverable::tests — 6 passed.
  • Changed Rust files formatted; git diff --check passed.
  • Manually tested the patched local GUI build via cargo run --bin warp-oss --features gui; the reporter confirmed the agent/chat input cursor issue is fixed.

Screenshots / Videos

Not attached.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp AI Agent Mode.

CHANGELOG-BUG-FIX: Preserve the text-selection mouse cursor when clicking the agent chat input.

Co-Authored-By: Warp agent@warp.dev

Help with the CLA would be appreciated.

Activity

9
cla-bot[bot]6d ago

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @shortontech on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

shortontech6d ago

@cla-bot check

cla-bot[bot]6d ago

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @shortontech on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

cla-bot[bot]6d ago

The cla-bot has been summoned, and re-checked this pull request!

shortontech6d ago

Getting the following error attempting to sign the cla.

Sign request failed (500): Failed to record signature. Please try again.

I don't suppose there's some verbal agreement I can leave here?

shortontech6d ago

@cla-bot check

cla-bot[bot]6d ago

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @shortontech on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

cla-bot[bot]6d ago

The cla-bot has been summoned, and re-checked this pull request!