Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
3746554
fix(macos): bound the open-menu search like a skeleton and keep a rai…
lahfir Nov 16, 2026
3a16e7c
feat(macos): close an open menu or popover with Escape in the background
lahfir Nov 16, 2026
beeb601
fix: name a ref that carries its snapshot id twice and the zsh modifi…
lahfir Nov 16, 2026
92e9d87
fix(macos): list the floating and panel windows an app raises while t…
lahfir Nov 16, 2026
0a80e01
feat(linux): close the open popup of a background window with Escape
lahfir Nov 16, 2026
e61f29f
feat(windows): close the open popup of a window that is not in front …
lahfir Nov 16, 2026
14f6958
fix(linux): read the popup owner's reply when Escape closes a popup
lahfir Nov 16, 2026
f90462f
fix(macos): fail a cell write the cell did not take
lahfir Nov 16, 2026
ac20c5b
fix(macos): read a written cell back by its observed name
lahfir Nov 16, 2026
cb48143
fix: keep the @ in the zsh ref hint
lahfir Nov 17, 2026
e36a449
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 20, 2026
1327ca2
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 20, 2026
e3c601f
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 20, 2026
88cd217
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 20, 2026
e69a341
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 20, 2026
9ea546d
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 20, 2026
2dc4c32
fix(linux): refuse background Escape unless the popup owner exposes a…
lahfir Nov 20, 2026
648c7a6
fix(windows): bound background Escape popup scan by deadline and node…
lahfir Nov 20, 2026
38a4bf7
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 20, 2026
b81c862
fix(linux): leave an Escape close unverified when the popup cannot be…
lahfir Nov 20, 2026
5188b3c
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 20, 2026
540624c
fix(macos): never report no popover after a search that left list ite…
lahfir Nov 20, 2026
1398f81
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 20, 2026
59dab24
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 21, 2026
b7c29ea
fix(windows): verify window and process ownership before popup collapse
lahfir Nov 21, 2026
8aec4bf
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 23, 2026
1ca4072
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 23, 2026
d8b8917
fix: find popovers inside wide content and close a window's open surface
lahfir Nov 23, 2026
ec5c28b
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 23, 2026
78b2f8e
fix: trim supported_surfaces doc to keep the windows adapter under th…
lahfir Nov 24, 2026
cb7e538
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 24, 2026
b5a86b9
fix(linux,macos): preserve process generation through Escape surface …
lahfir Nov 24, 2026
e137d4e
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 25, 2026
1ca7062
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 25, 2026
f887c86
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 25, 2026
5f01068
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 25, 2026
c97aa0b
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 25, 2026
4261f43
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 25, 2026
8c2df2d
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 25, 2026
a20f23e
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 25, 2026
94698dd
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 25, 2026
789c0f2
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 25, 2026
a9c422f
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 25, 2026
45240bb
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 25, 2026
43d8b2a
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 25, 2026
f63e4dc
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 25, 2026
ae9f062
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 25, 2026
ddf035e
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 26, 2026
50cd600
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 26, 2026
9b2ee87
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 26, 2026
c183d99
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 26, 2026
9fc5d7e
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 27, 2026
69d0786
fix(macos): match AXSubrole popovers on Escape, cap Escape surface pr…
lahfir Nov 27, 2026
20b7898
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 27, 2026
7b62d02
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 27, 2026
bd3549f
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 27, 2026
90a1d30
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 27, 2026
139f755
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 27, 2026
8496ce1
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 27, 2026
3d03702
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 27, 2026
51df0ac
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 27, 2026
261fd88
Merge branch 'laf/reliability-14-tabular-surfaces' into laf/reliabili…
lahfir Nov 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/docs/content/docs/json-output.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ An error envelope has `error` and no `data`:
"error": {
"code": "INVALID_ARGS",
"message": "Invalid ref_id '@e1': expected @<snapshot_id>:e<N>",
"suggestion": "Use the snapshot-qualified ref that snapshot prints, for example @s8f3k2p9:e1. A bare @eN ref is not accepted.",
"suggestion": "Use the snapshot-qualified ref that snapshot prints, for example @s8f3k2p9:e1. A bare @eN ref is not accepted. Pass ref_id as printed: it already holds the snapshot id. In zsh write \"@${SID}:e1\", because an unbraced @$SID:e1 reads :e as a modifier.",
"disposition": { "delivery": "not_delivered", "retry": "safe" }
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/snapshots-and-refs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Every command accepts only this qualified form. A bare `@e6` fails with `INVALID
"error": {
"code": "INVALID_ARGS",
"message": "Invalid ref_id '@e1': expected @<snapshot_id>:e<N>",
"suggestion": "Use the snapshot-qualified ref that snapshot prints, for example @s8f3k2p9:e1. A bare @eN ref is not accepted.",
"suggestion": "Use the snapshot-qualified ref that snapshot prints, for example @s8f3k2p9:e1. A bare @eN ref is not accepted. Pass ref_id as printed: it already holds the snapshot id. In zsh write \"@${SID}:e1\", because an unbraced @$SID:e1 reads :e as a modifier.",
"disposition": { "delivery": "not_delivered", "retry": "safe" }
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
use crate::adapter::SystemOps;
//! Key delivery to a named window, gated on that window holding the focus.

use crate::{
ActionResult, AdapterError, ErrorCode, InteractionLease, InteractionPolicy, KeyCombo,
ProcessIdentity, WindowInfo,
ProcessIdentity, WindowInfo, adapter::SystemOps,
};

/// The refusal for a key press whose named window could not be confirmed as
/// the focused one, with nothing sent.
pub(super) fn exact_focus_unconfirmed(
window: &WindowInfo,
policy: InteractionPolicy,
) -> AdapterError {
fn exact_focus_unconfirmed(window: &WindowInfo, policy: InteractionPolicy) -> AdapterError {
AdapterError::new(
ErrorCode::ActionFailed,
"The named window does not hold keyboard focus; no key was sent",
Expand All @@ -26,9 +24,11 @@ pub(super) fn exact_focus_unconfirmed(
.with_disposition(crate::DeliverySemantics::not_delivered())
}

/// Delivers `combo` to the process of `window` only after the window reads
/// back as the focused one with the stored process instance.
pub(super) fn press_in_exact_window<A: SystemOps + ?Sized>(
/// Sends `combo` to the process of `window` only when `window` is the exact
/// focused window, and refuses before anything is sent otherwise. This is the
/// default of `SystemOps::press_key_for_window`; an adapter that overrides
/// that method to add a route after the refusal calls it first.
pub fn press_key_in_focused_window<A: SystemOps + ?Sized>(
adapter: &A,
window: &WindowInfo,
combo: &KeyCombo,
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/adapter/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pub(crate) mod actions;
pub(crate) mod adapter_session;
pub(crate) mod focused_window_key;
pub mod hit_test;
pub(crate) mod input;
pub mod live_element;
Expand All @@ -12,7 +13,6 @@ pub(crate) mod surface_opening;
pub(crate) mod system;
#[cfg(test)]
mod test_support;
mod window_key_refusal;

pub(crate) use actions::ActionOps;
pub(crate) use input::InputOps;
Expand Down
7 changes: 4 additions & 3 deletions crates/core/src/adapter/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,17 @@ pub trait SystemOps: Send + Sync {
Err(AdapterError::not_supported("press_key_for_app"))
}

/// Checks the exact focused window before process-scoped key delivery;
/// adapters can override it to keep the window identity through their gates.
/// Checks the exact focused window before process-scoped key delivery
/// (`press_key_in_focused_window`). Adapters can override this to retain
/// the window identity through their native delivery gates.
fn press_key_for_window(
&self,
window: &WindowInfo,
combo: &KeyCombo,
policy: InteractionPolicy,
lease: &InteractionLease,
) -> Result<ActionResult, AdapterError> {
super::window_key_refusal::press_in_exact_window(self, window, combo, policy, lease)
super::focused_window_key::press_key_in_focused_window(self, window, combo, policy, lease)
}

fn wait_for_menu(
Expand Down
1 change: 1 addition & 0 deletions crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub use actions::step_mechanism::StepMechanism;
pub use adapter::PlatformAdapter;
pub use adapter::actions::ActionOps;
pub use adapter::adapter_session::AdapterSession;
pub use adapter::focused_window_key::press_key_in_focused_window;
pub use adapter::hit_test::HitTestResult;
pub use adapter::input::InputOps;
pub use adapter::live_element::LiveElement;
Expand Down
6 changes: 4 additions & 2 deletions crates/core/src/refs/ref_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub(crate) fn resolve_ref_target(ref_id: &str) -> Result<(String, String), AppEr
let Some((snapshot_id, element_number)) = without_at.rsplit_once(":e") else {
return Err(invalid_ref(ref_id));
};
validate_snapshot_id(snapshot_id)?;
validate_snapshot_id(snapshot_id).map_err(|_| invalid_ref(ref_id))?;
let local_ref = format!("@e{element_number}");
if !is_local_ref(&local_ref) {
return Err(invalid_ref(ref_id));
Expand Down Expand Up @@ -52,10 +52,12 @@ fn is_local_ref(ref_id: &str) -> bool {
})
}

const REF_SUGGESTION: &str = "Use the snapshot-qualified ref that snapshot prints, for example @s8f3k2p9:e1. A bare @eN ref is not accepted. Pass ref_id as printed: it already holds the snapshot id. In zsh write \"@${SID}:e1\", because an unbraced @$SID:e1 reads :e as a modifier.";

fn invalid_ref(ref_id: &str) -> AppError {
AppError::invalid_input_with_suggestion(
format!("Invalid ref_id '{ref_id}': expected @<snapshot_id>:e<N>"),
"Use the snapshot-qualified ref that snapshot prints, for example @s8f3k2p9:e1. A bare @eN ref is not accepted.",
REF_SUGGESTION,
)
}

Expand Down
17 changes: 17 additions & 0 deletions crates/core/src/refs/ref_token_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,20 @@ fn syntax_validation_accepts_only_the_qualified_form() {
assert!(validate_ref_token("@sabc:e").is_err());
assert!(validate_ref_token("sabc:e1").is_err());
}

#[test]
fn a_ref_prefixed_twice_is_named_as_a_ref_with_the_same_suggestion() {
let error = resolve_ref_target("@sabc:@sabc:e7").unwrap_err();

assert_eq!(error.code(), "INVALID_ARGS");
assert!(
error
.to_string()
.contains("Invalid ref_id '@sabc:@sabc:e7'")
);
assert!(
error
.suggestion()
.is_some_and(|s| s.contains("already holds"))
);
}
2 changes: 1 addition & 1 deletion crates/linux/src/actions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub(crate) mod live;
pub(crate) mod native_menu;
pub(crate) mod physical_target;
mod popup_verify;
mod process_check;
pub(crate) mod process_check;
pub(crate) mod scroll;
pub(crate) mod select;
pub(crate) mod toggle_state;
Expand Down
Loading
Loading