Files
archived-orca/src
Brennan Benson 6e2b5a98ad Cmd/Ctrl+Enter sends the first queued card after a Stop (#38877)
* feat(native-chat): holding Cmd/Ctrl turns Send into what Cmd/Ctrl+Enter will do

While the chord's modifier is held alone in a busy chat's composer, Send
becomes a labelled Steer, Queue or Steer queued button, and with an empty
composer the queued card it would steer is highlighted. Releasing the key,
pressing any other key, leaving the composer or the window clears it.

* fix(native-chat): the held-Cmd preview promises only what Cmd/Ctrl+Enter will do

The queue offers its head-card steer only while that card can go (not
being edited, no steer already on its way), Shift or Alt held first and an
open picker show no preview, and a draft Send can't take keeps its button
and reason. The card highlight follows the composer's Steer queued button
in CSS, dropping the state and callback that carried it.

* fix(native-chat): only the composer holding a preview listens for window blur

Every busy chat's composer added window and document listeners; now only
the one showing a held-Cmd preview does, and a hold that outlasts a Cmd+Tab
never shows.

* fix(native-chat): use the Button's own size for the held-Cmd pill, and clear its timer in cleanup

* fix(native-chat): no held-Cmd preview while an IME composes

The IME owns Enter during composition, so the chord shows nothing then. The
listener-count test goes: the work it guarded no longer exists.

* test(native-chat): clean up between held-Cmd preview tests

* fix(native-chat): the held-Cmd delay timer lives in its own effect

The key listener records whether the modifier is down; a separate effect
owns the delay's timer and its cleanup, as React Doctor requires.

* fix(native-chat): a double-click on the held-Cmd button acts once

Sending a draft can turn the button into Steer queued before the second
press, which would steer a queued card the person never chose.

* fix(native-chat): the held-Cmd button is a pill as tall as Send

* fix(native-chat): Cmd/Ctrl+Enter sends the first queued card after a Stop, as steering does mid-turn

* test(native-chat): pin which composers send the head card on an empty Cmd/Ctrl+Enter; goal mode never does

* test(native-chat): the send-state resolver takes only the transport fields it reads, so its test needs no cast
2026-11-06 01:14:09 -08:00
..