Repository navigation
Name commands whose context keys the page never shows - #2441
Merged
Merged
Conversation
A widget's command may declare `contextKeys`, keys that press its control from elsewhere such as its Question, and leave out `bindingBadge`, so the key works with nothing on the page showing it. That is how a multiple-choice Question's Done lost its digit in #2064 without any check noticing. `leaf package check --render` gains a `shows-context-keys` widget quality check that reads each example's command declarations and names such a command, as advice for the widget's author; it puts nothing on the page. The corpus sweep in test_render_gate.py runs the same reading, since a worked example shows one state and Done appears only in a multiple-choice one. lf-draft's Edit, Save and Cancel join known_widget_findings.py. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Edit, Save and Cancel declared Ask digits (1, 1 and 2) and no binding badge, so the keys worked with nothing on the page showing them, which the new shows-context-keys check names. They now declare no context keys: Tab reaches the buttons, Save keeps Mod+Enter and Close keeps Escape, and lf-draft leaves known_widget_findings.py. A user standing on a draft's Ask no longer edits, saves or cancels it with a digit. The digit test now asserts that a digit is not a command there and that the Tab, Enter and Mod+Enter route answers the Ask. test_numbered_ask_routes_follow_replaced_controls is deleted: the draft was its only widget, and with no digits it has no route to follow. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
reviewed
Oct 11, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The new probe can attribute a dependency widget's command to the package being checked. The ownership boundary and a suggested correction are inline.
A dependency's widget nested in one of the package's own was skipped by the walk, so its unbadged command was reported against the outer widget. Stop at the nearest Leaf widget first, as heldScrollers does. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 11, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 12, 2026
The [main CI run](https://github.com/max-sixty/leaf/actions/runs/38187553140) failed because a widget test still expected `1` to open a needed draft. #2441 intentionally removed draft context digits and put the supported Ask route in `test_a_draft_in_an_ask_takes_no_digits_and_answers_from_its_controls`. This removes the conflicting older test; the draft suite retains coverage for Tab to Edit, Enter to open, and the save shortcut. Verified locally: the old widget test failed on current main, while the draft suite test passed. The file-row failure in the same run was already addressed by #2437 and its current test also passed locally. Co-authored-by: leaf-agent <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A widget's command can declare
contextKeys, keys that press its control from elsewhere such as its Question, and leave outbindingBadge, so the key works with nothing on the page showing it. That is how a multiple-choice Question's Done lost its digit (fixed in #2434) without any check noticing.leaf package check --rendergains ashows-context-keyswidget quality check. It reads the command declarations in each worked example and names a command with context keys and nobindingBadge, as advice for the widget's author; it puts nothing on the page. A worked example shows one state, and Done appears only in a multiple-choice one, so the corpus sweep intest_render_gate.pyruns the same reading over every example page. Before #2434 that sweep failed on Done inideas-to-implementandship-review.lf-draft was the one bundled widget the check named: Edit, Save and Cancel declared Ask digits (1, 1 and 2) with no badge. They now declare no context keys. Tab reaches the buttons, Save keeps Mod+Enter and Close keeps Escape, so a user standing on a draft's Ask no longer edits, saves or cancels it with a digit. The digit test now asserts a digit is not a command there and that Tab, Enter and Mod+Enter answer the Ask.
test_numbered_ask_routes_follow_replaced_controlsis deleted: the draft was its only widget, and with no digits it has no route to follow.check-api.jsexportscommandDeclarationsWithinandcommandRoutesfor the probe;packages.mdandmodule-authoring.mddescribe the check.