Repository navigation
Bind slash to page search - #125
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
Two nightly browser tests go red on this commit. Both encode the contract this PR deliberately changes, so the fix is to update them rather than to revert the code — but as it stands, ci on main would be redder after the merge, and this PR's own test job cannot see it: every test_render_* module carries pytestmark = pytest.mark.nightly, and only main runs --run-nightly.
tests/test_render_conversations.py::test_finding_narrows_the_list_and_says_how_much_of_it_is_left — the test stands the reader on page prose (#how-store), presses /, asserts .lf-panel stays hidden ("out on the prose it does nothing"), and then uses c as "the whole route in". With / now opening page search from the page, SELECT is standing by the time c arrives and claims it, so the panel never opens and the following panel_settled() times out after 30s.
tests/test_render_navigation.py::test_the_panels_own_c_answers_a_page_whose_log_has_not_arrived — asserts the key line does not contain find on a page whose log never arrived. Dropping when: () => conversationRuntime.threadList.length > 0 from thread.find makes that row live with no list, and since it is the panel's first live row it takes the first short chip: the line now reads / find. That is exactly what test_empty_thread_scope_keeps_slash_in_its_search asks for, so the two tests now disagree — the older one's docstring ("the panel's other two keys — narrow and find — are dead, and the scope used to say that for all three at once") is the claim that is no longer true.
Happy to push the test updates if you tell me which way you want each one to read — the first in particular is a product call (/ on prose now has a meaning, so that test's silence premise has to be replaced rather than relaxed).
How I measured
Merged tree at refs/pull/125/merge, against base 5d945edcf58879a91042cf6d37a43403ee2bd601 in a second worktree, same machine and same session.
# on this PR
tests/test_render_conversations.py::test_finding_narrows... 3/3 failed (TimeoutError: Page.wait_for_function)
tests/test_render_navigation.py::test_the_panels_own_c... 5/5 failed (expected not to contain text 'find')
# on 5d945ed
tests/test_render_conversations.py::test_finding_narrows... 2/2 passed
tests/test_render_navigation.py::test_the_panels_own_c... 2/2 passed
The key-line reading behind the second one, taken from the offline page after c, c, Escape — first chip visible, the rest hidden:
[['/find', false], ['ccomment', true], ['sselect item', true], ['rreact', true],
['dpage down', true], ['upage up', true], ['escclose threads', false], ...]
Everything else I ran matches base failure-for-failure, so nothing else here is this commit's: test_render_semantic_selection.py (1 failed, 17 passed — test_selection_hints_do_not_name_page_content_behind_a_covering_panel fails on base too), test_render_controls.py (10 failed, 53 passed, identical set), test_render_anchors.py (4 failed, 54 passed, identical set), test_render_commands.py and test_render_aim.py. All the new tests in this PR pass. Main's own ci was already red before this branch (run 33317065355).
leaf-agent
left a comment
There was a problem hiding this comment.
The two nightly tests I flagged now pass on this head, and the runtime guard that came with them holds up: with when: () => anchoringIsReady() && !searching, a second slash while search is open can no longer re-enter startSearching and flip searchReturnsToHints, so the direct-from-a-control Escape destination survives a click away from the box.
What I ran, at 667eaae
Nightly, on the PR head (which already contains b314c1a) against a b314c1a worktree on the same machine:
test_render_conversations.py::test_finding_narrows_the_list_and_says_how_much_of_it_is_left passed
test_render_navigation.py::test_the_panels_own_c_answers_a_page_whose_log_has_not_arrived passed
test_render_navigation.py + test_render_conversations.py 7 failed, 97 passed — identical set on base
test_render_semantic_selection.py 1 failed, 17 passed — same failure on base
test_render_commands.py + test_render_controls.py 13 failed, 64 passed — identical set on base
Every remaining red reproduces on b314c1a with the same assertion, so none of it is this branch's.
## Problem [Run 33320898593](https://github.com/max-sixty/leaf/actions/runs/33320898593) failed with 68 tests red on 07373f4. Sixty of those were already red on the commit before it and are what #127 is about; thirteen were new, and eleven of those have since been fixed or renamed away by #125, #126, or #127's branch — I ran each of the thirteen at `main` and on #127's branch to sort them. What is left, failing on `main` and on #127's branch alike, is `test_the_chrome_a_key_opens_has_no_serious_violations` at both `[420-light]` and `[420-dark]`: axe reports a serious `target-size` violation on the panel's page-reaction trigger, standing on the comment list. The trigger is 29.5×21.5px, which passes `target-size` on spacing alone — until something else to press moves next to it. Over a covering panel the key line and the toast are lifted above the sheet's foot, and [that lift was measured off the general composer's height](https://github.com/max-sixty/leaf/blob/6794ddcc1286aa1d776060417aaf5dd145524da6/skills/leaf/assets/runtime/chrome-layout.js#L132-L135). Once a page offers reactions the foot is two rows, not one: `paintPageStrip` inserts the page's own reaction strip above the composer, and the line was drawn straight over it. Measured at 420×900 with the panel covering, the line spanned y 767.7–827 and the strip's trigger y 811.2–832.7. 07373f4 then widened the line to two rows, which brought its `? more` button — the one part of the line that takes a pointer — down to x 25–88.7, on top of the trigger at x 14–43.5. axe measured 8.8px of safe clickable space between them. A reader aiming at the reaction got the keyboard reference. ## Solution The panel gets one foot box holding the strip and the composer, and the lift is measured off that box. The strip is as fixed as the composer is, so a lift that clears one has to clear both; the `ResizeObserver` watches the foot too, so the strip appearing is the same kind of event as the composer growing under a draft. Lifting further puts the line back over the panel's scrolling thread list, which is the third scroll region the line can stand over and the only one that was not reserving room for it — the document reserves it on `chromeRoot`, the trays' lists through `reserveListClearance`. The list now spends the same measurement the same two ways (padding for a wheel to the end, scroll-padding for a walk's scroll-into-view) while the panel covers, and returns to the stylesheet's inset when the panel steps back beside the page and the line is capped clear of it. Same page and window after the change: foot 797.2–900, line 723.7–783, trigger untouched at 811.2–832.7, list reserving 79px at its end. ## Testing `test_a_covering_sheet_lifts_the_key_line_over_all_of_its_foot` is new. It asserts the foot is genuinely taller than its composer first, so a page with no strip cannot green it, then that the line clears the foot and the trigger, that the list reserves at least as much of its own end as the line stands on, and that the reservation is returned beside a wide panel. Reverting either half of the fix in turn fails it on the matching assertion. <details><summary>Runs</summary> - `uv run pytest tests` — 723 passed, 6 skipped. - `uv run pytest --run-nightly tests/test_render_controls.py` — the two `[420-*]` cases now pass. Nine failures remain; the same nine fail on `main` in the same file, and all nine are in run 33320898593's list. - `uv run pytest --run-nightly` over `test_render_conversations.py`, `test_render_navigation.py`, `test_render_margin.py`, `test_render_pages.py`, `test_render_outbox.py`, `test_render_gate.py` — 20 failures, every one of them already in run 33320898593's list. No new failure in any file. - `pre-commit` on the four touched files: trailing-whitespace, end-of-file-fixer, mixed-line-ending, ruff check, ruff format, prettier, eslint, typos all pass. `test_dynamic_chrome_offsets_keep_the_safe_area_in_their_arithmetic` measured its expected key-line and toast bottoms from `.lf-general`, which is now the wrong box wherever a strip stands; it reads `.lf-panel-foot`. It is red on `main` for an unrelated reason — the panel is drawn at `left: -15` on a window with a scrollbar gutter, which is #121's subject — and stays red here. </details> --- Automated fix for [failed run](https://github.com/max-sixty/leaf/actions/runs/33320898593) Co-authored-by: leaf-agent <[email protected]>
Page text search now has the standard
/shortcut without requiring item-hint mode first. The page, keyline, complete keyboard reference, and accessible shortcut projection all consume the same command declaration;sstill opens visible-item hints, Threads keeps the nearest scoped search even when empty, and editable controls retain slash input.The change reuses the existing page-search flow, preserves the two intentional Escape destinations, and adds browser coverage for direct page search, retained hints, scoped Threads search, empty Threads, text-entry safety, and generated help.