From 5ce8eccb0b5309406ada212c7f3517bc6e079f6b Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 11 Nov 2026 23:17:48 +0000 Subject: [PATCH] A move or Enter key goes to a scoped command only when a scope around the focus binds it binds_scoped took any command outside the app scope that the keymap lookup picked, including other panels' bindings ranked by fallthrough or sharing. A linked set such as the Tour's Left and Right then took the arrows from every roving group that does not act on its moves. Only a command of a scope around the focused chain counts now. --- crates/ui-contract/src/runtime/commands/board.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/ui-contract/src/runtime/commands/board.rs b/crates/ui-contract/src/runtime/commands/board.rs index cf9535bbb..340eb2f92 100644 --- a/crates/ui-contract/src/runtime/commands/board.rs +++ b/crates/ui-contract/src/runtime/commands/board.rs @@ -572,9 +572,12 @@ pub(crate) fn binds_scoped(ctx: &Context, chord: &Chord) -> bool { let scopes = board.scopes_around(&chain); let (panel, outer) = scopes.split_first().map_or((None, &[][..]), |(panel, outer)| (Some(*panel), outer)); let active = Active { panel, contexts: &[], typing: false }; + // The lookup also ranks panels that share with the focused one and, with fallthrough, every other panel: only + // a command of a scope around the focus counts. + let around = |command: &CommandRef| scopes.contains(&board.scope_of(command)); match keymap.lookup_nested(chord, false, &active, outer) { - Lookup::Run(command) => !is_app(board.scope_of(&command)), - Lookup::Cycle(commands) => commands.iter().any(|command| !is_app(board.scope_of(command))), + Lookup::Run(command) => around(&command), + Lookup::Cycle(commands) => commands.iter().any(around), _ => false, } })