Skip to content

Commit 158ee96

Browse files
committed
test(ui): address report fence review feedback
1 parent d25d401 commit 158ee96

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/pythinker_code/ui/shell/visualize/_blocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def _find_committed_boundary(text: str) -> int | None:
162162

163163
def _starts_with_report_fence(text: str) -> bool:
164164
stripped = text.lstrip().casefold()
165-
return stripped.startswith("```report") or stripped.startswith("~~~report")
165+
return stripped.startswith(("```report", "~~~report"))
166166

167167

168168
def _tail_lines(text: str, n: int) -> str:

tests/ui_and_conv/test_streaming_content_block.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -335,12 +335,8 @@ def test_composing_commits_on_newline(self):
335335
pending = block.raw_text[block._committed_len :]
336336
assert "Third." in pending
337337

338-
def test_report_fence_continuation_keeps_gap_after_streamed_prose(self, monkeypatch):
339-
from importlib import import_module
340-
341-
blocks_module = import_module("pythinker_code.ui.shell.visualize._blocks")
338+
def test_report_fence_continuation_keeps_gap_after_streamed_prose(self):
342339
output_console = Console(record=True, width=100, color_system=None)
343-
monkeypatch.setattr(blocks_module, "console", output_console)
344340

345341
block = _ContentBlock(is_think=False)
346342
block.append("Deep scan completed. Full report saved here:\n")
@@ -349,8 +345,8 @@ def test_report_fence_continuation_keeps_gap_after_streamed_prose(self, monkeypa
349345
output_console.print(block.compose_final())
350346
output = output_console.export_text()
351347

352-
assert "Deep scan completed" in output
353-
assert "\n\n ╭─ Deep Code Scan Results" in output
348+
assert output.startswith("\n")
349+
assert "Deep Code Scan Results" in output
354350

355351
def test_composing_no_commit_without_newline(self):
356352
block = _ContentBlock(is_think=False)

0 commit comments

Comments
 (0)