Repository navigation
Stand a code block's lone Copy on its top border, as a one-mark toolbar - #3916
Merged
Merged
Conversation
A draft at rest held a footer row with only a bordered Edit button, which doubled a one-line box, and opening the editor swapped in Save and Cancel in that row. The controls are now marks on a small toolbar whose middle lies on the box's right edge: a pencil and Copy at rest, a check (Save), a cross (Cancel) and Copy while editing, and a refused save's status before them. A pointer sees it on the top border while over the box or a key is in it, and the open editor always; under a finger it is always shown, on the bottom border, because on a phone the margin's pins hang off the previous block's last line into the room above. The box is its prose at rest and the same size while editing: the editor no longer narrows for Copy, and nothing moves when a save is refused. Clicking the prose still opens the editor at that spot; Cancel opens in the pencil's seat and Copy keeps the last one. Tests that pinned the old look changed: the double-click test now holds the editor's words to the prose's exact box (it asserted the editor was narrower, leaving room for Copy), and its paint band above the box stops short of the toolbar; the refused-save test reads the status from the toolbar. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A code block's Copy stood inside the block's top-right corner as a bordered square on the code's ground, covering the end of the first line while shown, while a draft's controls became marks on a small toolbar over its border. The lone Copy is now that toolbar with one mark: its middle lies on the block's top border, 8px in from the right, on the card ground with a ring and a soft shadow, the copy icon a borderless muted mark. It still shows only on hover, keyboard focus or a tap that stands the user on the block, and still takes no room. The face, mark size and seat have one home, `.lf-mark-bar` and `.lf-mark` with their tokens in integration.css; the draft's toolbar now wears those classes and keeps only its placement and visibility in draft.css, and a Copy inside a toolbar of more marks is one of them. The widened-table test now holds Copy's middle to the block's top border; it asserted Copy stood within 8px below it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/packages/default/styles/draft.css # skills/leaf/packages/default/theme.css # skills/leaf/packages/default/widgets/lf-draft.js
A code block's Copy stood inside the block's top-right corner as a bordered square on the code's ground, covering the end of the first line while shown, while a draft's controls are marks on a small toolbar riding its border. The lone Copy is now that toolbar with one mark: its middle lies on the block's top border, 8px in from the right, on the card ground with a ring and a lift, the copy icon a quiet mark. Its face still follows the block's line (#3830), and it still shows only on hover, keyboard focus or a tap that stands the user on the block, and takes no room. The toolbar's face has one home, `.lf-mark-bar` in integration.css, which the draft's toolbar now wears too; draft.css keeps only where its toolbar stands and when it shows, and a Copy inside a toolbar of more marks is one of them. Every Copy is now quiet, so the draft no longer adds that class to its own. The widened-table test now holds Copy's middle to the block's top border; it asserted Copy stood within 8px below it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
previously approved these changes
Oct 25, 2026
The playground placed its instruction Copy inside the pane's corner by the inset token this branch retired, which a test caught as a token nothing sets. It now takes the toolbar seat every lone Copy has: its middle on the pane's top border, 8px in from the right. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 25, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 25, 2026
The focus ring sweep found rust-sort's Copy ring 4.7px outside the source pane's top edge after Tab reached it. Since #3916 a lone Copy stands half above its block's top border. Tab reveals the focused element, Copy's shadow button, and nothing gave that button a scroll margin: the page's `:focus` rule reaches the host, not a Web Awesome button inside it. Reaching Copy from the heading above therefore scrolled the pane until the button stood flush with its top, and the ring above it was clipped. Before #3916 the button sat inside the block, which was already in view. The button now keeps `--focus-ring-landing` as its scroll margin, as a focused control in the page does. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 25, 2026
The focus ring sweep reported the playground instruction pane's Copy ring as "under" the controls region above it in code-comparison, data-explorer and notification-playground, though a screenshot shows the ring drawn whole over the region. Since #3916 that Copy stands half above the pane and reaches 4px into the region above it, so the sweep asks which of the two paints in front where they meet. It looked for the ring's control, Copy's shadow button, in `elementsFromPoint`, which answers with the host instead, so it found no control and reported a cover. It now takes the first box in the stack that is the control or holds it, which is the host here, standing in front of the region. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 25, 2026
test_code_copy_keeps_source_and_stays_beside_scrolling_and_revised_blocks still read three things later changes replaced: - #3830 sized Copy's face to the block's line (19px here) and met the touch floor with a reach on the button's ::after, but the journey still asserted the face itself was 44px. It now taps inside the floor beside the face and expects the copy, which fails when the reach is removed. - #3916 stood Copy's toolbar on the block's top border, but the journey still held it within 8px below that border. It now holds the toolbar's middle to the border, as #3916 did in the widened-table scroller test. - #3670 made the code block's scrollbar clearance part of every layout, so the journey's wait for the old scroll-state ::after to read `none` could only time out. The wait is gone. No product behavior changed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 25, 2026
#3939) Adds a nightly macOS run of every test tier, and fixes every test that failed in its first run or in the Linux nightly beside it: 89 tests in [run 40156291557](https://github.com/max-sixty/leaf/actions/runs/40156291557), 60 of them only on macOS. ## The macOS nightly `ci.yaml` gains a `test-macos` job: every tier on `macos-15`, `-n 2` on its three cores, in the daily schedule and a dispatch. It belongs to `ci`, so a failure turns that run red and reaches tend through the existing `workflow_run` trigger, with no tend configuration change. GitHub doesn't bill hosted runners for public repositories; the job holds one of the account's macOS slots for about three hours. The test step names `shell: bash`, without which a step runs without `pipefail` and piping pytest through `tee` reported the first run's failures as a green job. The setup action's Ubuntu mirror step now runs only on Linux. `tests/AGENTS.md` counts `test-macos` among what tend repairs and leaves only failures no CI run shows to local sessions. It drops the instruction to confirm a macOS-only failure at normal priority because `taskpolicy -b` slows headless Chrome: a test that fails on a slower host depends on timing, and the fix is to the test. `running-tend` tells the session fixing a red run, which has only a Linux runner, to verify a macOS-only fix by dispatching `ci` on its branch. ## The fixes, by cause Product fixes: - A drafted margin card rose against the window's foot and never came back as the draft shrank (#3524). It now holds the top it opened at and drops back. - A tapped pin reseated 11px lower as it unfolded, because the hold-to-read toggle was pressed before the browser focused it (#3341). - A page's first thread card could cover its passage, because the placement that makes room was dropped while Floating UI loaded (since #1526). - A heading's "Copy link to section" stayed at the heading's far end after the window narrowed and widened, since every engine keeps its last `position-try` fallback (#3836). It now picks its place from the current width. - Putting the response bar away moved focus off the button the press had just focused, so the next `e` found nothing (#3756). - A trace's image-tools status shared a class with the image's loading notice, whose rules hid it (#3707). - WebKit scrolled the outer page 1,386px when a sample editor took focus (#3634). - In draw mode a press left the previous press's release timer pending, so a fast second click reached the page. - Hint refreshes read the geometry of every target inside a closed disclosure, forcing layout of skipped content. - A sidebar page's sticky track clipped focus rings (#3918). A stuck track body now keeps the ring's room inside its edges, so its blocks stand 5px in from each side. - Tab revealed a block's Copy flush with its scroller, cutting its ring (#3916). - The hidden "my change" word inside a choose group took a cell's padding and read as clipped content (exposed by #3837's check). - Visual review case buttons kept their wide padding after the first breakpoint crossing, a Chromium restyle bug avoided by making the case list a plain container. - A held shot's scrolling stage didn't declare that it holds its height (#3703/#3704). - When the log refused a reply, the floating panel's head moved down 69px and the restored draft pushed its controls up 21px (#3400). Through a refusal the panel now holds its head and the field its height, on the holds a press already takes; the refused turn's room goes at the user's next turn. - A reply box's ↑ (edit your last message) appeared only after an unrelated repaint once its last message became editable (#3855). Every message draw, by any thread reader, now recomputes that row's keys. - A trace's images took the page's scroll anchor, so a lane change in the timeline scrolled the page 62px under an arrow key; they no longer anchor scroll. The trace overview wrote its window's new start before reading its size, so for one layout the window ran past its strip and Chromium scrolled the page up to 838px; it now reads before it writes. The image tools' status keeps its line when its text clears. - Web Awesome's radio group moves focus on an arrow with a bare `focus()`, which Leaf's ring scroll margin turned into a page scroll. The vendored bundle is patched (`build/vendor.mjs`) so both calls pass `preventScroll`. - A Leaf page inside an iframe took focus from the page around it when it finished arriving. Its arrival recovery now runs only at top level or in a frame that holds focus. - The margin rail's one Tab stop stayed on whichever row last held it, so a resize could leave it below a row the user sees first. It is now the highest row in view; a focused row keeps it. - A resize that moved a sidebar page's track into the page, with neither place made by the reader, took the track's place over the page's: live-progress jumped 1861px (#3918). On a tie the page's own place wins. - The whole-page rule read a shut disclosure whose children are all generated as showing what it holds (#3908); it now skips only `.lf-ui` apparatus. - The gallery revealed its stamped frame at the centre, carrying the pressed button 45px; it now scrolls only as far as needed. Test fixes: - The Codex fixture copies the running interpreter as `codex`; on a framework Python, as on the runner, the copy fails its code signature and macOS kills it at launch. That broke 39 tests. The copy is now re-signed ad hoc, and the fixture no longer leaks `PYTHONHOME` into the command it runs. - The plain-HTTP copy test missed Chromium's lower-cased host; the event-door refusal test read its answer after the server's reset; the stale-keys sweep raced the browser entering fullscreen; the words watch didn't credit a blur from a press elsewhere. - Several tests read state before it settled (a shown gesture's arm, a side list's smooth scroll, a sample's focus returning, a held reply's menu), and now wait for it. Assertions predating #3830, #3916, #3670, #3673 and #3217 now read the current behavior. - Three waits fixed their own deadline instead of the suite's, among them the async-probe test's 500ms. - The command hub's record now sticks in view, so the Atlas journey opens its news before reading each row; the region-capture journey drags over the unreadable image it means to fail on (#3861 draws only the element that alone paints the crop). - The touch-capture removal test, which fails intermittently on main, now reads the shelf right after the tap and names the elements the tap reached, so its next failure says whether the tap missed or the image came back. - The feature-gallery scroll pass allows a third of its steps to write the contents' `aria-current`, as gestures already do, since the count depends on where sections fall under the platform's fonts. The branch also merges the four open `grind/f-main-tests-*` pull requests, whose fixes cover five more of the run's tests: #3871, #3882, #3887 and #3906. This pull request lands them. Each fix was reproduced failing and then passing by node id, on this Mac or, for a Linux- or runner-only failure, against a run's log, except where its commit says otherwise. Dispatched full runs on this branch ([40156291557](https://github.com/max-sixty/leaf/actions/runs/40156291557), [40186545420](https://github.com/max-sixty/leaf/actions/runs/40186545420), [40196342887](https://github.com/max-sixty/leaf/actions/runs/40196342887)) check both platforms; the second took the macOS job from 86 failures to 38, most of the rest fixed since. A few macOS-only failures pass on every local attempt (two reading-place tests, a scroll repaint, Back from a thread, opening a line under the last, the Android composer's Return, margin-entry order, a card paging on, a turn arriving out of view) and have no fix here; once this lands, the macOS nightly reports them to tend. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 25, 2026
The user judged focus rings too central to Leaf for another per-case fix. This reverts the branch's two ring commits: the ring room shared by every sticking block (647ef69) and the Web Awesome host margin at Tab arrival (4eb1eef). Main keeps #3939's track-only room and #3916's Copy-only margin. notes/focus-ring-room.md lists the six cases found so far, with their measurements and reproductions, the two mechanisms behind them, and the two candidate fixes tried. TODO #31 asks for one mechanism once the list shows its shape. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 31, 2026
A code block's Copy, and a draft's toolbar of Edit and Copy, stood with their middle on the box's top border (#3916), so their top half depended on room outside the box. Where something above the box covered or clipped that room, the half was cut: in rust-sort's Source pane, the first listing's Copy showed only its lower half, which read as a Copy sitting just inside the box, while elsewhere it stood over the edge. Both now stand inside the box's top-right corner, 4px from both edges, so whatever shows the box shows them whole. Copy still shows only on hover, keyboard focus or a tap that stands the user on the block; a draft's toolbar also stays while the draft is edited or asks for an edit. While shown, they cover the first line's last words; for a draft's toolbar that includes the line being edited, and a refused save's status widens it over a third of the line. The user chose one seat for both over keeping the edited line clear. This reverses #3916, whose rejected alternative was Copy in the corner wearing the toolbar's face. The toolbar no longer casts a shadow. Its lift came with the border seat, where it rode across the edge between two surfaces; inside the box its hairline ring sets it apart, as common code-copy buttons do. Under a finger a draft's toolbar keeps its seat on the bottom border: it shows there always, and in the corner its finger-wide reach would take every press meant for the end of the first line. The inset is one token, `--lf-block-control-inset`, which a recording's play bar already matched in value (its comment said it stood "inset as Copy is from a code block's corner"); all three now read it. On a narrow page, where a comment's pin stands just above its block's top edge, the border seat's Copy overlapped the pin by 8px; inside the corner it clears it. Tests: the widened-table scroller test and the code-copy journey now hold Copy within 8px inside the block's top and right edges, where they held its middle to the top border. > _This was written by Claude Code on behalf of max-sixty_
leaf-agent
pushed a commit
that referenced
this pull request
Nov 5, 2026
…e Web Awesome (#5432) Tab onto a control at the foot or top of a bounded block now shows its whole focus ring, for a control that holds focus inside a Web Awesome control's own tree too: a diff's file filter, a package's `wa-select` or `wa-slider`, and a code block's Copy. Before this change, the filter, the select and the slider landed with the foot of their ring past the block's edge, and the block's "more below" fade lay over what was left. This reduces #4125 to the case that remains, rings against a bounded block's side, which waits on a decision. `notes/focus-ring-room.md` now covers only that case. ## The cause Leaf's sheets read where focus is with selectors that don't reach into a shadow tree, in two kinds of rule: - **The landing room.** `:where(:focus, [data-lf-focus])` gives the focused box `scroll-margin: var(--focus-ring-landing)`, which the browser's focus reveal and Leaf's landing (`landing-scroll.js`) both read. A vendor control's focused node is in its own tree, where neither selector matches. The browser then revealed it flush with the block's edge, and the ring's room landed outside. Copy had its own `scroll-margin` rule on `::part(button)` for this reason (#3916). - **The fades.** A scroller that holds more than it shows fades its edge, and stops fading while focus is inside it, through `:has([data-lf-focus])`. `:has()` doesn't look into a shadow tree, so the block kept fading over the filter's ring. A table's row-name fade (`reading.css`) and a thread card's top fade (`annotation-chrome.css`) used the same check. `focus.js` already marks the focus path on both sides of a shadow boundary: `data-lf-focus-within` on every ancestor, the host included, and `lf-focus` as a part name on a focused node that has a `part`. So the fix reads those marks: - The landing room also matches `::part(lf-focus)` (`surfaces.css`), which weighs a pseudo-element where the rule it joins weighs nothing. Copy's own rule goes. - All three fades lift on `[data-lf-focus-within]` rather than `:is([data-lf-focus], :has([data-lf-focus]))`. The comment on the row-name fade already says it goes as the mask does, and with a `wa-select` focused in a scrolled row-named table both now lift, where neither did on main. The fades now lift for focus on any control inside a Leaf widget's shadow tree too, such as a diff's rows or file headers, as the rule's wording intends. On main a bounded block kept fading while a diff's file row held focus, in both engines; it now lifts, a visible change on those pages. Neither adds a mechanism or a case. The note's second candidate also changed `ringBox` and had `wa-input` and `wa-select` declare `--lf-wears-ring`. Measured here, those add room only to the select (under a pixel without, 6.8px with), whose ring is already whole without them, and the declaration on `wa-input` would also claim the floating panel's search field, whose wrapper wears its ring. So they stay out. ## Evidence The note's six cases from 2026-10-25, rebuilt on this branch's base (1b3e077) in headless Chromium 156 and Firefox 157. "Room" is the space between the ring's outer edge and the clipping edge; negative is cut. | Case | On main | With this change | | --- | --- | --- | | 1. `live-progress`, the "Release notes" summary in the stuck track | whole (3px) | unchanged | | 2. A margin sidebar's link and summary | no rule reads `aside.sidebar` now; a `layout-track` beside a column keeps whole rings (3px) | unchanged | | 3. A diff's file filter, Tab from 3px past the foot | −3.6 / −4.0 at the foot, under the fade | +6.4 / +6.0, no fade | | 4. A `wa-select`, 3px past the foot | −5.8 / −6.2 | +0.2 / +0.8 | | 5. Copy at a block's top | whole (+7.6 / +8) through its own rule | whole (+7.6 / +8) through the shared rule | | 6. A single-thumb `wa-slider` | −5.0 / −5.4 at the foot | +1.0 / +0.6 | A sweep that brought each control in by Tab from 4px inside to 24px past each edge found no faded arrival, and no cut one at the top or foot beyond one Chromium reading of the slider at −0.02px, flush with the edge. The select and the slider keep under a pixel there, since their ring stands on a box beyond the focused node (the combobox, and the thumb 7px below the rail); the filter and Copy keep 6 to 8px. No bundled widget uses a `wa-select` or `wa-slider`. The filter's and the select's rings are still cut 3px at each side, since they fill the block's width and the block has no inline room. A link that starts a line loses 5px at its start, and a summary 5px at each side. That is the case that remains, and the note holds its measurements, candidates and reproduction. ## Tests - `test_a_key_onto_a_control_at_a_scrollers_edge_shows_its_ring` gains the diff's file filter in Chromium and Firefox, and now also asserts that the bounded block doesn't fade the arriving ring. Flipped back to main's sheets, it fails in both engines (room −0.6 and −1.0, faded). With main's landing rule alone it fails on the room, and with main's fade rule alone on the fade. - `test_a_scrolling_table_keeps_its_row_names_in_view` now focuses a control in a shadow tree in the scrolled table and asserts that the table's mask and the row-name fade both go, in both directions. It fails with the old check on the row-name fade. - Probes on the merge base and this tree, in Chromium and Firefox: a `wa-select` in a scrolled row-named table, a diff's file row in a bounded block, and a control in a shadow tree in a thread card's transcript. Each fade stays on the base and lifts here. On main the card's top fade stayed for every focused control in the transcript, an ordinary button included, not only one in a shadow tree (the cause, inferred from the selector and not traced, is a `:has()` nested in a `:has()` that never matched), and it now lifts for all of them with no scroll moved. No test holds the thread card's case. - Run here and passing: the edge test's other parameters and the scroll-box tests in `test_focus.py`; the fade tests in `test_render_pages.py`; Copy's tests in `test_render_code_reading.py` and `test_render_anchors.py`; the diff filter tests; the ring tests in `test_rings.py`; `test_workspaces_and_bounds.py -k "bound or more"` but one; `tests/model/test_interact_layer.py`; `test_the_thread_card_opens_on_its_latest_message_under_its_own_name`; `pnpm run test:runtime`. - Failing here and with main's sheets put back alike, with the same errors: four Web Awesome tests in `test_lifecycle_and_controls.py` (a `querySelector` on null, then the `.library-select` combobox never appears), `test_workspace_end_room_stays_inside_the_last_reading_region[pane]` (a key badge intercepts the click), and `test_the_menu_s_search_finds_rows_threads_and_commands` (an unchanged `hidden` write on `.lf-fp-quick`). I didn't look for their cause. Not run: the corpus ring sweep (`test_each_sampled_focus_ring_is_shown_whole_in_its_surface`, journeys tier), `leaf-dev stills` across the catalogue, and WebKit. Part of #4125 > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude <[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 code block's Copy used to sit inside the block's top-right corner as a bordered square, covering the end of the first line while it showed. A draft's controls, meanwhile, are marks on a small toolbar riding its border (#3225). The lone Copy is now that toolbar with one mark: its middle lies on the block's top border, 8px in from the right edge, on the card ground with a ring and a lift, with the copy icon drawn as a quiet mark. It still shows only on hover, keyboard focus or a tap that stands the user on the block, its face still follows the block's line height (#3830), and it takes no room. The user picked this design over two others: keeping Copy in the corner and giving it the toolbar's look, or giving the draft's marks Copy's bordered square.
The toolbar's look now lives in one place,
.lf-mark-barinbrowser/styles/components/integration.css, and the draft's toolbar uses it too.draft.csskeeps only where the draft's toolbar stands and when it shows, and a Copy inside a toolbar with other marks becomes one of them. Every Copy is now quiet, so the draft no longer adds that class itself.The playground's instruction Copy, which its pane places itself, now takes the same seat on the pane's top border; it read the corner inset token this change retires.
The widened-table scroller test now holds Copy's middle to the block's top border; before, it asserted Copy stood within 8px below that border.
Clipping check: the toolbar's top half stands above the block, so a block flush against the top of a pane that clips its content would cut it. I surveyed every code block and
lf-codelisting in the examples, fixtures and docs pages that have them (13 pages, at 1280px and at 390px under a finger, with every tab clicked and every disclosure opened). No block sits within the toolbar's half height (at most 11.5px) of a clipping ancestor's top; the closest is 102.9px. A document block's Copy stands in chrome anyway, so a page's pane can't clip it.Checked in Firefox and Chromium: on a document code block, an
lf-codelisting and a draft, the toolbar's middle sits on the top border and its right edge is 8px in. Under a finger the lone Copy shows on tap, and taps 9px above and below its centre reach it. 23 focused copy, draft and pins tests pass, and so doespnpm run test:runtime.