Skip to content

Open every thread card at the full measure, and add leaf-dev placements, a gallery of thread cards by configuration - #5846

Merged
max-sixty merged 11 commits into
mainfrom
thread-placement-anchor
Nov 14, 2026
Merged

max-sixty merged 11 commits into
mainfrom
thread-placement-anchor

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Every thread card and the comment box now open at the full measure (--thread-card, 592 px), or their room where that is narrower, whatever their messages hold. A card under or over its subject slides left where its start would carry it past the room's right edge, instead of narrowing. Two rules made long, thin cards before:

  • A card took the width of its first words and kept it while open. A short comment's box was 320 px wide, the card its Send opened kept that width, and the agent's long answer then wrapped at 320 px.
  • A card on a whole block started where its minimum width (--thread-card-min, 320 px) ended at the block's right edge, and could widen only rightward from there. On a block reaching the window's edge, it stayed at 336 px.

Now a card neither narrows to its words nor widens as they arrive, so no arriving message moves its controls, and the width it remembered from its first stand is gone. It keeps a box's width only where Send opened it from that box, or the user carried it by its grip. The minimum width still decides which side has room. placement-rules.json states the width as size-width and the slide in place-under-or-over.

uv run leaf-dev placements is the evidence. It opens a thread card in each case of a list and writes a gallery of where each card stands and how it's shaped. A case sets:

  • the subject a thread is on (quoted words or a whole block);
  • the thread's messages;
  • the route that opens its card (m, the margin marker, a tap, or a comment and Send);
  • what follows (the agent's answer arriving, a scroll);
  • its windows: 1728×999, 1440×900 and 1000×700, unless the case names others. At 1440×900 the margin beside a column is narrower than the measure, so a card beside its words there is as wide as that margin.

Each case runs through leaf_dev.visits, the loop leaf-dev probe uses, so every size is what Leaf draws, and --base shows each case beside main. Each capture outlines the block Leaf resolves the thread to (resolveAnchor) and fills the quoted words. Each tile flags:

  • a card narrower than it could be, naming the limit: its unwrapped width, the measure, or its room;
  • a card covering its subject, marked a fault where card and block would fit in the window together;
  • how far the page scrolled as the card opened.

Run with --base against main in its two original windows, the gallery's 13 cases show the change widening all eight narrow cards, and changing one other case: a short question in the 1000×700 window grows from 538 to 592 px. /developing-leaf points at the command beside stills.

Running the gallery in Firefox exposed a render-gate defect: Playwright's Firefox 159 gives the scroll-driven animation on a margin card's message heads a finite end in time, so pageSettled never held while a card was open, and every probe, stills or journey that opened a card in Firefox waited out its 120 s limit. #5885 fixed it on main the same way while this PR was open: finiteMotion counts only animations on a document timeline. This PR adds test_a_scroll_driven_animation_leaves_the_page_settled in tests/browser/test_render_gate.py, which checks that rule in Firefox beside the gate's other settle tests.

Files:

  • browser/runtime/annotation-overlay/thread-preview.js, comment-placement.js, annotation-chrome.css, placement-rules.json, and browser/runtime/thread/held-news.js's record: the full-measure width and the slide.
  • tests/browser/test_render_send_placement.py: Send and reopen now keep one rectangle.
  • dev/leaf_dev/commands/placements.py: the command, its fixture page and CASES; dev/leaf_dev/states.py: open_card returns the scroll before its click.
  • tests/browser/test_render_gate.py: the Firefox test of fix: settle scoped motion waits through one render-gate probe that ignores scroll-driven animations #5885's settle fix.
  • .claude/skills/developing-leaf/SKILL.md: when to run the command.

This was written by Claude Code on behalf of max-sixty

… a margin card open

Playwright's Firefox 159 supports view timelines, and gives the scroll-driven
animation on a margin card's message heads (`lf-msg-annotation-exit`) a finite
end in time (30769 ms) where Chromium gives a percentage. The render gate's
`finiteMotion` read that as an animation still running, so `pageSettled` never
held while a card showed its messages: every `leaf-dev probe`, `stills` or
journey that opened a card in Firefox waited out its 120 s limit. A
scroll-driven animation moves only while something scrolls, which `scrolling`
already reads, so `finiteMotion` now counts only animations on the document's
timeline.

This was also the "page never settles in Firefox" seen while prototyping a
full-measure thread card; it happens on main with any open card.
…rations that shape them

Each case in `CASES` sets a window, the subject a thread is on, its messages,
the route that opens its card and what follows (an answer arriving, a
scroll); the command opens the card on each arm through `leaf_dev.visits`,
outlines the subject on the capture, measures how much narrower the card
stands than it could and how far it covers its subject, and writes a Leaf
page of the gallery. `--base` shows each case before and after a change.

The first cases reproduce the long thin cards a reader met (a card keeping
its first words' width; a card on a whole block starting at its minimum
width) and a long card `m` opens over its words from afar. The placement
module's header points at the command, so a change to placement runs it and
a shape someone meets becomes a case.
…ndows, and say which limit narrows a card

From an independent review of the gallery:

- Each case runs in each of its windows (1728x999 and 1000x700 unless it names
  others), so a new case gets both from one line; the copied narrow-* cases are
  gone. The narrow window now also shows whole-block cards on a heading and a
  widget at 452 px.
- The outline and "covers" come from the block Leaf resolves the thread to
  (`resolveAnchor`'s place: the cell, not the table), measured as an area, and
  the boundary, measure and gap from `comment-placement.js`, with no fallback
  that would hide a renamed export.
- "N px narrower" names its limit: the card's unwrapped width, the measure, or
  its room. Covering is flagged a fault only where card and block fit in the
  window together.
- Sides read "above"/"below"; the phone case taps; a case that can't run
  (an even thread, an answer without a comment, a tap outside a touch window)
  fails when `CASES` loads; the answer to a comment is shown through its New
  reply where the card holds it there.
- `states.open_card` returns the scroll before its click, which `by_marker` reads
  rather than copying it.
- `finiteMotion` asks for any document timeline, not only `document.timeline`.
- The pointer to the command moves from the placement module's header to
  /developing-leaf, beside `stills`.
…s, and judge a fit along the card's side

From the reviewer's second pass: every route takes the window and presses by finger in a touch window; the answer to a comment waits once for its message or its notice; the fit test runs across for a card beside its subject; readings keep case and window apart.
leaf-agent
leaf-agent previously approved these changes Nov 11, 2026
test_suite_source requires a wait's bound to come from a stated deadline; the scroll-driven-animation test passed a literal 10 s.
leaf-agent
leaf-agent previously approved these changes Nov 11, 2026
leaf-agent added a commit that referenced this pull request Nov 12, 2026
…nores scroll-driven animations (#5885)

Firefox 159 gives a scroll-driven (view-timeline) animation, such as a
margin card's message heads, a finite end time. Several test and dev
helpers each kept their own copy of "a finite animation is still
running", which read that animation as motion, so they waited out their
120 s limit whenever a margin card was open in Firefox.
`test_every_part_of_a_floating_box_moves_one_way_per_input[firefox_browser]`
failed this way in the nightly run (#5880).

This replaces those copies with one reading in the render gate:

- `finiteMotion` (`src/leaf/render-checks/runtime.js`) counts only
animations on a `DocumentTimeline`. The hunk is identical to the one in
#5846, so whichever PR lands second merges cleanly over it.
- A new probe, `restingIn(...selectors)`, applies `finiteMotion` within
the elements those selectors name, shadow trees included. A selector
that matches nothing counts as at rest.
- `at_rest` in `test_floating_box_motion`, the three card waits in
`test_render_margin`, and the helpers in `test_composing`,
`test_chrome_contracts` and `dev/leaf_dev/panel_paint.py` now wait with
`wait_for_probe(page, "restingIn", …)`.
- `thread_journey.observe` drops its region wait. The `pageSettled` wait
just before it already covers the same motion across the whole page.

`render_harness`'s panel wait and `margin.CARD_AT_REST` already filter
on `document.timeline`, so they keep their own readings. `CARD_AT_REST`
also has to wait out motion that is held paused, and `restingIn` doesn't
count paused motion.

**Verification.** On main the Firefox case times out after 120 s in
`at_rest` with the falsifying example from the issue. With this change,
both parametrizations of `test_floating_box_motion.py` pass. These also
pass: the edited `test_chrome_contracts`/`test_composing` tests,
`test_render_thread_snapshots.py`, the `test_render_floating_panel`
tests that use `panel_paint.settled`, `test_render_gate.py`, `pnpm run
check:framework` and ruff.
`test_render_gate.py::test_every_idiom_in_the_catalog_stands_in_a_corpus_source`
failed in the selection the same way on unmodified main in Chromium, so
this change doesn't cause it.
`test_margin_card_holds_its_top_while_read_and_its_reply_while_written`
failed at the branch's original base because of its own outdated Send
expectation. #5879 fixed that on main, and with main merged in it passes
here, together with `test_floating_box_motion.py`.

Closes #5880 — automated triage

Co-authored-by: leaf-agent <[email protected]>
…ng to fit

A card took the width of its first words and kept it while open, so the card a
short comment's Send opened stayed 320 px wide while a long answer wrapped
inside it. A card on a whole block started where its minimum width ended at
the block's right edge and could widen only rightward, so on a block reaching
the window's edge it stayed at 336 px.

Now every card and the comment box are as wide as the measure, or their room
where that is narrower, whatever their messages hold. Under or over its
subject, a card reserves that width when it picks its start, so it slides left
at the room's right edge rather than narrowing. A card no longer remembers the
width it first stood at; it keeps a box's width only where Send opened it from
that box or the user carried it. The minimum width still decides which side
has room.

Behavior change: Send and reopen now stand the card in the same rectangle, and
the send-placement test asserts that instead of a reopened card at least the
minimum width.
…, and run placements at 1440×900 too

A card's placement wrote the room as both min-width and max-width; it now writes
width, and the stylesheet's default for an unplaced card is the measure. The
start a card under or over its subject reserves is now the measure at the
surface's positioning scale, as the margin row's clearance already was, so a card
inside an ancestor scaled up no longer narrows at the room's edge. Prose that
still said a card keeps the width it first stood at or widens now says it is as
wide as the measure or its room, and thread-preview.js records the user's
choice of the measure over a card as wide as its first words.

leaf-dev placements runs each case at 1440×900 as well, where the margin beside a
column is between the minimum width and the measure, so a beside card there is
narrower than the measure.
@max-sixty max-sixty changed the title Add leaf-dev placements, a gallery of thread cards by configuration, and let Firefox settle with a card open Open every thread card at the full measure, add leaf-dev placements, and let Firefox settle with a card open Nov 14, 2026
leaf-agent
leaf-agent previously approved these changes Nov 14, 2026

@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 description is now partly stale, and it becomes main's squash commit message. #5885 already landed the finiteMotion change in src/leaf/render-checks/runtime.js and eslint.config.mjs, so this diff no longer touches either file. The "Running the gallery in Firefox exposed a render-gate defect, fixed here" paragraph and the runtime.js/eslint.config.mjs line under Files should say that this PR adds only test_a_scroll_driven_animation_leaves_the_page_settled, which covers the fix #5885 made.

The placements paragraph took the skill to 30,048 characters, past the
30,000 a single read returns whole (test_every_skill_file_reads_in_one_command).
It now says the same in fewer words.
@max-sixty max-sixty changed the title Open every thread card at the full measure, add leaf-dev placements, and let Firefox settle with a card open Open every thread card at the full measure, and add leaf-dev placements, a gallery of thread cards by configuration Nov 14, 2026
@max-sixty
max-sixty merged commit 2d35c9e into main Nov 14, 2026
5 checks passed
@max-sixty
max-sixty deleted the thread-placement-anchor branch November 14, 2026 19:47
max-sixty added a commit that referenced this pull request Nov 14, 2026
…ch for a mechanism before writing one (#5967)

Sessions keep re-implementing leaf-dev mechanisms that already exist;
`leaf-dev placements` (#5846) rewrote `leaf-dev pins`' report page. Two
causes are fixed here. First, Claude Code re-attaches only the first
20,000 characters of a loaded skill after a compaction, and
developing-leaf (29,913 bytes) lost its tail, including "Weigh what a
change adds" with its "What it repeats" search, in 66 of the 78
compacted sessions that loaded it since 1 November. The skill now moves
the procedures one occasion needs into `references/` behind stub
headings, which keep every citation working, and drops to 17,095 bytes.
A pre-commit hook holds it, and the shipped leaf skill, under 19,500
bytes; the skill has grown about 1,500 characters a week, so the hook
fires again within a couple of weeks, asking for the next move. Second,
`dev/AGENTS.md` sent an author to three module headers, while the code
they needed lived inside other commands. It now asks for a search by the
calls a mechanism makes.

Replaying the placements session from the user's request: on the old
guidance, both runs wrote their own media writer, page shell and outline
without opening `pins.py`. On this branch, both grepped for `ImageDraw`
and `media_name`, read pins' report code, and moved its media writer
into `page_fixtures.py` for both commands to import. Neither shared the
page shell or the `lf-shot` pair; #5965 consolidates those.

Moved text is byte-identical to the sections it came from. Pre-commit
passes; no suite run, since nothing here is code.

Asked for by Max. Codex reviewed the diff; its one finding (the search
stopped at `dev/`) is folded in.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Nov 14, 2026
…ount a card's carry as motion for a key (#5978)

Fixes the causes of 17 tests that fail only in the nightly `test-macos`
job. Most of them reproduce on a Mac when the suite runs on the
efficiency cores (`taskpolicy -b`), which `tests/AGENTS.md` now says.
Each fix below rests on a page-side trace of the cause, and on a
before/after run under the condition that reproduced it.

**Runtime.** After a `t`, box-motion can carry the card's list over from
where the previous card was drawn, which may be off screen. A `T`
pressed while the list is still moving should act on the card. But
`focusPlace` recognised motion only from `transform`/`translate`
keyframes, never box-motion's `--lf-box-carry`, so the key let go of the
card and `T` reopened the thread the user was on. `slides()` now counts
the carry. A new test holds the carry for 600s and fails without the
clause. A user on a slow machine can hit this one.

**Test infrastructure.** Firefox's own smooth scroll follows the host's
reduced-motion setting, which Playwright's `reduced_motion` emulation
doesn't cover. With `ui.prefersReducedMotion=1`, all three of the
runner's Firefox smooth-scroll failures reproduce with its exact
readings. The suite's Firefox, and `leaf-dev`'s, now launch with the
pref at 0.

**Tests.** Every other test raced its own setup:

- a click inside a card's 300ms reveal;
- a script scroll before a queued caret reveal or a place restore had
run;
- a key or read before a resize's placement had run;
- a status read before the reading that answers it;
- a page move inside the shift watch's credited frame;
- a refocus faster than the runtime records focus leaving;
- a click onto a hover preview;
- a cleanup that pressed close on a card already fading out;
- a frame count on a glide whose length is fixed in time.

The merge film's unchanged `data-lf-more-below` write also reproduces on
efficiency cores, and stays open. Within one script, `reach.js` paints
the cue, then a composition's `after` restore scrolls the terminal to
its end, and the cue paints again. The zoomed-draft ResizeObserver loop
no longer reproduces since #5846.

Closes #5134. Closes #5188. Ref #5711, #5744, #5780, #5921, #5942,
#5950.

Asked for by max-sixty. `pnpm run check` passes, and so does each
changed test, by node id and in `leaf-dev flake`.

> _This was written by Claude Code on behalf of max-sixty_
leaf-agent added a commit that referenced this pull request Nov 14, 2026
…mment box (#5983)

#5846 opens every thread card and the comment box at the full measure
(`--thread-card`, 592 px, or the room where that is narrower), and a
card "neither narrows to its words nor widens as they arrive". Eight
browser tests on `main` assumed the old sizing. This PR updates them to
the new layout and changes no runtime code. All eight failed on `main`
(`917a3cf25`) and pass on this branch, run locally with Chromium and
Firefox.

**Tests whose expectation #5846 replaced**
-
`test_render_aim.py::test_a_growing_text_comment_keeps_its_side_and_the_page_still[1440|390]`
asserted the box widens as words arrive. It now asserts the width holds
while the box grows downward.
-
`test_render_aim.py::test_a_key_that_widens_the_comment_box_draws_it_at_once`
depended on a key widening the box, and no key does that now. It becomes
`test_a_key_that_takes_a_line_draws_the_comment_box_at_once`. The
guarantee from box-motion.js's "Whose change it is" stays the same: a
key's change to the box is drawn in the frame the key lands. The test
now reads the fill's bottom edge, not its right edge. A line taken at
the window's foot already has its own test.
-
`test_chrome_contracts.py::test_a_caret_is_drawn_at_a_lines_end_and_after_a_list_bullet`
asserted the one-line box sits between its least and wrapped widths. All
three widths are now equal. The caret checks are unchanged, at the box's
full column and at a 346 px window.
-
`threads/test_rewrites.py::test_a_cards_message_controls_cover_its_head`
needs a card narrow enough that the Discard/Save pair reaches the head's
labels. At 1400 px the card now stands under its words at 592 px, and
the labels end clear of the pair. At 1440 px it stands in the margin at
336 px and the pair covers "Queued for Indexer", so the test moves to
1440.

**Tests that pressed content the wider surface now covers.** On #5846's
parent `830e7ae45`, the comment box under a one-line paragraph stood at
x 654–946 in a 1200 px window. Now it starts at x 382, so it covers the
start of the next paragraph. The tests now handle the surface the way a
reader would:
-
`navigation/test_threads.py::test_thread_url_reveals_a_tab_despite_its_generated_display_fragment`
dismisses the card with **Dismiss thread view** before middle-clicking
the link the card covers.
-
`startup/test_projected_data.py::test_a_comment_on_an_identified_datum_follows_the_subject_across_replacements`
presses Escape to put away the title's empty box before aiming at the
row under it.
-
`drafts/test_comment_targets.py::test_completed_page_selection_opens_its_own_comment`
puts 6rem between the earlier subject and the later passages. Without
it, the scroller drag ended on the box, and the words watch could not
count that release as a press elsewhere.

Each of these keeps #5846's intent and moves the interface no further.
Covering more of the following text is a direct result of the slide
#5846 chose, so this PR leaves it as designed.

Closes #5980 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 15, 2026
…sure cards and acked undo (#6046)

Four tests in [scheduled run
43706054091](https://github.com/max-sixty/leaf/actions/runs/43706054091)
still expect what the page did before a merged change. Each change moved
the interface on purpose, and this PR updates the tests to the new
behavior. No product code changes.

- **`test_an_agent_reply_can_move_a_thread_to_its_revised_visual`,
`test_an_agent_reply_can_remove_a_subject_and_detach_its_open_thread`**
(both platforms): #5961 added `holder` to each thread record in `page
state` and updated the model tests, but not these journeys. They now
expect `"holder": {"kind": "main"}`.
-
**`test_complete_views_restore_native_values_in_wrapped_layouts[1200|390]`**
(both platforms): #6040 names a playground control with
`aria-labelledby` (the textbox is still named "Title"). The test looked
for `input[aria-label="Title"]`, which no longer matches, so it now uses
`get_by_role("textbox", name="Title")` like the rest of the test. #6038
moved this test into the journeys tier, so #6040's own CI didn't run it.
- **`test_strokes_join_one_drawing_until_it_is_sent_and_escape_leaves`**
(both platforms): `git bisect` names #5846 as the first bad commit. That
change opens the comment box and the sent thread's card at the full
measure. In the test's window, the box (x 382–946) and then the card (x
368–960) cover `#fig`, where the test's strokes began. The press landed
on the box's text field, so no second stroke was drawn. The two strokes
over the figure now start at its left edge (x ≈ 262–348). They still
begin over another element, which is what the test checks.
- **`test_resolving_a_thread_from_threads_moves_on_to_the_next`** (macOS
only): it pressed `z` as soon as the Resolve was acked, before the page
held the server's reading. That's #5941's mechanism, which #5943 fixed
in the sibling tests. It now uses `undo(page)`, which waits until the
dispatcher would take `z`.

**Verification.** On main (`9f3c6590b`), the five Linux-reproducible
cases fail before this change and pass after it. The edited modules pass
in full, along with `tests/model/test_suite_source.py`: 1,225 passed.
The resolve test passes on Linux both before and after. Its macOS
evidence is the next scheduled `test-macos` run.

This leaves the run's other new failures to their own owners. Those are
listed on #4225.

Refs #4225 — automated triage

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Nov 16, 2026
…than it is wide (#5991)

The comment box keeps the card's least width (320 px) however many lines
are typed in it, and a card beside its text stands at that width until a
message it shows stands taller than it is wide there (about thirteen
lines), then at the measure (592 px) for the rest of the selection. A
comment that tall widens the card Send opens; a long answer widens it as
it arrives, or, held while the user writes a reply, as they send it.
Progress steps don't count. Where a surface's start stands away from its
text, both take the measure at once. #5846 had opened every box and card
at the measure, which stood a short comment in a mostly empty card.

What the diff doesn't show: the card's one widening slides Resolve,
Close and each message's controls 272 px with no press, which
`browser/AGENTS.md` ruled out. Max chose it having seen that, called
those controls secondary, and asked that nothing widen while he types.
The card declares `data-lf-widens` while slim and `tests/shift_watch.js`
credits that widening alone. The threshold is a shape rather than a
count, stated once in `size-width` (placement-rules.json) and measured
by `standsTall` (comment-placement.js), so it follows the card's width
and face. On his pages a card stays slim in 40% of threads, opens wide
for a long comment in 4%, and widens later, at a long answer, in 57%.

Max asked for slim surfaces and reviewed this rule on a Leaf page, with
captures of each moment and of answers of 6, 11 and 16 lines at both
widths, and approved it.

Tests: Send keeps the box's width; a short answer and a folded long
progress step keep a slim card and a tall answer widens it from its
start (failing without the shift-watch credit); a tall answer that shows
while the user writes a reply leaves the card's width until Send; a tall
comment keeps a slim box and Send widens its card; a box away from its
text takes the measure.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Nov 23, 2026
The comment box widens with its first line again, from the least width
(320 px) up to the measure (592 px), then wraps; the card Send opens
starts at the box's width, so the comment keeps the line breaks it was
typed with. #5846 had removed the earlier growth because the card kept
the box's width and wrapped every long answer at 320 px; since #5991 a
tall answer widens a slim card, which removes that problem. Width comes
from CSS intrinsic sizing (`width: max-content` between `min-width` and
`max-width`) rather than script.

| | main | this branch |
| --- | --- | --- |
| Typing a one-line comment | <img
src="https://gist.githubusercontent.com/max-sixty/edff8c80bd56f00079829fe55a6efb8a/raw/27cf6416e9bf2eaef11be97649212f7155c18d20/typing-before.png"
width="400"> | <img
src="https://gist.githubusercontent.com/max-sixty/edff8c80bd56f00079829fe55a6efb8a/raw/27cf6416e9bf2eaef11be97649212f7155c18d20/typing-after.png"
width="400"> |
| The card Send opens | <img
src="https://gist.githubusercontent.com/max-sixty/edff8c80bd56f00079829fe55a6efb8a/raw/27cf6416e9bf2eaef11be97649212f7155c18d20/sent-before.png"
width="400"> | <img
src="https://gist.githubusercontent.com/max-sixty/edff8c80bd56f00079829fe55a6efb8a/raw/27cf6416e9bf2eaef11be97649212f7155c18d20/sent-after.png"
width="400"> |

What the diff doesn't show:

- A change of the box's width alone no longer asks its placement
(`box-motion.js`, `changed`): the words widen it inside the room the
placement gave it. So the placement reserves that room when it places
the box: it stands clear of chrome such as the floating panel across
every column the box may widen into (`comment-placement.js`,
`overflow`), and the comment box's watch also hears the pane that bounds
it.
- The box widens only from the edge its placement holds when that is
where its words start (`comment-placement.js`, `widens`); elsewhere
(left of the text, right of right-to-left text, dragged in a
right-to-left page) it takes the measure at once. A draft long enough to
scroll also holds the box at the measure, since CodeMirror draws only
the lines near what shows.
- Cost: a key that widens the box takes 1–2 ms more main-thread time
(`leaf-dev bench --input draft`), most of it the text field re-reading
which words reach Send's corner; it doesn't grow with the page.

Two behaviours were put to the maintainer, who kept both as built:

- **Send under a mouse.** The box is exactly as wide as its words, so
Send, which stands in the corner the words leave free (#4714), hides
while a one-line comment fills the box (above, right); Enter still
sends. Keeping Send's room on every line, as under a finger, would end
every comment's lines about 30 px earlier.
- **A card reopened later.** The card Send opens starts at the box's
width (left); reopened later it starts at the least width (right), so
reopened cards stay as slim as before. Opening at the first message's
width would cost a measurement each time a card opens.

  | Just after Send | Reopened later |
  | --- | --- |
| <img
src="https://gist.githubusercontent.com/max-sixty/edff8c80bd56f00079829fe55a6efb8a/raw/27cf6416e9bf2eaef11be97649212f7155c18d20/reopen-sent.png"
width="380"> | <img
src="https://gist.githubusercontent.com/max-sixty/edff8c80bd56f00079829fe55a6efb8a/raw/27cf6416e9bf2eaef11be97649212f7155c18d20/reopen-later.png"
width="380"> |

The maintainer asked for this change and chose both behaviours above;
Codex reviewed it three times. New tests cover the widening and Send's
line breaks, a key that widens drawing at once, right-to-left pages (by
`dir`, by CSS, and dragged), a scrolling draft, a narrowing pane, and
clearance from the panel; about 190 focused browser tests, the runtime
tests and `pnpm run check` pass.

> _This was written by Claude Code on behalf of max-sixty_
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