Skip to content

test: size five thread-card tests to the wider card gap from #5853 - #5928

Merged
leaf-agent merged 3 commits into
mainfrom
fix/issue-5917
Nov 13, 2026
Merged

leaf-agent merged 3 commits into
mainfrom
fix/issue-5917

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

#5853 made a thread card stand clear of its subject by subjectGap (the mark's room, --focus-region-room, plus COMMENT_GAP) instead of COMMENT_GAP alone. As that PR said, a card beside its words now narrows by 8px and needs 8px more room before it gives up standing beside. Five tests were sized to the old gap and have failed on main since, four in every ci push run and one in the nightly tier: each passes at #5853's parent 7c2112135 and fails at a298398f6. This change keeps #5853's placement and gives each test back the room the new gap takes; no runtime code changes.

  • test_a_card_s_head_stands_whole_beside_news[True]: at 1400px the touch card no longer fits beside its words, so it went under, grew wider and kept its time whole. At 1408px it stands beside again, and the docstring names the new width.
  • test_a_head_s_words_take_its_controls_room_while_they_hide: at 1440px the card is now 336px, which cuts the queued receipt (118px of words in 111px). At 1456px the card is 344px again, the width the base drew at 1440px. A margin card grows 0.5px for each 1px of window, which is why this takes 16px.
  • test_one_unchanged_rewrite_stands_open_in_a_thread_across_its_readers: at 1400px the card no longer fits beside the Feed reader, so it stands over the Feed message and blocks its double-click (Playwright: ".lf-msg-head … intercepts pointer events"). That test checks that only one rewrite stays open at a time, not where the card stands, so it now opens at 1408px.
  • test_a_source_replacement_preserves_the_focused_draft_and_its_original_anchor[whole-datum]: the reopened card stands under the document 15px down. The old bound, + 10, held only the old 8px gap. The bound now asks the overlay for subjectGap(), so the test follows the place-clear rule from its owner.
  • tests/journeys/test_render_margin.py::test_a_second_margin_reply_grows_below_the_first_line (nightly): the card under its subject now starts 8px lower, so in a 1000×600 window the grown draft reaches the window's foot and its transcript gives up 8px, which moves the reply box's top up 8px. At 608px tall the card grows downward as it did before, and the long draft that follows still bounds it.

The four push-tier tests pass on this PR's CI and fail on main without it. The journey's placement assertions now pass, but the journey still errors at teardown with ResizeObserver loop completed with undelivered notifications. That error comes from #5811 (f58c2cac7), not from #5853 or this change: bisected locally, it's absent at #5811's parent and present at every commit since, including #5853's parent. On main it's hidden behind the placement failure this PR fixes. #5933 tracks it, so the journey stays red until that's fixed.

Closes #5917 — automated triage

…s subject

#5853 stood a thread card a mark's room plus COMMENT_GAP clear of its
subject, so a card beside its words is 8px narrower and needs 8px more
room to stand beside. Four tests were sized to the old 8px gap. Each now
gets that room back (a wider window, or a bound that reads
--focus-region-room), and the placement they protect is unchanged.

Closes #5917
…elow its subject

A card below its subject now starts 16px under it, not 8px, so in a
1000x600 window the grown draft hits the window's foot and its
transcript gives up the 8px. At 608px the card grows downward as it did
before, and then the long draft bounds it as before.

Closes #5917
@leaf-agent leaf-agent changed the title test: size four thread-card tests to the wider card gap from #5853 test: size five thread-card tests to the wider card gap from #5853 Nov 13, 2026

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The new bound works subjectGap() out again: the literal 8 is COMMENT_GAP, plus the CSS variable. That copy of the placement rule is what broke these tests when #5853 changed the gap, and a future change to COMMENT_GAP would break this bound the same way. subjectGap is already exported through window.__lfOverlayApi() (annotation-overlay/check-api.js), and test_render_send_placement.py reads it that way, so the test can ask the owner for the gap.

…ting COMMENT_GAP

The reopened-card bound in test_a_source_replacement_preserves_the_focused_draft_and_its_original_anchor
now asks the overlay's subjectGap() for the gap, so a later change to COMMENT_GAP or
--focus-region-room moves the bound with the placement rule.
@leaf-agent
leaf-agent merged commit 415cf1d into main Nov 13, 2026
6 of 7 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5917 branch November 13, 2026 09:03
leaf-agent added a commit that referenced this pull request Nov 27, 2026
…#7415)

#7329 opens every comment card slim (320 px) instead of the 592 px a
card under its words used to take. In this test the first message now
wraps, so the card stands 21 px taller. At the 1000×608 window the
draft's second line then already reaches the window's foot (542 px): the
card stops there and the transcript scrolls 4 px, which lifts the editor
from 481 to 477. The card's top and width hold throughout, so the box
isn't re-standing or widening. This is the test's own later "bounded"
phase, arriving one line early.

The repair gives the test a 640 px window. The second line grows below
the first again, and the long draft still reaches the foot and shares
the card with its transcript, so both behaviors the test protects are
still checked. #7329's slim card stays, and no runtime code changes.
This follows the precedent of #5928, which resized thread-card tests
after a placement change.

Verification: the test fails on `main` at 608 px (`assert 477 == 481 ±
0.5`) and passes at 640 px on this branch (Linux, run by node id). A
probe at #7329's parent (`a5d8c24ec`) confirmed the cause: there the
card was 592 px wide and the message 64 px tall, and with the slim card
it is 85 px. The test failed on macOS in scheduled run 45985529285. Mac
fonts can wrap differently, and 640 px leaves about 30 px more room than
Linux needs.

Closes #7408 — 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.

Four thread-card layout tests fail on main since a298398f6: card head, hidden controls, feed rewrite, code-review draft box

1 participant