Skip to content

fix(windows): capture the selected quote before a mouse press moves focus - #7365

Open
M4n5ter wants to merge 1 commit into
mainfrom
fix/windows-quote-selection
Open

M4n5ter wants to merge 1 commit into
mainfrom
fix/windows-quote-selection

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Nov 27, 2026

Copy link
Copy Markdown
Member

Summary

On Windows, clicking Quote selection on a read-only message containing a session reference moved focus away from the editor before the button received PressDown. By then the button had lost the selected word and quoted the entire message. Deliver PressDown to the mouse control before its default focus transfer so the button can capture the selection.

The quote fixture also waits for the workbench to finish each turn before starting the next one. It observes Stop response with the mock reply still open, closes the reply, then waits for the control to disappear. This handles the interval in which the provider connection has closed but the composer still treats a submission as steering.

Refs #7355

Verification

  • The first Windows run sent the whole token line twice. A separate Windows run on main timed out waiting for the token message to reach the provider. Excerpt assertion failure · Provider timeout
  • Ran the two native desktop tests on an isolated Windows VM at c4d16b9683, based on 195d3105ec. The quote test checks the decoded provider request. After an explicit click into the composer the excerpt is [@Ref](maka://session/s_ref_1) TARGET_TOKEN_WORD. After selecting the word again and clicking Quote selection, the excerpt is exactly TARGET_TOKEN_WORD.
test terminal::desktop_new_session::desktop_quotes_a_message_into_the_current_session ... ok
test terminal::desktop_new_session::desktop_external_agent_satisfies_new_session_connection_prompt ... ok
  • The same quote fixture passed on macOS at the PR commit. Stable rustfmt checked both changed files, and git diff --check passed.

AI use

  • Generative tooling made a substantive contribution

OpenAI Codex traced the focus and selection events, edited the Windows input handler and desktop fixture, ran the native tests, and drafted this PR.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a breaking change or persisted-data migration?

  • No

Does this PR entail a change in behavior?

  • Yes — clicking Quote selection on Windows sends the selected passage.

…ocus

Dispatch PressDown on a mouse control before the default focus transfer clears the editor selection. In the quote fixture, wait for the workbench to finish each preceding turn before composing the next message.

Generated-by: OpenAI Codex
@github-actions github-actions Bot added the effort/M Under 500 readable lines label Nov 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant