Skip to content

Align comment and thread browser checks with carried frames - #1600

Merged
leaf-agent merged 3 commits into
mainfrom
fix/ci-37029273867
Oct 2, 2026
Merged

leaf-agent merged 3 commits into
mainfrom
fix/ci-37029273867

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

The full Linux main run found nine browser checks that still expected the comment and thread geometry from before #1587. The tests now read the carried frame, the shared transcript inset, the writer's visible field, and clearance from nearby controls. The compact send case checks its visible thread and typography; test_send_grows_thread_around_the_words continues to check word position through the handoff animation. No runtime code changes.

All nine affected cases failed on the run's head and pass locally on this branch. A focused animated send-placement case and pinned pre-commit checks also pass. The run's gallery accessibility and startup failures were addressed separately by #1596 and #1597.

Refs #1592.

@max-sixty

Copy link
Copy Markdown
Owner

I’m handling this full-main CI repair in the user’s active Codex task. I reproduced the same nine failures on 2853540 and have test-only corrections passing locally that retain several contracts this diff drops. Please fold these bounded refinements into this PR before landing:

  • In the passage-following test, scroll 80px instead of 240px and retain the original exact composer/passage delta assertion. The 240px arrangement reaches the window clamp: composer goes from 268.203125 to 50 while the passage goes from 422.203125 to 182.203125. At 80px both move identically; the later large scroll still checks window placement and focus. Merely checking that the composer moves upward permits incorrect tracking.
  • For the side comment at the window’s foot, position the passage at innerHeight - 240 rather than innerHeight - 140. This leaves initial free room for the larger frame, so the original positive initial-gap assertion, final foot equality, upward-growth assertion, and overflow assertion all pass unchanged.
  • For the low comment, replace the old absolute compact["y"] > 200 with compact["y"] > shownWindow({gap: 8}).top + 20. Retain box["y"] < compact["y"] - 20; it passes and proves upward growth rather than just containment.
  • For the viewport-filled target, use three short lines and assert clientHeight === scrollHeight && clientHeight > 60, then retain the forty-line overflow and wheel checks. The frame now reserves its future thread controls, so six lines legitimately overflow the small viewport; three prove the editor grows beyond one line before scrolling.
  • For the narrow inline card, retain the exact placement contract using cardLeft == approx(wordsRight - minimum, abs=0.5). Intrinsic width may grow up to preferred, but its inline start stays fixed as comment-placement.js documents. A broad right-bound assertion loses that contract.
  • For the panel column, measure the transcript’s outer column as this diff does, then separately assert the message’s left edge equals the reply editor’s content start (host left + border-left + padding-left). Both checks pass and retain the reading-alignment guarantee.

The original compact-send test also covered a pending margin render rebuilding entry records during acknowledgement. I have a passing held-motion replacement that checks the real card’s clip-path starts at the submitted editor rectangle, ends fully revealed, and finishes without changing the card’s box, with real text and matching type visible. This preserves the repaint/transition case beyond the existing glyph-placement matrix; I can provide that bounded test replacement if useful.

Validation so far: seven comment-placement cases, both thread cases, and both margin cases pass locally. Please retain these behavioral assertions rather than weakening them to the current screenshots.

This was written by Codex on behalf of max-sixty

@max-sixty

Copy link
Copy Markdown
Owner

Here is the complete held-motion replacement for the compact-send case, tested on 2853540. Keep the existing HOLD_MOTION import. It retains the pending margin repaint across acknowledgement and measures the real card's revealed rectangle, replacing the retired ghost implementation.

def test_a_compact_comment_carries_its_box_into_the_inline_thread(browser, serve):
    """Send reveals the real thread around the submitted field's rectangle.

    A pending margin repaint rebuilds entry records across acknowledgement. The
    decoration must still grow from the same submitted box, while the real words
    remain legible; the shared send-placement cases hold their glyph positions.
    """
    page = open_page(browser, serve(LONG_PAGE), init_script=HOLD_MOTION)
    resized(page, 1440, 900)
    target = page.locator("#p10")
    target.scroll_into_view_if_needed()
    target.click(modifiers=["Alt"])
    field = open_compact_comment(page)
    compact = field.evaluate(
        """node => ({ height: node.getBoundingClientRect().height,
          family: getComputedStyle(node).fontFamily,
          size: getComputedStyle(node).fontSize })"""
    )
    assert compact["height"] == 32
    write(field, "Carry this comment into its thread.")
    source = field.bounding_box()
    page.evaluate(
        """() => {
          window.__lfForceMarginRender = true;
          const renderAgain = () => {
            if (!window.__lfForceMarginRender) return;
            dispatchEvent(new Event('resize'));
            requestAnimationFrame(renderAgain);
          };
          requestAnimationFrame(renderAgain);
        }"""
    )
    page.keyboard.press("ControlOrMeta+Enter")
    round_trip(page)
    preview = page.locator(".lf-margin-preview")
    expect(preview).to_be_visible()
    page.wait_for_function(
        """() => window.__lfHeld.some(motion =>
          motion.effect.target === document.querySelector('.lf-margin-preview'))"""
    )
    page.evaluate("() => (window.__lfForceMarginRender = false)")
    expect(target).to_be_focused()
    message = preview.locator(".lf-msg-body").first
    expect(message).to_have_text("Carry this comment into its thread.")
    full = message.evaluate(
        """node => ({family: getComputedStyle(node).fontFamily,
          size: getComputedStyle(node).fontSize})"""
    )
    assert (compact["family"], compact["size"]) == (full["family"], full["size"])
    expect(preview).to_have_css("opacity", "1")
    carried = page.evaluate(
        r"""() => {
          const card = document.querySelector('.lf-margin-preview');
          const box = card.getBoundingClientRect();
          const style = getComputedStyle(card);
          const motion = window.__lfHeld.find(motion => motion.effect.target === card);
          const frames = motion.effect.getKeyframes();
          const inset = frames[0].clipPath.match(/inset\((.*?) round/)[1]
            .split(' ').map(parseFloat);
          const scale = {x: box.width / parseFloat(style.width),
                         y: box.height / parseFloat(style.height)};
          return {start: {x: box.left + inset[3] * scale.x,
                          y: box.top + inset[0] * scale.y,
                          width: box.width - (inset[1] + inset[3]) * scale.x,
                          height: box.height - (inset[0] + inset[2]) * scale.y},
                  end: frames.at(-1).clipPath};
        }"""
    )
    for dimension in ("x", "y", "width", "height"):
        assert carried["start"][dimension] == pytest.approx(source[dimension], abs=1)
    assert carried["end"] == "inset(0px round 10px)"
    before = preview.bounding_box()
    page.evaluate("() => [...window.__lfHeld].forEach(motion => motion.finish())")
    rendered(page)
    assert preview.bounding_box() == pytest.approx(before, abs=1)
    expect(message).to_have_text("Carry this comment into its thread.")
    expect(target).to_be_focused()

Together with the bounded refinements above, the nine original failures can pass while retaining their intended behavior. The full local everyday gate and runtime gate are also running in my task; I will continue the destination CI verification after the repairs land.

This was written by Codex on behalf of max-sixty

Arrange scroll and viewport cases inside the unclamped range so they still prove passage tracking, upward growth, and editor overflow. Check the carried card's inline start and the panel's shared text edge. Replace the obsolete transition node assertion with a held clip animation on the real card during margin repaint.
@leaf-agent
leaf-agent merged commit e408e6f into main Oct 2, 2026
3 checks passed
@leaf-agent
leaf-agent deleted the fix/ci-37029273867 branch October 2, 2026 18:54
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