Skip to content

Let the command reference run Resolve outside a thread, and keep each command's availability in its when - #5250

Merged
max-sixty merged 4 commits into
mainfrom
local-keyboard-test-failures
Nov 3, 2026
Merged

max-sixty merged 4 commits into
mainfrom
local-keyboard-test-failures

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Six keyboard tests in tests/browser fail on main, in CI and locally, since #4873 and #4895. Three of the causes were in the runtime, and the rest in fixtures that still used the API those changes replaced.

  • The command reference. Make strict checking the default for maintained browser modules #4873 let a row declare run as a getter that returns nothing while the command can't act, and the reference read that value to decide whether a row runs at all. So Resolve, outside a thread, became a disabled option rather than one the user can pick and be told "Available in a thread". The reference now asks whether the row declares a run (or a runKey for a keyed route), as registration already does, and leaves "now" to availability.
  • Availability. Make strict checking the default for maintained browser modules #4873 also folded the when of four rows (thread.primary, thread.resolution.toggle, message.copy, message.edit.previous) into such a getter, so every reader of availability but dispatch took them as live while their run had nothing to do: the reference listed "Copy message as Markdown" while words were selected, and the message editor advertised ↑ with no message above to edit. With the reference fix above, that row would also have become one to pick. Their when is back, with a plain run, as bindings.js asks ("Do not repeat a guard inside run if the guard changes whether the key should be shown").
  • The panel's corner fold. Make strict checking the default for maintained browser modules #4873 had the corner mark call the fold directly instead of pressing the fold command's row, so the press was no longer announced or logged. It presses the row again.
  • Fixtures. Four declared a key-dependent action as run(binding), which Make strict checking the default for maintained browser modules #4873 renamed runKey, so they received undefined. Two lookups, and a journey's two, still asked for reference rows as buttons, which Open the leaf's menu as the On view's first tab, searched from the field #4895 made listbox options.

tests/AGENTS.md now asks whether anyone is fixing a failure on main, rather than who owns it. Tend had filed these causes (#5073, #5076) a day earlier, with no pull request since, and the session that met them took them for local-only: main's newest runs had all been cancelled by later pushes, and a search for the test names joined with OR found nothing. So the guidance names the latest finished run, says a cause issue with neither Tend's eyes reaction nor a linked pull request is still waiting, and has a session working for a maintainer start a local session for a failure nobody is fixing.

Checked by node id: the six tests, the floating panel's fold tests, the radio and slider fixture's test, tests/journeys/test_render_code_reading.py, and the tests that press Enter, r, the copy key and ↑ in a thread (test_key_surfaces::test_a_key_on_screen_is_a_key_that_works, test_rewrites' three walks, test_layout's Markdown copy, test_commenting's native copy, test_resolving's and test_seated_threads' settling). pnpm run test:runtime and pnpm run check pass. Five other keyboard failures on main (test_focus's reference-command gesture, test_commenting's submit shortcuts and startup/test_keys' early key) still fail with this change and have other causes.

Closes #5073
Closes #5076

This was written by Claude Code on behalf of max-sixty

…the corner fold again

Six keyboard tests in `tests/browser` fail on `main`, in CI and locally, since #4873 and
#4895. Two of the causes were in the runtime, and the rest in fixtures that still used
the API those changes replaced.

- **The command reference.** #4873 moved some rows' availability into a `get run()`
  getter that returns nothing while the command can't act, and the reference read
  that value to decide whether a row runs at all. So Resolve, outside a thread, became
  a disabled option rather than one the user can pick and be told "Available in a
  thread". The reference now asks whether the row declares a `run` (or a `runKey`
  for a keyed route), as registration already does, and leaves "now" to
  availability.
- **The panel's corner fold.** #4873 also had the corner mark call the fold directly
  instead of pressing the fold command's row, so the press was no longer announced or
  logged. It presses the row again.
- **Fixtures.** Four declared a key-dependent action as `run(binding)`, which #4873
  renamed `runKey`, so they received `undefined`. Two lookups, and a journey's two,
  still asked for reference rows as buttons, which #4895 made listbox options.

`tests/AGENTS.md` now asks whether anyone is fixing a failure on `main`, rather than
who owns it. Tend had filed these causes (#5073, #5076) a day earlier, with no pull
request since, and the session that met them took them for local-only: main's newest
runs were all cancelled by later pushes, and a search for the test names joined with
`OR` found nothing. So the guidance names the latest finished run, says a cause issue
no pull request links is still waiting, and has a session working for a maintainer
start a local session for a failure nobody is fixing.

Checked: the six tests, the floating panel's fold tests, the radio and slider
fixture's test and `tests/journeys/test_render_code_reading.py` pass by node id;
`pnpm run test:runtime` and `pnpm run check` pass. Five other keyboard failures on main
(`test_focus`'s reference-command gesture, `test_commenting`'s submit shortcuts and
`startup/test_keys`'s early key) still fail with this change and have other causes.

Closes #5073
Closes #5076

> _This was written by Claude Code on behalf of max-sixty_
…t says

#4873 folded four rows' when into a run getter, so the register showed them live
while their run had nothing to do: the reference listed Copy message as Markdown
with words selected, and pressing it said it was available in a thread.
leaf-agent
leaf-agent previously approved these changes Nov 3, 2026
# Conflicts:
#	dist/kernel/leaf.js
@max-sixty
max-sixty merged commit aef8926 into main Nov 3, 2026
4 checks passed
@max-sixty
max-sixty deleted the local-keyboard-test-failures branch November 3, 2026 22:01
max-sixty added a commit that referenced this pull request Nov 4, 2026
…#5313)

#4873 let a command row declare `run` as a getter that returns nothing
while the command can't act. Dispatch then fell through, but every other
reader of availability (the command reference, key hints,
`aria-keyshortcuts`) reads `when` and took such a row as live. #5250 put
four thread rows back on `when` with a plain `run`, as `bindings.js`
asks ("Do not repeat a guard inside `run` if the guard changes whether
the key should be shown"). This does the same for the six rows that were
left:

- `navigation.back` (`register.js`), `selection.restore`
(`composing/capture.js`) and the three `margin.card.*` rows
(`annotation-overlay/thread-preview.js`) already had a `when` that
matched their getter's guard, so their behavior is unchanged.
- `code.copy` (`code-copy.js`) had no `when`. Before its Copy button
upgraded, a code block advertised Enter as "copy code" and the press
fell through to the page. It now waits in its `when` for the button.

The detail dial's arrows (`packages/detail/widgets/lf-dial.js`) had the
same fault without a getter: `dial.less` and `dial.more` had no `when`,
and their `run` returned at the dial's ends. At Skim the dial advertised
← for Less detail, which does nothing. Each row now needs a depth beside
the current one in its `when`, and drawing a depth calls
`commandsChanged` so Leaf reads them again. A probe of `detail` reads
the dial's `aria-keyshortcuts` as `ArrowRight` at Skim, both arrows at
Read and `ArrowLeft` at Everything; on `main` it reads both arrows at
every depth.

With no getter left, a row's `run` and `runKey` are plain values again:

- `declaresCommandHandler` is deleted. Registration, the register's
touch check, button wiring and the command reference read `row.run` and
`row.runKey` directly.
- Go-to registers its direct destinations by spreading them, without
copying property descriptors.
- The three runtime tests that pinned the getter contract are deleted.

Three browser tests still looked up command reference rows as buttons,
which #4895 made listbox options. They now ask for options:

-
`controls/test_focus.py::test_a_reference_command_finishes_its_gesture_before_a_newer_control`,
which failed on `main` with no Tend cause issue.
-
`test_render_code_reading.py::test_code_wrapping_keeps_source_copy_and_reader_choice`,
which presses Unwrap lines and Copy code in the reference, then Enter on
the block.
-
`test_render_heading_links.py::test_a_heading_copies_the_link_to_the_section_it_opens`.

Checked by node id: those tests; `test_reading_place`'s Restore
selection; `test_render_code_reading`'s copy over plain HTTP;
`test_summaries`' margin paging, which Tabs into and out of a card;
`test_clusters`' reference row for Escape; four of `test_key_scopes`'
Escape and back-gesture tests; and `test_dial`. `pnpm run test:runtime`,
`pnpm run check:browser` and pre-commit pass. Locally, three of
`check:worker`'s bundle and storage tests hit their 5 s and 60 s
timeouts at a load average of 50 to 85, so the pull request's run is
their check.

> _This was written by Claude Code on behalf of max-sixty_
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.

Command reference tests cannot find the thread resolution command Command route tests receive undefined command keys

2 participants