Skip to content

fix: focus the tile pane when clicking its empty canvas (0.8.3-beta1) - #4

Merged
piranout merged 2 commits into
mainfrom
cursor/tile-pane-canvas-focus-9366
Aug 21, 2026
Merged

fix: focus the tile pane when clicking its empty canvas (0.8.3-beta1)#4
piranout merged 2 commits into
mainfrom
cursor/tile-pane-canvas-focus-9366

Conversation

@piranout

Copy link
Copy Markdown
Contributor

What

Usability bug: after clicking a folder in the tree, a click on the empty canvas of the tile/contents pane did not move keyboard focus. Arrows, PageUp/PageDown, and scroll keys stayed on the tree. Clicking a tile already transferred focus (the ListBoxItem focuses itself). Canvas should do the same.

Cause (verified): the ListBox is Focusable, but WPF only focuses a tile because ListBoxItem calls Focus() on mouse-down. An empty-canvas click hits chrome that never claims keyboard focus, so the tree keeps it. Not a missing Focusable flag on the ListBox itself.

Fix (pane-level): BrowserHost is hit-testable (Background="Transparent") and handles PreviewMouseLeftButtonDown. Canvas clicks call ItemsList.Focus(). One decision path (LibraryPaneFocus) skips:

  • tiles (they already focus the item)
  • section headers (ToggleButton already focuses)
  • text boxes (search / rename / notes keep the caret)
  • dialogs

Tree-click behavior is unchanged (handler is only on the contents pane). Tile-click behavior is unchanged.

Version is 0.8.3-beta1 in Aperture.App.csproj so merge re-exercises the auto-tag/release path. CHANGELOG has ## [0.8.3-beta1].

How to test

  1. dotnet test tests/Aperture.Core.Tests/Aperture.Core.Tests.csproj — includes LibraryPaneFocusTests (the claim/skip contract). Live WPF focus is not unit-tested (no dispatcher circus).
  2. Manual click path (this is the real check):
    1. Click a folder in the tree. Arrow / PageUp / PageDown should still move the tree.
    2. Click a tile. Arrow / Page / scroll keys should move the grid. (Unchanged.)
    3. Click a folder again, then click the empty canvas of the tile pane (not a tile, not a section header). Arrow / PageUp / PageDown / scroll keys should now move the grid, not the tree.
    4. Click a section header if one is visible — Left/Right should still expand/collapse as today.
    5. Type in search (or open Tags & notes). Canvas-click handler must not yank focus from those; clicking the canvas after leaving them should focus the grid the same way a tile click does.

Notes

  • No CI/signing rewrite, visibility unchanged.
  • After merge, auto-tag should create v0.8.3-beta1.
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 21, 2026 21:36
A tile click already focused the ListBoxItem, so arrows and PageUp/PageDown
moved the grid. A click on the empty canvas did not, and the folder tree
kept keyboard focus. Claim focus at the contents-pane level on canvas
clicks; leave tiles, section headers, text boxes, and dialogs alone.

Version 0.8.3-beta1 so merge re-exercises auto-tag/release.

Co-authored-by: Paul Smith <piranout@users.noreply.github.com>
CS0051: xUnit theories are public, so the Hit enum cannot appear in the
signature. Split into facts that use the enum only inside the body.

Co-authored-by: Paul Smith <piranout@users.noreply.github.com>
@piranout
piranout merged commit 65d5bf6 into main Aug 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants