Skip to content

Open anchored response fields immediately - #181

Merged
max-sixty merged 4 commits into
mainfrom
codex/input-first-response-bar
Sep 1, 2026
Merged

max-sixty merged 4 commits into
mainfrom
codex/input-first-response-bar

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Anchored selections and items now open a focused compact Comment field immediately. The field grows in place, submits on Enter, and exchanges itself for Comment, Suggest, and reaction choices on Tab while preserving one shared visual and control primitive. The runtime keeps drafts and in-flight sends anchored across re-targeting, integrates the r route with the canonical target Button cluster, and updates examples, docs, and browser coverage.

This was written by Codex on behalf of @max-sixty

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Four things from reading the runtime, none of them about the shape of the change — opening the field on the target the reader named reads well, and the bar/field sharing one control primitive removes the two-idioms problem the old 320px card had. Inline on the first three.

The fourth is outside the diff, so it needs a commit rather than a suggestion: openComposer's left and top are now dead — placeComposer was its only reader. Every call site still computes and threads them: fab.onclick takes a getBoundingClientRect() purely to pass it on, openOnDesign forwards from.left/from.top, and the restore-at-load path in leaf.js still passes (innerWidth - 320) / 2, 64 — a centring built from the card width whose CSS rule this PR deletes. Dropping the two positional parameters would also close the gap between them and suggest/about, which a five-argument call now has to count past.

Comment thread skills/leaf/assets/leaf.js Resolved
Comment thread tests/test_render_anchors.py Resolved

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The three inline threads and the dead left/top parameters are all answered. The draft rule itself reads better than the version it replaces — leaving the words on the passage they were written about, and giving the explicit gestures a carry, is the right split now that a field opens on every selection.

Three things on the new commit, inline. The largest is that skills/leaf/CLAUDE.md still states the rule this commit reversed.

Comment thread skills/leaf/CLAUDE.md Resolved
@max-sixty
max-sixty merged commit 63930f9 into main Sep 1, 2026
6 checks passed
@max-sixty
max-sixty deleted the codex/input-first-response-bar branch September 1, 2026 02:55
leaf-agent added a commit that referenced this pull request Sep 1, 2026
…layout change

The nightly suite on main came back 10 failed. Most trace to #189, whose new
pr-walkthrough page replaced the one two nightly-only tests still name and whose
new package widget ships chrome the layer's markers never reached; two trace to
#190's zero-height ToC anchor, which shortened the release page past a named
scroll; and one is an ordering collision between Playwright's sync API and
asyncio.run.

- Point the two stale heading assertions at the page the example now is.
- Route the data-bound diff test's comment through the anchored field, which is
  where #181 moved the press it still clicked.
- Read the sticky sidebar's scroll position off the page instead of naming it.
- Give the author's description a surface the layer's muted ink clears, and the
  changed rows' line numbers an ink that clears their own fill.
- Build CallDiff's disclosure with offer, so an exported copy takes the press
  away, and give the location an href only where following it goes somewhere.
- Read a covered run against what it paints, so clipped overflow stops reading
  as words on words.
- Show a rendered diff and a scrolling code line in the corpus again, which is
  what the two unlit focus rings were missing.
- Run the MCP stdio exchange on its own thread, since the session-scoped browser
  holds an asyncio loop open in the worker's main one.
max-sixty added a commit that referenced this pull request Sep 1, 2026
Two files conflicted with #194, which rewrote the same PR-review surfaces.

`test_render_anchors.py` takes main's side whole. Both branches were
removing the same `.lf-fab` click that #181 stopped drawing; main replaced
it with `expect(.lf-fab-input).to_be_focused()`, and since the composer's
textarea *is* that field (`composerInput = fabInput` in leaf.js), the extra
click this branch added did nothing. That nightly failure is already fixed
on main.

`lf-call-diff.js` keeps main's `navigateToDatum` travel and this branch's
chrome markers. The two sides reached the same export-safety concern from
opposite ends: main added an `lfPrepareExport` hook that strips the toggle,
the counts and the hrefs on the way out; this branch built the toggle with
`offer`, whose `data-lf-offer` marker the standalone bake already removes.
The marker is the declared mechanism — widget-elements.js says a widget
writes none of the three markers by hand — so the hook goes and the flag
checks with it. The counts stay in the copy as `data-lf-gen` content rather
than being deleted: they are an account of the tree a reader still wants on
paper, not a press to take away. The row guard stays too, since it fixes the
live page as well as the copy — the header has no location to travel to, and
a link inside a `<summary>` is two gestures on one box.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_0149R6uAvYxfu8xSjMrbmj2z
max-sixty added a commit that referenced this pull request Oct 1, 2026
…that loses typed words (#1496)

A comment on an item (⌥-click, `c` at a standing item, a visual's
Respond to…) put itself away, words and all, as soon as its item
scrolled out of the window. Every scroll re-placed the response bar
through `refreshFab`; the item's box was read clipped to the window
(`shownRect`), so an item off screen had none, and a failed placement
meant dismissal. A quoted passage survived only because its box was read
unclipped. The same shape goes back to at least #181.

## The fix (`skills/leaf/assets/runtime/composing/surface.js`)

Geometry now says where the bar stands, never whether it stands.

- The item's box is read in the page's plane (`pagePlaneRect`), so an
item scrolled off screen takes the bar with it, focus and caret kept, as
a passage already did.
- A bar with genuinely nowhere to stand (a pane scrolled past its
target, a folded diff file, a covering panel) is withheld: an explicit
`fabWithheld` state, set by `withholdFab` and cleared by whichever
placement brings it back into view (`stoodAgain`), which also returns
the focus. While withheld, the composer's keys and the selection rung
stand down, and `c` brings it back (off-flow's new `away`).
- The bar goes only when its subject leaves the document
(`anchorStands`) or a gesture closes it.

## Keeping it: a rule and a watch, as Stability has

- "Words stay where they were typed", a new section in
`skills/leaf/assets/AGENTS.md`.
- `tests/words_watch.js`, installed on every test page beside
`shift_watch.js`, reports typed words that leave the screen without a
key or press after the last edit, including words a page's handler
empties in the edit's own turn (it reads the trusted edit's `input`
ahead of the page's handlers). A typing key, a modifier, a caret, Tab or
scroll key, a press on the field itself, a scroll, a resize and the
server's news don't count; a chord, a press in a same-origin page
holding the frame, and storage news from another tab of the page do.
`judge_shifts` becomes `judge_watches`.
- `test_words_in_a_box_survive_scrolling_away_and_back` sends every
scroller on each corpus page to both ends and back with each typed box
open (a comment on an item, the page's comment, a thread card's reply)
and requires the words and the focus back. Seven corpus pages fail it on
`main`.
- `known_shifts.py` becomes `known_faults.py`, which also lists
(`KNOWN_LOSSES`) the three tests whose thread, settled by another actor,
still takes the reply box and its words with it. That and three other
follow-ups are in `TODO.md`.

## Behavior that moved

- A diagram's response bar whose target its own scroller carries off
waits out of view and comes back with the focus, rather than retracting
(`test_a_visual_action_follows_its_own_scroller_until_the_target_is_gone`).
- A diff line's comment whose file is folded away waits and stands again
when the file opens, rather than closing with "Draft kept"
(`test_a_data_bound_diff_aims_and_selects_one_source_line`).
- `test_a_draft_wait_only_paints_after_the_shared_busy_delay` presses
Save as a user does instead of by script.

The nightly job ran on this branch twice; the remaining
`tests/test_site.py` failures (`how-it-works`'s diagram parts) fail on
`main` too.

> _This was written by Claude Code on behalf of max-sixty_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants