Repository navigation
Replace reaction labels with agent feedback emoji - #349
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
Three nightly-only browser tests fail on this head. I ran them locally against the merged tree; each is a stale assertion the vocabulary/markup change left behind, not a runtime defect.
.github/workflows/ci.yaml runs uv run pytest tests -v on pull_request and adds --run-nightly only on main, and tests/CLAUDE.md marks every test_render_*.py module nightly — so this PR's test job goes green and the breakage surfaces on main's post-merge nightly instead.
Local runs
FAILED tests/test_render_reactions.py::test_a_token_press_marks_the_passage_and_a_second_press_takes_it_back
AssertionError: assert ['👍\n', '❌\n', ...] == ['👍', '❌', ...]
FAILED tests/test_render_margin.py::test_the_feature_gallery_balances_one_button_sample_with_feature_sections
Locator expected to have text '??' Actual value: 🤔
FAILED tests/test_render_conversations.py::test_a_coined_class_cannot_reach_the_chromes_rules
+ 'lf-react-surface',
+ 'lf-react-trigger-icon',
On the fab bar the pills are response actions, so innerText is "👍\nok" — the glyph and label spans lay out on separate lines and split(' ')[0] keeps the newline. Reading .lf-response-action-glyph directly passes.
test_a_coined_class_cannot_reach_the_chromes_rules pins the classes theme.css styles at document level that the chrome also scopes; the new .lf-react-surface:not(.lf-react-open) … and .lf-react-trigger-icon rules widen that surface, which is what the assertion's own message asks you to do on purpose.
I verified each fix by applying it and re-running the named test — all three pass.
Two of them are outside the diff, in tests/test_render_margin.py::test_the_feature_gallery_balances_one_button_sample_with_feature_sections, so I can't attach suggestions:
expect(
page.locator(
'[data-lf-margin-for="bg-react-lost"] '
'.lf-react-mark[data-token="lost"] > .lf-margin-button-glyph'
)
).to_have_text("🤔") assert page.locator("#bg-reactions p strong").all_text_contents() == [
"1 · 👍 · keep this.",
"2 · ❌ · wrong.",
"3 · 🤔 · unclear.",
"4 · ✂️ · shorten.",
"5 · 🔎 · substantiate.",
"6 · 👀 · pay attention.",
]One smaller thing: $reactions in skills/leaf/assets/registry.json used to state the bound a layer author has to hit — "one or two characters" — and the new wording ("the short mark … including one emoji") drops it while validate_layer_declarations keeps one at four code points. A layer that reaches for a ZWJ sequence like 👨👩👧 (five) now gets a package check failure with nothing in the declaration that predicted it.
Happy to push the three test fixes to this branch if you'd like.
Three nightly tests have been red on `main` since #341, and nightly runs after `main` moves, so PR CI and `wt merge` both stay green while nobody sees them. All three are the same seam: the live interaction gallery injects its playback row from the runtime and leaves the authored page owning it. **The ring census.** The page drew `outline: var(--here-ring)` on the injected presses without naming the ring, so the floor below divided by a population short of it. It was drawing the ring twice over: `offer` marks those buttons `data-lf-offer="button"`, so the theme's pressable floor already carries the hand, the hover tint, the disabled treatment, and a ring that names itself. The page's copies are gone and the floor's answer stands alone. No other authored page in the corpus draws the layer's ring. **The control-row sweep.** The row is a control row nothing had declared. Declaring it means proving it holds still, and it did not: the toggle rewrites its own word as a demo runs — Loading…, Play, Pause, Played — so pressing Replay moved the button beside it, and the live status line changed length on the same line as both presses. The toggle now reserves the width of every word it can say, through `reserve`, the layer's own helper, called where the runtime builds the row — `scripts/corpus.py` copies each source's `<main>` and none of its `<head>`, so a rule in the gallery's head would not reach the generated corpus, which is the page this sweep actually walks. The status line stands under the two presses at every width rather than only on a phone; reserving its width instead would hold the row open at the width of its longest sentence. `interaction-playback` is the new archetype; an archetype may now name an `example`, because a demo is a scenario the module names rather than markup the synthetic stability page can compose, so its proof runs on the gallery itself. Replay is the press for the same reason the diff's review press is: the button that has to hold still is the toggle, and pressing Replay is what sends it through every word it has. **The injected-surfaces walk.** The gallery's own counts had moved on: #341 added a live undecided suggestion and a second stored version, and merging `main` brought the playground package's ask, so the walk now sees thirteen asks and three version rows. `tests/test_site.py` asserted the status line's `margin-left: 0` at 390px, which the layout change makes vacuous; it now reads the invariant that replaced it. ## Checks `uv run pre-commit run --all-files` is clean, and `uv run pytest tests --run-nightly` passed whole — 2096 tests — on this branch before `main` moved under it. On the merged tree that full run reports 11 failures. A paired control, a detached checkout of `ca4ac82d` with none of this branch on it, fails 10 of the same tests, so they arrived with the eight PRs that landed while the first run was going. The eleventh, `test_a_failed_preview_bootstrap_hears_the_replacement_server[theme.css]`, passes on its own here and on the control: a flake in a 27-minute run. The three tests this PR is about pass. Nightly is red on `main` for two reasons this PR does not reach, both worth someone's attention: - the playground package's Reset, Copy instruction and Apply card share rows and match no archetype, so `test_the_composed_corpus_declares_every_control_row_archetype` fails on `main` for that reason now instead; - `.lf-resolve.lf-icon-action` (#347) has the left edge of its focus ring under `.lf-react-trigger` (#349) in the ship-review thread, two independent PRs whose rows now overlap by two pixels, which `test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus` reports as 2 faults over 714 stops. Plus pre-existing reds in `test_render_anchors`, `test_render_export`, `test_render_projection` and `test_render_widgets`, all present on the control. **#340 is the standing fix for the shape of this: nightly modules a PR touches never run before it lands. ## Overlapping PRs **#353 repairs the same three readings, and opened while this branch's first suite was running. It took the `reserve` route from the start, which is where this one has now arrived; it also rehomes the scenarios' `#bg-motion-*` lookups onto the stage, which this does not. One of the two should close, and which is Max's call. ## Note for #351 **#351 deletes this same block of gallery CSS and rehomes none of it, which would leave the injected buttons without their pill shape or their `--aim-floor` aim target. Whichever lands first, the other conflicts here. > _This was written by Claude Code on behalf of max-sixty_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Q7ZBoNLYxFVhWgDsXH1RTx --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…walk to the pill ring (#367) ## Problem The nightly leg of [`ci` on `59d0aa3`](https://github.com/max-sixty/leaf/actions/runs/34060060243) went red on three readings. Two were the interaction gallery and landed with #359; the third, `test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus`, still reproduces on `ac3342a4` and is a different seam — #366 names it as outstanding and does not reach it. The census reports the resolve icon action's focus ring clipped in `ship-review`, in the page and in the comments: ``` in the page of ship-review, the ring on button.lf-btn.lf-resolve.lf-icon-action.lf-ui "" is not all there: its left edge is under button.lf-react-trigger.lf-ui "" (ring 1143,466,1179,502 vs 1119,467,1145,493, sampled 1144,484) ``` The reaction trigger is painted above the message head and turns opaque exactly while the message is focus-within — which is when the resolve control beside it is wearing a ring. It stood off that control's own box by 2px, and the ring is 4px wide of it, so two of those pixels were behind the trigger. Two independent PRs put the rows there: the icon action (#347) and the trigger's offset (#349), each correct about the box it measured. ## Solution Both copies of the rule — the chrome sheet's, and the frozen-conversation mirror in `theme.css` — now stand the trigger off the ring rather than off the box, naming the band as `--here-ring-w` plus the offset each sheet's own focus rule states, and keeping the 2px gap that was already there measured outwards from the ring. Clearing that fault makes the census reach its last assertion for the first time, and it reports the `pill` ring painted nowhere the corpus can be walked to. That one is pre-existing and was masked behind the clip: the strip's trigger wore `lf-pill lf-react-trigger` until #349 made it an icon, so the palette chips behind the press are now the only focusable boxes left drawing that ring — and no walk opens a palette. A `a reaction palette` walk scope presses a message's trigger and stands on the chips. ## Testing - `tests/test_render_controls.py` in full on this branch: 81 passed. - The everyday suite (898 passed, 6 skipped) and `pre-commit run --all-files` pass. - Bug-back for each half, on this branch's own tree: reverting the two CSS rules returns the 2 clipping faults over 714 stops; reverting the walk scope alone returns `1 of the layer's 45 rings are painted nowhere the corpus can be walked to: pill`. <details><summary>Scope, and what this deliberately leaves to other PRs</summary> The same run's other two readings are #359's and merged. `test_the_composed_corpus_declares_every_control_row_archetype` is red on `main` for the playground package's Reset / Copy instruction / Apply card row; #366 declares that archetype, so it is left out of this branch — an earlier revision of this one carried a second implementation of it and it was dropped once #366 appeared. #365 touches `reactions.js` and `chrome.css` but neither the trigger's offset rule nor the `lf-pill` class on a chip, so the walk scope added here keeps its subject if that lands first. </details> --- Automated fix for [failed run](https://github.com/max-sixty/leaf/actions/runs/34060060243) Co-authored-by: leaf-agent <[email protected]>
Replaces the persistent React pill under agent replies with a zero-height hover/focus affordance and an emoji picker. The default vocabulary now asks for keep, wrong, unclear, shorten, substantiate, or attention feedback while preserving stable token IDs and the existing event contract.
Updates the public explanation, feature gallery, generated corpus, and browser/integration coverage.