Skip to content

Dock a margin control row on its own line instead of inline with the text - #173

Merged
max-sixty merged 1 commit into
mainfrom
fix/ci-33425820038
Aug 31, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/ci-33425820038

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Problem

The nightly test job on run 33425820038 (afd65dd) came back 15 failed, 1561 passed. Thirteen of the fifteen are the failure shape that has been red on main since bba885a, and #169 already fixes them; this PR is the fourteenth, test_render_widgets.py::test_suggestion_controls_stay_out_of_the_column, which is new on this run and is a real layout bug rather than the test's timing.

A margin row that docks next to an inline perch lands on the line it decides instead of under it. .lf-margin-item is display: inline-flex, and it is position: absolute that blockifies it while it hangs in the rail. Docking only swaps position: static back in, so the row becomes inline-level again and joins whatever line box its perch sits on. For a change inside a card the perch is the inline lf-suggestion element itself — externalPerch takes blockAt(target) ?? target, and TEXT_BLOCK matches no ancestor inside lf-card — so the ✓/✗ row is baseline-aligned onto the last line of the sentence it decides.

Measured, at 820×900 with the panel closed

The row (.lf-margin-item.lf-docked, display: inline-flex, no transform) and the two line boxes of the inline #sug-in-card it is a sibling of:

box top bottom
#sug-in-card line 1 511.09 530.09
docked row 536.28 566.28
#sug-in-card line 2 539.53 558.53

#sug-in-card.contains(row) is false and the row's parent is LF-CARD#card-heater, so this is not overflow out of the widget — the row is inline content sharing the widget's last line, extending above and below the text because an inline-flex box 30px tall is baseline-aligned against a 19px line.

Why it went twelve commits without failing

The test read the layout while it was still moving. Closing the thread panel gives the room back on an eased margin-right, and the column re-wraps for the whole ~0.2s of it; the test clicked Close threads, resized, waited for the docked class, and measured. On an unloaded machine every read landed with body margin still at ~152px, where the narrower column wrapped the card's sentence onto enough lines that the row fell below it and the assertion held. A machine loaded enough to reach the settled layout first reads the real one. The transient and settled readings, same test, same commit:

body margin at the read row top #sug-in-card bottom verdict
151.9px (transition running) 563.47 557.28 passes
0px (settled) 536.28 558.53 fails

So this is not a regression from #166, and reverting all of skills/ to 28b0e2b — the commit before it — reproduces the identical assert 536.28125 >= 558.53125, 6/6. It is a bug the suite could not see. #167, which adds a rendering turn to resized(), would have surfaced it the same way.

Solution

  • .lf-margin-item.lf-docked states its own display: flex, so a docked row is a line of its own wherever it comes to rest rather than inheriting the inline level the absolute position was covering for. width: fit-content keeps the box the width it had in the margin: .lf-margin-item carries pointer-events: auto, and a block-level row stretched to the column would take presses across a whole line the reader may be selecting in.
  • The test says the ordering it depends on: panel_settled(page, open=False) before the resize, so it reads the layout the reader ends up in. Without it the test proves the transient one, which is how it stayed green.

Fixed in the theme rather than in externalPerch, because the perch is the right one — the row belongs beside the change, not after the card — and "docked is a line of its own" is the property every perch needs, not just an inline one.

Testing

  • test_suggestion_controls_stay_out_of_the_column: 3/3 unloaded and 4/4 with the machine loaded, on the rebased head. Bug-back: with theme.css alone reverted to origin/main, it fails on the first run, unloaded — the ordering statement makes it deterministic in both directions.
  • Everyday suite: 740 passed, 6 skipped.
  • Complete nightly suite, run file by file: the only failures left are the thirteen Fix the exported rail and the render coverage after the Button fold #169 covers (test_render_controls ×2, test_render_widgets ×5, test_render_export, test_render_navigation, test_render_outbox, test_render_projection ×2, test_site). No new ones, and test_render_margin.py, test_render_pages.py and test_render_aim.py are green.
  • pre-commit on both changed files: pass.
The fifteenth failure, left alone

test_render_navigation.py::test_composer_marks_the_passage_instead_of_quoting_it failed once on this run (assert 'specimen' in '') and I could not reproduce it: 5 runs at -n0, 12 more with the machine loaded, and 3 whole-file runs at -n 2, all green, including on the rebased head. It stays unclassified rather than fixed — a guess at a wait for a failure that reproduces nowhere is how a test stops proving anything.


Automated fix for failed run

@max-sixty
max-sixty merged commit 0eec71a into main Aug 31, 2026
3 checks passed
@max-sixty
max-sixty deleted the fix/ci-33425820038 branch August 31, 2026 21:52
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