Skip to content

Fix file-tree comment shortcut and bounded scroller - #3556

Merged
leaf-agent merged 3 commits into
mainfrom
fix/issue-3552
Oct 22, 2026
Merged

leaf-agent merged 3 commits into
mainfrom
fix/issue-3552

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

The file-tree corpus sweep typed cW into tree search because Pierre Trees consumed Leaf’s c comment shortcut before the page command saw it. Leaf now resolves shortcut characters before a nested widget handles them, while Enter and Escape still reach the focused control first. From a tree row, c opens the comment composer and keeps its draft through the scroll sweep.

The same corpus cases also found the tree’s intentional viewport scroller undeclared: its height marker was on the host, but that registered CSS property does not inherit. The viewport now declares it directly.

The focused file-tree interaction test failed before the keyboard change and passes now. Both file-tree corpus cases pass, along with 522 runtime tests and the browser bundle check. A base/candidate browser probe confirmed the comment route and found the same startup request counts.

Closes #3552 — automated triage

Let Leaf resolve page shortcut characters before the tree treats them as search seeds, while keeping Enter and Escape with the focused control. Mark the tree viewport as an intentional bounded scroller; the host declaration cannot inherit through the registered CSS property.

The focused file-tree browser test fails before the keyboard change and passes after it. Both file-tree corpus cases pass with their typed-box and held-scroller checks.

Closes #3552
The listener inventory guards against key handlers outside the command register. The keyboard controller now uses capture for shortcut characters and bubble for other keys, both through that register, so count both owned listeners.

Refs #3552
Apply the repository-pinned Prettier layout to the capture listener and rebuild the committed kernel so the pre-commit gate leaves no diff.

Refs #3552
@leaf-agent
leaf-agent merged commit ba51545 into main Oct 22, 2026
4 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-3552 branch October 22, 2026 15:05
leaf-agent added a commit that referenced this pull request Oct 22, 2026
The browser keyboard test now observes `?` during capture and navigation
keys during bubbling. #3556 moved character shortcuts to a capturing
listener that stops propagation after handling them, so the test's
former bubbling observer missed its `?` positive control. Keeping
navigation keys in bubble lets the test detect a cancellation by focused
content.

The focused browser test passes (`uv run pytest
tests/browser/drafts/test_keys.py::test_global_shortcuts_leave_other_browser_navigation_keys_alone
-q -n 0`). This PR changes only the test; runtime keyboard behavior is
unchanged.

---------

Co-authored-by: leaf-agent <[email protected]>
max-sixty pushed a commit that referenced this pull request Nov 19, 2026
`test_file_tree_reads_standalone_data_without_a_diff_package` fails
deterministically on `main` since #6469, which first failed in [run
44455882413](https://github.com/max-sixty/leaf/actions/runs/44455882413)
(`9192a5041`). #6469 gives letters typed in a type-ahead widget to that
widget, which Max chose on the key-reading review page. So `c` on a
selected file-tree row now types into the tree's search. The test still
pressed `c` on the row and waited for the composer, a step #3556 added
when Leaf took shortcut letters ahead of the tree. The wait times out.
The `c` it types also filters `README.md` out of the tree, which would
break the steps after it.

This PR removes that step. #6469's own check in
`test_render_files.py::test_a_file_tree_opens_each_file_the_editor_holds`
covers the new behavior: a letter on a row searches the tree. The test
keeps its subject, which is the tree reading standalone data and keeping
its selection and search across a data change. No product code changes,
and nothing of #6469's intent is given up.

Verification: the test passes on #6469's parent (`9e0abccb9^`) and fails
on #6469 and on `main` (`c5ccb1183`) with `.lf-composer leaf-text` never
focused. With this change it passes, and so does
`test_a_file_tree_opens_each_file_the_editor_holds`.

Refs #6418 — automated triage

Co-authored-by: leaf-agent <[email protected]>
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.

ci-fix: file-tree search draft disappears during corpus scroll

1 participant