Skip to content

test(ui): split markdown render-cache tests out of markdown.test.ts - #141497

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

steipete merged 1 commit into
mainfrom
ui/markdown-test-split

Conversation

@steipete

@steipete steipete commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Related: #141431, #141369

What Problem This Solves

Resolves a problem where main's check-lint-core-2 job fails and blocks landings because markdown.test.ts exceeds the 1000-line lint limit. PRs #141431 and #141369 passed separately but combined to bring the file to 1011 counted lines.

Update: while this PR was in CI, #141466 separately extracted streaming tests and already relieved the main lint failure. This requested cache split adds further headroom and keeps cache-related coverage together.

Why This Change Was Made

Move the three render-cache separation tests and the related large-text handling group into markdown.cache.test.ts. This test-only split preserves every test name and assertion, duplicates only the tiny DOM-fragment and JSON-block helpers, and leaves production code, lint configuration, thresholds, and ignores unchanged.

User Impact

None. This restores CI headroom without changing product behavior or test coverage.

Evidence

  • Original failure reproduced locally: 1011 counted lines, limit 1000. Failing main job.
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json ui/src/components/markdown.test.ts ui/src/components/markdown.cache.test.ts: passed with no max-lines finding. The requested ui/tsconfig.json does not exist; the repository's core lint config includes UI files. Physical line counts after splitting: 1090 and 105.
  • node scripts/run-vitest.mjs ui/src/components/markdown.test.ts ui/src/components/markdown.cache.test.ts: 115 passed (108 + 7), matching the original file's 115 passed. All seven moved test bodies and the full test-name multiset are unchanged.
  • pnpm check:changed: passed. Independent review: clean at P2.

Main's check-lint-core-2 job fails because markdown.test.ts reached 1011 counted lines against the 1000-line max-lines limit. PRs #141431 and #141369 passed separately but combined to cross the limit when both landed. Move the cache-separation and large-text tests into a sibling file, preserving all 115 tests and their assertions without changing production code or lint rules.
@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.

@steipete
steipete marked this pull request as ready for review September 7, 2026 19:32
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S 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:39 PM ET / 19:39 UTC.

ClawSweeper review

What this changes

Moves seven Markdown cache and large-text tests into a dedicated file while preserving their assertions.

Merge readiness

✅ Ready for maintainer review

No actionable defects found. Current main already resolves the line-limit failure through a separate streaming-test split, so this PR now offers additional test organization rather than an urgent CI repair. Its maintainer protection rules out automated closure.

Priority: P3
Reviewed head: 5b29a8e37e260cff4a2f12eee2d285fbbd5f72f0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, assertion-preserving test split with reported passing validation and no concrete introduced defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored test-only change has no changed production behavior requiring live proof; the supplied focused-test and lint results support the relocation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored test-only change has no changed production behavior requiring live proof; the supplied focused-test and lint results support the relocation.
Evidence reviewed 6 items Introduced patch: The merge-base-to-head diff only relocates tests and adds their local helpers; production code, dependency declarations, and lint configuration are unchanged.
Test preservation: Read-only text comparison confirmed all seven moved test blocks occur verbatim in the baseline and the combined literal test-name multiset is preserved. The supplied PR body reports 115 passing tests before and after; tests were not executed during this review.
Discovery and production boundary: The UI unit project discovers src/**/*.test.ts using jsdom and its existing cleanup runner. The moved tests retain their own inputs and exercise the unchanged Markdown rendering entrypoint.
Findings None None.
Security None None.

How this fits together

The Control UI converts chat Markdown into sanitized HTML, caching eligible results by rendering options. These tests protect cache separation and readable fallback rendering for large messages.

flowchart LR
  A[Chat Markdown and options] --> B{Eligible for cache?}
  B -->|Yes| C[Render cache]
  B -->|No| D[Markdown or plain-text rendering]
  C -->|Miss| D
  D --> E[Sanitized HTML]
  C -->|Hit| E
  F[Cache and large-text tests] --> B
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +20. Total +20 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 105 85 +20
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 105 85 +20

Review metrics

Metric Value Why it matters
Coverage preservation 7 test bodies moved verbatim Static comparison confirms the relocation preserves the existing assertions and combined test-name multiset.

Technical review

Best possible solution:

Keep cohesive Markdown test groups below the existing lint limit while retaining every behavioral assertion.

Do we have a high-confidence way to reproduce the issue?

Not applicable to a product defect: this is a test-file split, and current main's 900-line file no longer exceeds the stated 1000-line limit.

Is this the best way to solve the issue?

Yes, the relocation is a small, maintainable organization change that preserves coverage, although the separate split on main has already removed its original urgency.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 18eabd4cded9.

Labels

Label changes:

  • add P3: This is test organization with no runtime change, and current main already falls below the relevant line limit.
  • 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: This maintainer-authored test-only change has no changed production behavior requiring live proof; the supplied focused-test and lint results support the relocation.

Label justifications:

  • P3: This is test organization with no runtime change, and current main already falls below the relevant line limit.
  • 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: This maintainer-authored test-only change has no changed production behavior requiring live proof; the supplied focused-test and lint results support the relocation.

Evidence

What I checked:

  • Introduced patch: The merge-base-to-head diff only relocates tests and adds their local helpers; production code, dependency declarations, and lint configuration are unchanged. (ui/src/components/markdown.cache.test.ts:1, 5b29a8e37e26)
  • Test preservation: Read-only text comparison confirmed all seven moved test blocks occur verbatim in the baseline and the combined literal test-name multiset is preserved. The supplied PR body reports 115 passing tests before and after; tests were not executed during this review. (ui/src/components/markdown.cache.test.ts:20, 5b29a8e37e26)
  • Discovery and production boundary: The UI unit project discovers src/**/*.test.ts using jsdom and its existing cleanup runner. The moved tests retain their own inputs and exercise the unchanged Markdown rendering entrypoint. (ui/vitest.config.ts:263, 5b29a8e37e26)
  • Current-main overlap: Current main's markdown.test.ts has 900 physical lines, already below the 1000 counted-line limit. Commit 7a1f677 separately extracted streaming coverage; the cache tests remain in markdown.test.ts. This establishes overlapping relief, not a verified fixing-PR closure relationship. (ui/src/components/markdown.test.ts, 18eabd4cded9)
  • Merged area history: Main history identifies Peter Steinberger's recent Markdown work, including the supplied merged related PRs fix(ui): preserve indented code in chat #141369 and feat(ui): link bare GitHub issue and PR references in chat #141431. They provide area-routing context, not replacements for this test relocation. (ui/src/components/markdown.test.ts, c193ac82fced)
  • Review scope and limitations: Root AGENTS.md and ui/AGENTS.md were read fully; no deeper applicable policy or maintainer-notes directory was present. Local patch and main inspection succeeded. Network resolution prevented live GitHub refresh and retrieval of missing release/test-merge blobs; no release inclusion or independently inspected merge-result claim is made. The supplied verified introduction evidence remains the ownership anchor. (AGENTS.md:1, 5b29a8e37e26)

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 13bfce0 into main Sep 7, 2026
139 checks passed
@steipete
steipete deleted the ui/markdown-test-split branch September 7, 2026 19:45
@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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 8, 2026
…penclaw#141497)

Main's check-lint-core-2 job fails because markdown.test.ts reached 1011 counted lines against the 1000-line max-lines limit. PRs openclaw#141431 and openclaw#141369 passed separately but combined to cross the limit when both landed. Move the cache-separation and large-text tests into a sibling file, preserving all 115 tests and their assertions without changing production code or lint rules.
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.
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: S 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