Repository navigation
Key each leaves-drawer row by its page, not its address - #1892
Merged
Merged
Conversation
A neighbour row in the Leaves drawer was keyed by its URL, for both Lit's repeat and the focus it keeps across a repaint. A neighbour whose server came back on another port therefore read as one page leaving and another arriving: the focused link was removed and focus fell back to the drawer. Each entry in `state.others` now carries `page_key`, the identity the page's own state-home records already use, beside `url`. The drawer keys rows and focus by `page_key` and links by `url`, so a restarted neighbour keeps its node and focus and Enter opens the new address. A neighbour whose server is not running still leaves the list, as before. The new test restarts a neighbour on a new port while its link holds focus; it fails on main. Removes proposal #5 from notes/comparisons.md. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 6, 2026
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.
The Leaves drawer keyed each neighbour row, and the focus it keeps across a repaint, by the neighbour's URL. A neighbour whose server came back on another port therefore read as one page leaving and another arriving. The focused link was removed, and focus fell back to the drawer.
Each entry in
state.othersnow carriespage_key(state.page_key, the identity that page's state-home records already use) besideurl. The drawer keys rows and focus bypage_keyand links byurl. A restarted neighbour keeps its node and its focus, and Enter opens the new address. The fresh-server check is unchanged: a neighbour with no running server still leaves the list.test_a_leaf_served_at_a_new_address_keeps_its_row_and_focusrestarts a focused neighbour on a new port. It takes the route a taken port's refusal names: the service record is deleted, and the old port stays held. The test fails on main because the row lost its node and focus. With this change it passes. This resolves comparisons proposal #5, which is removed fromnotes/comparisons.md.Is there a more underlying fix? No. I tried these candidates:
hreffollows the new URL. Covered in the new test.presence.jsreads only the neighbours' activity.start_serverreturns and before the first row publication. The drawer treats an absent row as removal, and the proposal keeps that behaviour (it retains the fresh-server checks). So the gap is outside this change.Tests run: the new test (it fails on main and passes here); the drawer's browser tests in
test_render_controls.pyandtest_render_navigation.py(49 passed); the neighbour tests intest_interact_server.py(21 passed); pre-commit.