Repository navigation
fix: start each thread card selection at the least width, and expect #5991's slim card in six tests - #6146
Merged
Conversation
…5991's slim card in six tests A new selection reused the card element with the width the previous selection left, often the measure. Its first fit laid the card out at the least width to read its messages, found one standing tall, and widened it back to the width it started at: a style write that changed nothing, which the write watch failed in four tests. A selection now clears the card's inline width, and the stylesheet stands an unsized card at the least width (it stood one at the measure), so the first fit reads the messages where the card already stands and widens it in one write. What the user sees is unchanged: the fit lands before the frame paints, and an unsized card is unseen. Six tests still expected a card at the measure, or reaching the window's edge, where #5991 keeps a short message's card at the least width. They now expect the least width; placement still reserves the measure beside the words. The head test now writes a comment that stands tall, so the card widens to the margin's cap as its setup intends. test_a_root_summary_keeps_thread_actions_outside_its_fold[1440-False-2] stays red: a slim card leaves the summary's label too little room beside its actions and Next unread, which needs a design choice. Refs #6139
max-sixty
added a commit
that referenced
this pull request
Nov 23, 2026
…nside the card (#6839) Closes #6139. `tests/journeys/margin/test_card_placement.py::test_the_shipped_long_thread_keeps_the_margin_and_its_height` has failed in the nightly run since #5991, first on `assert 320 >= 379`: it still expected the card at the measure's width. #5991's rule keeps a thread card at its least width until a message it shows stands taller than it is wide (`standsTall`, `comment-placement.js`). The tallest message in the shipped long thread, the agent's checklist, stands 249px tall in a 290px text box, so the slim card is right and the test was stale, as six of its siblings were before #6146. Past that first assertion the test held two more expectations that later changes had made stale, which the nightly run never reached: - At 1436×1000 it expected the card to reach the window's edge. The slim card now ends 14px short of it, so the test expects the least width, inside the window. - At 1280×600 it waited for the reply's editor and Send to stand inside the card's thread box. Since #6773 a card's reply box runs over the card's padding to its sides and foot: 2px inside the card's edge and 5px past the thread box. The test now waits for them inside the card. Both card-width checks read the least width from the runtime's `cardMinimum()`, as `test_render_send_placement.py` does, rather than hard-coding 320. Both also check that the card crosses its controls (`cardLeft < controlsRight`), which the docstring promises and nothing checked. The test fails on `main` and passes with this change, run by node id: `uv run pytest "tests/journeys/margin/test_card_placement.py::test_the_shipped_long_thread_keeps_the_margin_and_its_height" -n0`. > _This was written by Claude Code on behalf of max-sixty_
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.
Fixes ten of the eleven browser tests #5991 turned red on
main. #5991 keeps a thread card at its least width (320 px) until a message stands taller than it is wide. Four tests failed on a runtime defect it introduced, and six still expected the old card at the measure.The no-op style write (
test_open_in_panel_moves_the_cards_thread_and_its_reply_to_the_panel,test_pressing_a_page_mark_stands_in_the_thread_it_opens[near-fit]and[long],test_a_card_at_the_windows_foot_grows_back_to_how_it_stood). A new selection reused the card element with the width the previous selection left. Its first fit laid the card out at the least width to read its messages, found one standing tall, and widened the card back to the width it had started at. The style attribute ended unchanged, so the write watch failed. Nowselectclears the card's inline width, and the stylesheet stands an unsized card at the least width instead of the measure. The first fit reads the messages where the card already stands and widens it in one write. This follows #5991's own rule that another selection chooses its width afresh. On screen nothing changes: the fit lands in the same task's microtasks, before the frame paints, and an unplaced card is unseen. A cheaper fix, skipping the slim layout when a message already stands tall in the wider card, isn't enough. It still failsnear-fit, where the same medium-length thread reopens: the message stands tall at 320 px but not at 592.Stale width expectations (
test_a_margin_card_clears_its_row_without_sacrificing_message_width[1440]and[2400],test_a_card_under_a_containing_block_stands_beside_its_cluster[scale(0.25)],test_a_thread_card_takes_the_room_its_window_gives_it,test_a_forced_inline_thread_keeps_its_control_reachable_on_a_crowded_cluster,test_a_head_s_words_take_its_controls_room_while_they_hide). These asserted a card at the measure, or one reaching the window's edge, where each thread holds only short messages. They now expect the least width. Their placement assertions are unchanged: placement still reserves the measure the card may widen to, so where the room past the cluster is short of it, the card still stands beside the words. The head test picked a window where the margin caps the card short of the head's words. With a short comment, the card now stood at 320 px, narrower than that cap. Its comment now stands tall, so the card widens to the cap again, and the test again proves that the head lends its hidden controls' room to its words.Each of these tests failed on
mainbefore the change and passes after it, run by node id. So do #5991's own tests intest_render_send_placement.pyandtest_render_aim.py,pnpm run test:runtimeandpnpm run check.What this leaves.
tests/browser/threads/test_summaries.py::test_a_root_summary_keeps_thread_actions_outside_its_fold[1440-False-2]stays red. In a slim card, the summary header sits in the grid's first track beside the card's actions and Next unread on every line. So "Earlier discussion" wraps, and the disclosure, though it moves to its own line, still truncates to "Show 2 …". Fixing it means choosing which part gives way, so it waits on that choice in #6139.Refs #6139 — automated triage