From 0811adbfa7ee87c960a80d2c8e798f9665270a39 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 28 Nov 2026 00:34:12 +0000 Subject: [PATCH] Presenter View takes unfocused keys; Select All in the thumbnails pane follows the board's target The presenter window turns on ViewportWindow::takes_unfocused_keys, so G with nothing focused toggles the Presenter View's own grid. The thumbnails pane selects every slide when the board delivers Select All to it (the pane declares the command and holds the focus), instead of comparing against the innermost pane instance. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/panels/thumbs.rs | 8 ++++---- crates/ui-egui/src/show/presenter.rs | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/panels/thumbs.rs b/crates/ui-egui/src/panels/thumbs.rs index c39cae673..461457a60 100644 --- a/crates/ui-egui/src/panels/thumbs.rs +++ b/crates/ui-egui/src/panels/thumbs.rs @@ -9,7 +9,7 @@ use craft::ui::contract::{ use craft::ui::display::Divider; use craft::ui::list::{List, ListRow, ThumbAspect, ThumbSize}; use craft::ui::menu::{Menu, MenuItem}; -use craft::ui::runtime::commands::{CommandAccess as _, CommandRef, CommandState, Commands as _, EditCommands}; +use craft::ui::runtime::commands::{CommandRef, CommandState, Commands as _, EditCommands}; use craft::ui::runtime::env::Env; use craft::ui::tile_grid::{CaptionPlace, ColumnRule, GridEvent, TailRow, Tile, TileGrid, TileGroup, TileMark}; use deckcraft_engine::Target; @@ -142,10 +142,10 @@ pub(crate) fn body(app: &mut SlideApp, ui: &mut Ui, cx: &mut BodyCx<'_>) { _ => {} } } - // The board drains commands once. Only the command targeted at this pane changes its selection scope; - // app commands fall through to the same run path the editor root uses. + // The board drains commands once. A Select All with the focus in the pane is delivered to the pane, which + // declares it, and selects slides; app commands fall through to the same run path the editor root uses. while let Some((command, fired)) = cx.take_command::() { - if command == EditCommands::SelectAll && fired.target.is_some() && fired.target == cx.command_chain().innermost("pane") { + if command == EditCommands::SelectAll && fired.target.is_some() { let _ = app.run("edit.selectAll", json!({"scope": "slides"})); } else { app.fire(ui.ctx(), &fired); diff --git a/crates/ui-egui/src/show/presenter.rs b/crates/ui-egui/src/show/presenter.rs index 60faac44a..aa7a3ff44 100644 --- a/crates/ui-egui/src/show/presenter.rs +++ b/crates/ui-egui/src/show/presenter.rs @@ -136,6 +136,7 @@ pub(super) fn presenter_pass(ui: &mut Ui, app: &mut crate::SlideApp, show: &mut }; ViewportWindow::new(Word::plain("Presenter View — DeckCraft")) .overlay(|overlay| overlay.size(egui::vec2(1100.0, 700.0))) + .takes_unfocused_keys() .show(ui, |ui, cx| { if !craft::ui::runtime::measure::active(ui.ctx()) { viewport = Some(ui.ctx().viewport_id());