Skip to content

test(ui): split streaming markdown tests to restore the core lint lane - #141485

Merged
steipete merged 1 commit into
mainfrom
fix/markdown-test-streaming-split
Sep 7, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/markdown-test-streaming-split

Conversation

@steipete

@steipete steipete commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a problem where every pull request rebased onto current main fails the check-lint-core-2 lane: ui/src/components/markdown.test.ts grew past the max-lines limit (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 toStreamingMarkdownParts and indented Markdown source describe blocks, which both exercise the streaming split, into a new markdown-streaming-parts.test.ts beside 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 small htmlFragment helper it needs.

User Impact

None for users. Contributors get a green core lint lane back on main.

Evidence

  • pnpm exec oxlint on markdown.test.ts reproduced eslint(max-lines): File has too many lines (1011) on current main; both files lint clean after the split.
  • node scripts/run-vitest.mjs on markdown.test.ts and markdown-streaming-parts.test.ts: all tests pass, same count as before the split.
  • Observed on fix(ui): show backtick-quoted GitHub links as chips with hover cards #141446 at head 1b7c4429ef6, which does not touch markdown.test.ts.

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.
@clawsweeper

clawsweeper Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Sep 7, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 3:30 PM ET / 19:30 UTC.

ClawSweeper review

What this changes

Move 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
Reviewed head: f072a6cc62f04381f4d0777cf04192bf93ea14d2

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving test split with verified assertion preservation and no actionable defects.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied MEMBER association exempts this maintainer-authored test-only PR from contributor runtime proof; the moved tests exercise unchanged Markdown rendering, and reported lint/test results are supplemental validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied MEMBER association exempts this maintainer-authored test-only PR from contributor runtime proof; the moved tests exercise unchanged Markdown rendering, and reported lint/test results are supplemental validation.
Evidence reviewed 6 items Introduced change and preservation: The pinned delta touches only the two test files. A read-only comparison confirmed that both moved describe blocks are byte-identical to the original suffix; imports and the small DOM helper make the new file self-contained. git diff --check passed.
Lint boundary: The UI test override permits 1,000 counted lines, excluding blank lines and comments. The resulting files have only 900 and 284 raw lines, respectively, so both are below the limit without weakening lint policy.
Test discovery and setup: The unit project discovers src/**/*.test.ts in jsdom and uses its existing per-file cleanup runner. Neither moved suite depends on enclosing setup from the original file; the locale test and scanner spy retain their cleanup.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +9. Total +9 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 285 276 +9
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 285 276 +9

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is a low-risk test organization repair with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied MEMBER association exempts this maintainer-authored test-only PR from contributor runtime proof; the moved tests exercise unchanged Markdown rendering, and reported lint/test results are supplemental validation.

Label justifications:

  • P3: This is a low-risk test organization repair with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied MEMBER association exempts this maintainer-authored test-only PR from contributor runtime proof; the moved tests exercise unchanged Markdown rendering, and reported lint/test results are supplemental validation.

Evidence

What I checked:

  • Introduced change and preservation: The pinned delta touches only the two test files. A read-only comparison confirmed that both moved describe blocks are byte-identical to the original suffix; imports and the small DOM helper make the new file self-contained. git diff --check passed. (ui/src/components/markdown-streaming-parts.test.ts:13, f072a6cc62f0)
  • Lint boundary: The UI test override permits 1,000 counted lines, excluding blank lines and comments. The resulting files have only 900 and 284 raw lines, respectively, so both are below the limit without weakening lint policy. (.oxlintrc.json:382, f072a6cc62f0)
  • Test discovery and setup: The unit project discovers src/**/*.test.ts in jsdom and uses its existing per-file cleanup runner. Neither moved suite depends on enclosing setup from the original file; the locale test and scanner spy retain their cleanup. (ui/vitest.config.ts:234, f072a6cc62f0)
  • Still necessary on fetched main: Read-only blob comparison confirmed that markdown.test.ts on fetched main is identical to the pinned base's 1,175-line file. No supplied related PR implements this split. The release blob could not be inspected because a required object was unavailable and network resolution failed; no release inclusion is claimed. (ui/src/components/markdown.test.ts, c47fa27ac39c)
  • Prior area work: Current-main history lists several recent Markdown changes by Peter Steinberger. Supplied GitHub metadata connects steipete to the merged rendering work at fix(ui): preserve indented code in chat #141369 and feat(ui): link bare GitHub issue and PR references in chat #141431. These establish routing relevance, not causal attribution for the lint failure. (ui/src/components/markdown.test.ts, c47fa27ac39c)
  • Validation and discussion: The supplied complete PR body reports the original max-lines failure, successful lint after splitting, and unchanged passing test counts. It identifies fix(ui): show backtick-quoted GitHub links as chips with hover cards #141446 as another PR affected by the shared lint failure, not a replacement. This review did not execute tests or lint; live GitHub refresh failed to connect. (f072a6cc62f0)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 18eabd4 into main Sep 7, 2026
87 checks passed
@steipete
steipete deleted the fix/markdown-test-streaming-split branch September 7, 2026 19:37
@steipete

steipete commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 7, 2026
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).
steipete added a commit that referenced this pull request Sep 7, 2026
#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.
steipete added a commit that referenced this pull request Sep 7, 2026
* 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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 8, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 8, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 8, 2026
)

* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant