Skip to content

Keep a card's room below its turns as a row, so Firefox shows a rewrite's whole frame at the card's end - #7132

Merged
max-sixty merged 4 commits into
mainfrom
message-editor-bottom-edge
Nov 25, 2026
Merged

max-sixty merged 4 commits into
mainfrom
message-editor-bottom-edge

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

In Firefox, a rewrite of the last message in a margin card scrolled to its end lost its bottom edge. The focused field draws its frame as a ring outside its box, in 8px of room the card's transcript kept below its last turn as bottom padding. Firefox leaves a grid scroller's bottom padding out of its scroll range whenever one of its items is position: sticky, and the transcript is a grid with two: the paper row over its heads, and New reply. So the scroll range ended at the field's border and cut the ring. A 100px grid scroller with 8px of bottom padding and a 150px item scrolls 158px; with a 20px sticky item added, Firefox 159 scrolls 170px, Chromium and WebKit 178px.

The transcript now keeps that room as an ::after row after the last turn, as it already keeps the room above its heads as a row. New reply drops the bottom offset that compensated for the padding; in Firefox the same gap had stood it 8px below the card's edge. laidOutHeight, which a ride reads in place of the scroll height, counts a scroller's in-flow ::after. notes/browser-support.md records the gap with the fixture to recheck it.

Stills of every card state: in Chromium no pixel changes; in Firefox the rewrite and New reply above, and scrolled cards end 8px further down, as in Chromium. Max reported the missing edge.

Tests: a new test holds the rewrite's ring whole at a scrolled card's end in Chromium and Firefox (it fails in Firefox on main), and a new stills state, ship-card-rewrite-at-foot, reaches it. A margin-card test that read the padding now checks where the last turn stops. Focused card, rewrite, New reply, stuck-head and ride tests pass, as does pnpm run test:runtime.

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

…nough to show a rewrite's whole ring

A rewrite of the user's last turn, with a margin card scrolled to its end,
showed no bottom edge in Firefox: the field draws its focus ring outside its
frame, in the room the transcript kept below its turns as end padding, and
Firefox left that padding out of the transcript's scroll range. Firefox does
this for any grid scroll container holding a `position: sticky` item, and the
transcript holds two: the paper row over its heads and New reply. Chromium and
WebKit keep the padding. The same gap stood New reply 8px below the card's
scrollport in Firefox, cutting its ground.

The transcript now keeps that room as a row its `::after` holds after the last
turn, as it already keeps the room above its heads as a row, and New reply
sticks at the scrollport's edge with no offset for padding. `laidOutHeight`,
which a ride reads in place of the scroll height, counts a scroller's in-flow
`::after`. notes/browser-support.md records the Firefox gap with a fixture to
recheck it.

A new state, `ship-card-rewrite-at-foot`, reaches the rewrite at a scrolled
card's end, and a test holds its ring whole in Chromium and Firefox; it fails
in Firefox with the room kept as padding.

> _This was written by Claude Code on behalf of Maximilian Roos_
…the transcript's padding

The margin-card test read the transcript's bottom padding as the room its
scrollport reaches under the reply row; the room is now a row after the last
turn. It now scrolls the transcript to its end and checks that the last turn
stops above the reply row, which fails if the room goes. The browser-support
note names the playground's controls pane as another grid scroller the Firefox
gap reaches.
leaf-agent
leaf-agent previously approved these changes Nov 25, 2026
max-sixty added a commit that referenced this pull request Nov 25, 2026
…eck the layers (#7119)

Moves each top-level child of `browser/runtime/` into a directory for
its import layer, and rewrites the dependency-cruiser layering check
(#7113) to name 11 layers in place of an order of 187 children. A module
imports only its own layer and the layers below it. The layering, drawn
from today's imports, leaves 2 imports pointing up, against 15 for the
best flat order, so the known list drops from 15 entries to 2. No
behaviour changes.

| # | Layer | Directory |
|---|---|---|
| 0 | Entry points and diagnostics | top level of `runtime/` |
| 1 | Floating panel, page dialogs and page keys | `panel/` |
| 2 | Annotation presentation, composing and undo | `annotations/` |
| 3 | Application and widget host | `host/` |
| 4 | Page features: annotation inventory, contributions, version travel
| `features/` |
| 5 | Records and history | `records/` |
| 6 | Page readings, places and paint | `readings/` |
| 7 | Transport, errors and notices | `transport/` |
| 8 | DOM, geometry, focus and the key register | `dom/` |
| 9 | State and registry | `state/` |
| 10 | Primitives and the library | `base/`, and `lib/` where it was |

**What stays put.** The entry points (`bootstrap`, `prepaint`,
`check-api`, `validation`, `widget-api`, `portable-api`,
`stage-integration`, `age`) and `lib/` keep their paths, since pages,
packages, the server and the render checks load them by served path. So
do the files that aren't modules: `chrome.css`, `marks.css`,
`panel-row.html` and `kernel-registry.json`, which the server and Python
read at their served paths. A child directory keeps its name inside its
layer, as in `dom/keyboard/`.

**How the paths moved.** The first commit is the move with `git mv` (all
271 renames detected) and the path rewrites. A script resolved every
relative and served-path specifier in the old tree and wrote the
target's new path; other references in Python, configs, the build, tests
and guidance followed. The primitives' eslint rule now names each
primitive's neighbours by the relative path from its own place. Eval
fixtures, pinned GitHub permalinks and the example diff in
`worktree-diffs.html` keep the paths they recorded. The second commit
rewrites the check and adds "Import layers" to `browser/AGENTS.md`. A
later commit gives the new path wherever guidance, comments or tests
named a moved top-level module by its bare filename (`focus.js` →
`dom/focus.js`), which had also been its path under `runtime/`; a
sibling in the same directory keeps its bare name, and a basename code
compares keeps it too.

**The two upward imports** in `.config/dependency-cruiser-known.json`:
`host/application.js` → `annotations/undo.js`, and
`host/sample-child.js` → `annotations/composing/page-image.js` (a lazy
import).

**What to check.**
- The framework's facade stays excluded from the graph by its served
path, now `/runtime/records/framework.js`, as #7113's config already
did. Twelve modules below `records/` import it that way, and
`state/semantic-state.js` reaches the record folds through its
`createSemanticApplication`, so the check doesn't see that route from
`state/` up to `records/`.
- Open PRs that touch runtime files, #7082 and #7132, need `main` merged
in; git's rename detection carries most of their edits to the new paths.
- `test_each_sampled_focus_ring_is_shown_whole_in_its_surface`
(journeys) runs here because the PR touches its file, and fails as it
does on `main`. One of its six faults is real: since #7091, an opened
settled decision's mark stands as tall as its row, so its ring runs
under the next row. The other five are the check reading a transparent
click target as paint over the ring. #7129 fixes both. The move doesn't
cause it.

Tests: `pnpm run check` (type checks, `test:runtime` 1130 pass, build
and worker tests), `pnpm run build:browser` (no generated file changed),
the prepared kernel build (same 68 outputs as base), pre-commit on every
changed file, `tests/smoke`, the model tests for served runtime modules
and public modules (`test_module_url_delivery`,
`test_revision_delivery`, `test_distribution`, `test_interact_layer`:
318 pass), `test_owner_index`, the prepared-install journey in
`tests/journeys/test_distribution.py`, and `leaf-dev probe alert-review
--base`: the page boots, the panel draws the same label, with the same
317 requests and no console output on either arm.

> _This was written by Claude Code on behalf of max-sixty_
@max-sixty
max-sixty merged commit 21748e6 into main Nov 25, 2026
6 checks passed
@max-sixty
max-sixty deleted the message-editor-bottom-edge branch November 25, 2026 08:32
leaf-agent added a commit that referenced this pull request Nov 25, 2026
…es are released (#7161)

`reload_in_a_row` (`tests/browser/startup/test_readiness.py`) held every
request a reloaded document made until the test had taken its step in
that document. It then answered only the requests held at that moment. A
request the document made after that release stayed held forever. That
includes its `/api/state` read, which on a loaded runner can arrive
after the layer's `registry.json`. The document never got the answer
that tells it another Leaf is serving, so it never reloaded again, and
the helper's next `expect_navigation` timed out. That is the
`test_a_value_typed_into_the_page_rides_two_reloads_in_a_row` failure in
[run
45573880821](https://github.com/max-sixty/leaf/actions/runs/45573880821):
`Page.expect_navigation: Timeout 120000ms exceeded`. The failure
screenshot shows the reloaded document still on "Connecting…".

From the moment a document's step runs, the helper now answers every
request that document makes. The sibling helper
`reload_with_its_answers_held` already does this with its `released`
flag. What the three callers assert is unchanged.

**Verification:**
- **Forced ordering.** An init script delays the reloaded document's
`/api/state` fetch by 3 s. Before the change the test times out with the
CI error; after it, the test passes.
- **Load.** Before the change the test passed 54 unforced copies under
load (`leaf-dev suite flake`, including `--load 4 --cpu-throttle 4`), so
the race only shows on a slow enough runner. After the change, the
helper's three callers each passed 8 of 8 copies under `--load 2`.

The same run's other failure, the Firefox node of
`test_a_card_s_turn_glided_into_sight_stays_there_as_the_transcript_above_grows`,
ran at `65a23a6`. That commit comes before #7132, which fixed it (see
#7142), so this PR leaves it alone.

Refs #7160 — automated triage

Co-authored-by: leaf-agent <[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