Hang the margin action's hover lift on the press spelling, not the class - #117
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
The role="img" swap and the cursor scoping both read correctly, and every marginAction call site is a <button> or an offer("button", …) span, so nothing on a live page loses its hand.
One thing the fix leaves behind: the hand was not the only paint hung on .lf-margin-action. The line directly under the new rule — .lf-margin-action:hover:not([aria-disabled="true"]) { background: var(--chip); } — still keys on the class alone, so a copy's standing reaction mark still lifts to --chip under the pointer. That is the promise the new CLAUDE.md paragraph rules out ("Paint that promises a gesture … hangs on how a press is spelled … never on a control class alone"), and the pill this PR takes as its model scopes both halves: .lf-pill:is(button, [role="button"]) for the hand and .lf-pill:is(button, [role="button"]):hover for the lift. The export gate won't see it either — offering reads getComputedStyle(el).cursor and nothing else, which is why the class-hung hand was the only half that turned red.
The tone rules a few lines below (.lf-margin-action[data-lf-tone="positive"]:hover:not([aria-disabled="true"]) and its negative twin) have the same shape, and a copy does reach them: a decided suggestion's record survives BAKE on data-lf-said, and the sweep over [data-lf-offer][tabindex] removes every aria-* but aria-label and aria-hidden — aria-disabled among them — so the record that #name set out to make refuse a press lights its accept/reject tint under the pointer in a file. No shipped example carries a decided suggestion, so the corpus never asks.
Separately, the branch no longer merges. main is three commits past this branch's parent, and the last of them (Make leaf a normal Python package and the repository its plugin) moved plugins/leaf/skills/leaf/** to skills/leaf/**; all three non-test files here want rebasing onto the new paths.
9d9031b to
f7040a3
Compare
|
All seven failures — this one and the six listed in the body — were introduced by fdaa3ea itself, not by anything that landed after it. I ran the same seven node ids at 62560cc, its parent: 18 passed. At fdaa3ea: 7 failed, 11 passed, each with the message it still carries. All seven still fail on The run that dispatched me, for the record33276954557 on 62560cc had five failures, and none of them needs a fix now:
|
985d242 took `cursor: pointer` off `.lf-margin-action`'s class and hung it on `:is(button, [role="button"])`, so an exported copy no longer draws a hand over a gesture it cannot take. The lift under the pointer is the same promise in the other property and still keys on the class alone: a copy's standing reaction mark rises to `--chip` under the pointer. The three tone hovers have the same shape, and `:not([aria-disabled="true"])` does not guard them in a file — BAKE strips the aria state along with the role, so a decided suggestion's record, which survives on `data-lf-said`, would light its accept tint under a pointer that can decide nothing. The copy's `offering` reading takes the cursor and nothing else, so no gate can see this half. `test_a_copy_keeps_a_standing_reaction_as_a_mark_and_drops_the_press` hovers the mark in the exported file and holds its background still; with the scoping reverted it fails on `rgb(238, 234, 222)` against `rgb(255, 254, 251)`. Tests: the export, reaction, margin, and draft files pass together (112), and `uv run pytest tests` is 721 passed, 6 skipped.
f7040a3 to
021f7e4
Compare
# Conflicts: # skills/leaf/assets/runtime/chrome-style.js
Problem
985d242 landed the fix this PR opened with — the hand off the class,
role="img"on the copy's mark, theCLAUDE.mdparagraph — so the branch is now rebased down to the half that commit left behind..lf-margin-action's hover lift still keys on the class alone, so an exported copy's standing reaction mark still rises to--chipunder the pointer, which is the same promise the hand was making, in the other property.The three tone hovers have the same shape, and
:not([aria-disabled="true"])is no guard in a file: BAKE strips the aria state along with the role, so a decided suggestion's record — which survives a copy ondata-lf-said— lights its accept or reject tint under a pointer that can decide nothing. No shipped example carries a decided suggestion, so the corpus never asks.Solution
Spell all four hovers the way the hand is now spelled:
:is(button, [role="button"]). Every margin action is a<button>or anoffer("button", …)span, so a live page is unchanged; a copy, whose roles BAKE removed, stops lifting.The copy's
offeringreading takes the cursor and nothing else, so no gate could see this half — which is why the class-hung hand went red and the class-hung lift did not.test_a_copy_keeps_a_standing_reaction_as_a_mark_and_drops_the_pressnow hovers the mark in the exported file and holds its background still.Testing
rgb(238, 234, 222)againstrgb(255, 254, 251)— the copy lifting to--chip.uv run pytest tests/test_render_reactions.py tests/test_render_export.py tests/test_render_margin.py tests/test_render_drafts.py --run-nightly— 112 passed.uv run pytest tests— 721 passed, 6 skipped.pre-commit run --files …on both changed files — clean.What is still red on
mainTwo of the seven, both at
81653d3+ this branch, from this runner:test_render_gate.py::test_a_page_hands_its_note_strip_back_when_the_panel_takes_the_room—<lf-option id=nx-revoke>and three siblings drawn 14px outside<lf-options id=next-jobs>;test_render_pages.py::test_a_drawing_stands_on_the_columns_axis_until_it_needs_the_free_margin— a scrollbar where both margins hold the drawing whole.985d242 closed the other four (the aim press, both conversation cases, and the decided-note timeout). Neither remaining one is this PR's concern and I have not touched them.
The drawing case, measured here
At 1500×900 on
DIAGRAM_AND_RAIL_PAGE,DRAWING_PLACEMENTreads: column257.5 → 977.5, rail at1023.5, the wide drawing1216.66wide, and its box24 → 1211. So the box takes the left margin whole and stops289pxshort of the window on the right, which leaves the drawing about30pxover its box — hence the scrollbar the assert refuses, and the14.8pxit sits off the column's axis. Both drawings are below the row that claims the rail, so by the test's premise the right margin is theirs to take too.