Skip to content

test: give the chart and diff reply fixtures an opening tag alone on its line - #6293

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-6291
Nov 17, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-6291

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

#6247 reads an agent message's HTML by CommonMark's rules, under which a block of HTML starts only from an opening tag alone on its line (skills/leaf/references/threads.md). The two failing tests seed replies whose widget opens <lf-chart id=…><pre> and <lf-diff id=…><pre> on one line. Markdown now wraps that in a <p>, the browser's parser closes the paragraph at <pre> and moves the <pre> out of the widget, so the chart throws <lf-chart> has no data body and the diff never renders. The fixtures are seeded with append_carried_log_record, past admission, so nothing reported the shape.

The fixtures now put <pre> on its own line, as #6247 did for its own fixtures (test_draw_failures.py, test_draft_editing.py). This keeps #6247's intent and moves no interface: the tests still check that a chart in a closed thread draws at its visible width once opened, and that a diff in a panel reply takes the keyboard.

Verified locally: both tests fail on main (the chart with the "no data body" error the issue quotes, the diff with the wait timeout) and pass with this change:

  • tests/browser/widgets/test_charts.py::test_a_chart_in_a_closed_thread_draws_at_its_visible_width_when_opened
  • tests/browser/controls/test_focus.py::test_a_scroll_box_in_a_panel_reply_takes_the_keyboard

passages.message_markup on the new fixtures now draws each widget as its own block with the <pre> whole inside it.

Closes #6291 — automated triage

…its line

#6247 reads an agent message's HTML by CommonMark's rules, under which a
block of HTML starts only from an opening tag alone on its line. The two
fixtures wrote `<lf-chart id=…><pre>` and `<lf-diff id=…><pre>` on one
line, so the reply drew the widget inside a paragraph, the browser's
parser moved the `<pre>` out of it, and the chart threw "has no data
body" and the diff never rendered. The fixtures are seeded past
admission, which would refuse them, so nothing reported the shape. They
now put `<pre>` on its own line, as #6247 did for its own fixtures; what
the tests protect (a chart drawing at its visible width once its thread
opens, a scroll box in a reply taking the keyboard) is unchanged.

Closes #6291
@leaf-agent
leaf-agent merged commit dac6f24 into main Nov 17, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-6291 branch November 17, 2026 11:32
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.

Charts and diffs in an agent reply fail to draw after #6247 reads message HTML by CommonMark

1 participant