Repository navigation
Dock a margin control row on its own line instead of inline with the text - #173
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The nightly
testjob on run 33425820038 (afd65dd) came back15 failed, 1561 passed. Thirteen of the fifteen are the failure shape that has been red on main sincebba885a, 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-itemisdisplay: inline-flex, and it isposition: absolutethat blockifies it while it hangs in the rail. Docking only swapsposition: staticback 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 inlinelf-suggestionelement itself —externalPerchtakesblockAt(target) ?? target, andTEXT_BLOCKmatches no ancestor insidelf-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-cardit is a sibling of:#sug-in-cardline 1#sug-in-cardline 2#sug-in-card.contains(row)isfalseand the row's parent isLF-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:#sug-in-cardbottomSo this is not a regression from #166, and reverting all of
skills/to28b0e2b— the commit before it — reproduces the identicalassert 536.28125 >= 558.53125, 6/6. It is a bug the suite could not see. #167, which adds a rendering turn toresized(), would have surfaced it the same way.Solution
.lf-margin-item.lf-dockedstates its owndisplay: 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-contentkeeps the box the width it had in the margin:.lf-margin-itemcarriespointer-events: auto, and a block-level row stretched to the column would take presses across a whole line the reader may be selecting in.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: withtheme.cssalone reverted toorigin/main, it fails on the first run, unloaded — the ordering statement makes it deterministic in both directions.740 passed, 6 skipped.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, andtest_render_margin.py,test_render_pages.pyandtest_render_aim.pyare green.pre-commiton both changed files: pass.The fifteenth failure, left alone
test_render_navigation.py::test_composer_marks_the_passage_instead_of_quoting_itfailed 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