Skip to content

test: reproduce hidden code copy controls entering layout - #1840

Closed
leaf-agent wants to merge 3 commits into
mainfrom
repro/issue-1839
Closed

leaf-agent wants to merge 3 commits into
mainfrom
repro/issue-1839

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

This deliberately failing browser test captures one cause of #1839. It puts 100 code blocks in a closed disclosure and checks whether their copy controls participate in layout. On the current runtime, all 100 controls have layout boxes even though their sources are hidden. Keeping those controls out of layout should make this assertion pass.

This covers the hidden-source copy controls only. The report also identifies visible offscreen controls, margin clusters, and repeated forced layouts during thread navigation; this test does not settle those costs or propose an implementation.

uv run pytest tests/test_render_anchors.py::test_hidden_code_copy_controls_do_not_enter_layout -q -n0 fails with assert 100 == 0 at tests/test_render_anchors.py:1532.

Automated triage for #1839

@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 focused browser test currently fails with assert 100 == 0, as the PR describes. It needs a runtime fix before this can land.

Comment thread tests/test_render_anchors.py Resolved
The hidden-layout regression protects absent layout boxes and a usable copy control after reveal, without requiring hidden controls to be created eagerly.
@max-sixty

Copy link
Copy Markdown
Owner

@leaf-agent status of this?

@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Still a reproducer, not a fix. At e7df8819, the new browser test fails with assert 100 == 0: all 100 copy controls for code blocks in a closed disclosure still have layout boxes (test job). The PR is therefore not ready to merge.

The controls live in the chrome root and use an offscreen anchor fallback when their sources are hidden. I have not pushed a runtime change because a fix needs to govern when anchored chrome participates in layout while keeping copy available as a source appears; #1839 also identifies visible offscreen controls and margin clusters under the same layout cost. The next step is to settle that shared visibility rule and measure the thread-navigation path against the reported page.

@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Closing this reproducer because #1851 merged the Copy visibility fix and added test_code_copy_leaves_the_window_with_its_hidden_source. That test checks 100 controls in a closed disclosure and a hidden tab, verifies they have no layout boxes, and checks that Copy works after reveal. #1890 separately addressed margin-row layout cost.

@leaf-agent leaf-agent closed this Oct 8, 2026
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