Repository navigation
test(ui): split streaming markdown tests to restore the core lint lane - #141485
Conversation
markdown.test.ts exceeded the max-lines lint limit after #141369 and #141431, turning the core lint lane red for every PR rebased onto main. Move the toStreamingMarkdownParts and indented-source blocks verbatim into markdown-streaming-parts.test.ts and drop the imports the remaining file no longer uses.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 3:30 PM ET / 19:30 UTC. ClawSweeper reviewWhat this changesMove streaming and indented Markdown tests into a separate test file so the original file fits the lint limit while preserving existing assertions. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful, narrowly scoped lint repair, with no introduced correctness findings. The fetched main still contains the oversized test file, and the maintainer-authored PR is protected from cleanup closure. Priority: P3 Review scores
Verification
How this fits togetherThe Control UI renders incoming chat Markdown into sanitized HTML, including partially streamed replies. These tests protect rendering behavior and run through the UI test suite and repository lint checks. flowchart LR
A[Chat Markdown] --> B[Static or streaming renderer]
B --> C[Sanitized HTML]
C --> D[Chat display]
E[Markdown test suites] --> B
E --> F[UI test runner]
E --> G[File length lint check]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +9. Total +9 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Retain the existing rendering regressions in cohesive test files that remain below the unchanged lint limit. Do we have a high-confidence way to reproduce the issue? Yes: the affected file and its 1,000-line lint rule provide a precise reproduction target, and the PR reports the original diagnostic. This review verified source structure without rerunning lint. Is this the best way to solve the issue? Yes: moving complete suites preserves coverage and fixes file size without relaxing lint rules or changing production code. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c47fa27ac39c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
ui/src/components/markdown.test.ts sits one line under the 700-line max-lines cap after #141466, #141485 and #141497 each moved a slice out. Move the toSanitizedMarkdownHtml code-block rendering cases into the existing markdown-code-blocks.test.ts, share htmlFragment and withControlUiBasePath from markdown.test-support.ts, and drop the copy of htmlFragment that markdown-streaming.test.ts carried. No assertion changes; the case count across ui/src/components/markdown*.test.ts is unchanged (232).
#141494) * test(ui): move code-block rendering tests beside their clipboard suite ui/src/components/markdown.test.ts sits one line under the 700-line max-lines cap after #141466, #141485 and #141497 each moved a slice out. Move the toSanitizedMarkdownHtml code-block rendering cases into the existing markdown-code-blocks.test.ts, share htmlFragment and withControlUiBasePath from markdown.test-support.ts, and drop the copy of htmlFragment that markdown-streaming.test.ts carried. No assertion changes; the case count across ui/src/components/markdown*.test.ts is unchanged (232). * test(ui): keep the html fence in the relocated escaping test The identifier rename that avoids shadowing lit's html import also rewrote the fence language inside one fixture string, changing what highlightCodeHtml exercised. Restore the fixture; the moved block is now identical to its origin apart from the local variable name.
* test(ui): remove the duplicate streaming markdown suite #141466 moved the toStreamingMarkdownParts and indented-source suites into markdown-streaming.test.ts; #141485 then landed the same 16 cases again as markdown-streaming-parts.test.ts during the concurrent max-lines split. The two files differ only in whether htmlFragment is imported or inlined. Keep the copy that shares the test-support helper and drop the other. * test(ui): wait for the lazy native menu before asserting its trigger showMenu appends the native link menu in the continuation after its awaited dynamic import, and that microtask can run after vi.dynamicImportSettled() resolves. The assertion read the element synchronously and failed about one run in five on the UI shard. Wait for the element; every assertion is unchanged.
…nclaw#141485) markdown.test.ts exceeded the max-lines lint limit after openclaw#141369 and openclaw#141431, turning the core lint lane red for every PR rebased onto main. Move the toStreamingMarkdownParts and indented-source blocks verbatim into markdown-streaming-parts.test.ts and drop the imports the remaining file no longer uses.
openclaw#141494) * test(ui): move code-block rendering tests beside their clipboard suite ui/src/components/markdown.test.ts sits one line under the 700-line max-lines cap after openclaw#141466, openclaw#141485 and openclaw#141497 each moved a slice out. Move the toSanitizedMarkdownHtml code-block rendering cases into the existing markdown-code-blocks.test.ts, share htmlFragment and withControlUiBasePath from markdown.test-support.ts, and drop the copy of htmlFragment that markdown-streaming.test.ts carried. No assertion changes; the case count across ui/src/components/markdown*.test.ts is unchanged (232). * test(ui): keep the html fence in the relocated escaping test The identifier rename that avoids shadowing lit's html import also rewrote the fence language inside one fixture string, changing what highlightCodeHtml exercised. Restore the fixture; the moved block is now identical to its origin apart from the local variable name.
) * test(ui): remove the duplicate streaming markdown suite openclaw#141466 moved the toStreamingMarkdownParts and indented-source suites into markdown-streaming.test.ts; openclaw#141485 then landed the same 16 cases again as markdown-streaming-parts.test.ts during the concurrent max-lines split. The two files differ only in whether htmlFragment is imported or inlined. Keep the copy that shares the test-support helper and drop the other. * test(ui): wait for the lazy native menu before asserting its trigger showMenu appends the native link menu in the continuation after its awaited dynamic import, and that microtask can run after vi.dynamicImportSettled() resolves. The assertion read the element synchronously and failed about one run in five on the UI shard. Wait for the element; every assertion is unchanged.
What Problem This Solves
Resolves a problem where every pull request rebased onto current
mainfails thecheck-lint-core-2lane:ui/src/components/markdown.test.tsgrew past themax-lineslimit (1011 counted lines against a maximum of 1000) after #141369 and #141431 landed. No source behavior is involved; the lane is red for unrelated work.Why This Change Was Made
Move the
toStreamingMarkdownPartsandindented Markdown sourcedescribe blocks, which both exercise the streaming split, into a newmarkdown-streaming-parts.test.tsbeside the existing streaming highlight tests. The remaining file drops to 902 lines and its now-unused imports are removed. Tests are moved verbatim; the new file carries only the imports and the smallhtmlFragmenthelper it needs.User Impact
None for users. Contributors get a green core lint lane back on
main.Evidence
pnpm exec oxlintonmarkdown.test.tsreproducedeslint(max-lines): File has too many lines (1011)on currentmain; both files lint clean after the split.node scripts/run-vitest.mjsonmarkdown.test.tsandmarkdown-streaming-parts.test.ts: all tests pass, same count as before the split.1b7c4429ef6, which does not touchmarkdown.test.ts.