Repository navigation
Align comment and thread browser checks with carried frames - #1600
Conversation
|
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:
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.
|
|
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.
|
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.
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_wordscontinues 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.