Repository navigation
Fix page spacing and keep mobile actions visible - #529
Conversation
# Conflicts: # skills/leaf/assets/runtime/asks/view.js # skills/leaf/assets/runtime/chrome-layout.js
leaf-agent
left a comment
There was a problem hiding this comment.
The layout removal itself checks out: --thread-margin, --claim-map, and --lf-thread-beside have no remaining readers anywhere in the tree, and living-margin.js's existing side-then-overlay placement already derives the card's posture from whatever margin is actually free, so nothing had to be re-established after the reservation went. tests/test_render_margin.py and tests/test_render_pages.py pass in full here (155 cases), as does the rewritten workspace case in tests/test_render_controls.py. Two things on the rest.
The bottom-chrome clearance is layered on top of readableDestination instead of added to it. chrome-layout.js states the rule this change enforces, where it writes --lf-bottom-chrome-clear: "scroll padding tells native focus navigation where the visible edge actually is. Keep both on the same measured band so a Tab stop already inside the viewport cannot be accepted underneath the line." readableDestination in skills/leaf/assets/runtime/anchor-travel.js is the shared reading of that edge, and it is asymmetric — it takes scrollPaddingTop for the head (const clear = parseFloat(getComputedStyle(box).scrollPaddingTop) || 0) but accepts any destination.bottom <= view.bottom + 0.5 for the foot, so it does not know the line is standing there. framed now compensates for the Ask path by adding its own bottom test beside the same call, which leaves the other two callers reading the old answer: the if (readableDestination(where)) return true short-circuit in anchor-travel.js's own travel path, and if (!readableDestination(aimed)) scrollToElement(aimed, "instant") in version.js. Both are "the reader is already looking at it, don't move the page" decisions, so on the same compact widths the PR describes, a fragment or anchor target sitting under the shortcut line is called readable and the travel is skipped — the defect this PR reports for Ask navigation, in the paths it did not touch. Reading scrollPaddingBottom in readableDestination beside the scrollPaddingTop it already reads fixes all three at once and lets framed keep its single call.
Nothing fails without the arrival change. I reverted skills/leaf/assets/runtime/asks/view.js to the merge base and re-ran tests/test_render_widgets.py -k "ask or arriv or address": identical results either way, so no case distinguishes the new geometry from the old, and the mobile hoisted Accept/Reject arrival the description reports has nothing pinning it. That change is also independently revertible from the layout one — it would carry its own test more naturally as its own PR.
Two comments outside the diff still cite the breakpoints this removes, and both are the stated reason for a magic width: tests/test_render_anchors.py justifies resized(page, 1207, 900) with "Keep the page below the contextual-thread breakpoint so the premise remains about the page scope rather than the right-margin conversation it now opens at 1208px", and the note above RING_WALK_VIEWPORT in tests/test_render_controls.py says "Ship review stands a contents map too, so that beside posture waits for 1472px of shell rather than 1208px (theme.css)". Neither rule exists after this PR, so the next reader has no way to tell what those widths are protecting. Happy to push that fixup if you'd like it in this branch.
Live pages reserved a 520px conversation column even with no threads, shifting the examples catalog 260px left. Remove that reservation so thread cards use available margins or float over the page without shifting its reading position.
The positioning review also found that mobile navigation could accept a destination hidden beneath the bottom toolbar as already readable. Make the shared anchor-travel reading respect the scroller’s bottom padding, fixing ordinary anchor travel, and apply that same reading to Ask navigation’s detached answer controls. Regression tests exercise the hidden toolbar case and the already-readable control.
Validation: pre-commit, the standard suite, the margin suite, and focused Ask and anchor navigation tests pass. Browser checks cover the catalog, all nine examples, How it works, and the feature gallery at desktop and mobile widths. Restoring each old behavior makes its regression fail: the empty conversation reservation, shared bottom-clearance reading, and first-load mobile Ask navigation with the website header.