Skip to content

test(ui): move code-block rendering tests beside their clipboard suite - #141494

Merged
steipete merged 2 commits into
mainfrom
steipete/upg-ui-split
Sep 7, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/upg-ui-split

Conversation

@steipete

@steipete steipete commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

ui/src/components/markdown.test.ts failed the repo's 700-line max-lines cap after #141369 and #141431 grew it, taking check-lint-core-2 red on every open PR. Three concurrent splits (#141466, #141485, #141497) have since brought it to 699 non-blank lines — one line from red again. This gives it real headroom by moving the code-block rendering cases into the sibling suite that already owns code blocks.

Why This Change Was Made

Split at the existing describe seam and reuse the file that owns the subject instead of minting a near-duplicate:

  • the toSanitizedMarkdownHtml code blocks rendering cases (276 lines, 16 cases, regenerated from current main so the three cache cases test(ui): split markdown render-cache tests out of markdown.test.ts #141497 relocated are not duplicated) move into the existing markdown-code-blocks.test.ts as a top-level suite (458 non-blank lines after, under the cap);
  • htmlFragment and withControlUiBasePath become one markdown.test-support.ts export set;
  • markdown-streaming.test.ts drops its private copy of htmlFragment;
  • markdown.test.ts ends at 445 non-blank lines and sheds the imports only the moved cases used.

The moved block's local html variables are renamed rendered because the target file imports lit's html (eslint no-shadow). No assertion, test name, or fixture changed.

Follow-up, deliberately not in this PR (to avoid colliding with the racing splits): main now carries the streaming suite twice — markdown-streaming.test.ts (#141466) and markdown-streaming-parts.test.ts (#141485), 16 identical cases each. Delete the second.

User Impact

None. Test-only; production LOC delta 0.

Evidence

  • Case count across ui/src/components/markdown*.test.ts: 232 before, 232 after (it(/test(); the moved block carries 16 cases.
  • node scripts/run-vitest.mjs on the four markdown suites: 4 files, 125 passed (125); markdown.test.ts alone: 52 passed.
  • node_modules/.bin/oxlint -c .oxlintrc.json on the four touched files: clean (the run-oxlint.mjs wrapper cannot run from a nested checkout; CI runs the wrapper). oxfmt --check: clean.
  • Exact-head CI: see checks on the final head.

Related: #141369 #141431 #141466 #141485 #141497

@steipete
steipete marked this pull request as ready for review September 7, 2026 19:30
@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: XL maintainer Maintainer-authored PR labels Sep 7, 2026
@steipete
steipete force-pushed the steipete/upg-ui-split branch from 182047d to a7bdd01 Compare September 7, 2026 19:35
@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
@steipete steipete changed the title test(ui): split markdown tests under the line cap test(ui): move code-block rendering tests beside their clipboard suite Sep 7, 2026
@steipete
steipete force-pushed the steipete/upg-ui-split branch from a7bdd01 to e01bfa5 Compare September 7, 2026 19:42
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
steipete force-pushed the steipete/upg-ui-split branch from e01bfa5 to eef42ed Compare September 7, 2026 19:49
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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, 4:12 PM ET / 20:12 UTC.

ClawSweeper review

What this changes

Moves Markdown code-block rendering tests beside the clipboard tests and shares DOM-fragment and base-path test helpers.

Merge readiness

✅ Ready for maintainer review

The previous HTML-fence finding is resolved, and no remaining actionable defect was found. This remains useful test organization beyond the already-merged splits and is protected maintainer-authored work.

Priority: P3
Reviewed head: d859371c01caa9f462674936c1bf2ef6a9d62b1c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test reorganization with the previous defect corrected and no remaining blocking finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR changes tests and test support only; production rendering and clipboard behavior are unchanged, so contributor runtime proof is not required.
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 PR changes tests and test support only; production rendering and clipboard behavior are unchanged, so contributor runtime proof is not required.
Evidence reviewed 6 items Previous finding resolved: The current escaping test uses an html fence and retains its script-element, literal-text, and escaped-markup assertions, satisfying the concrete prior review request.
Introduced scope and cleanup: Inspected all four changed files and the available pinned-base diff. Rendering assertions and helper behavior are retained; the destination restores timers, globals, and document contents. The Python fixture's indentation changes slightly, but it still tests exact source preservation. No production, dependency, workflow, or permission changes are introduced.
Current main still has the rendering group: Fetched main retains the code-block group in markdown.test.ts. The supplied merged PRs #141466, #141485, and #141497 moved streaming or cache coverage; they do not replace this rendering-suite move.
Findings None None.
Security None None.

How this fits together

The Control UI converts message Markdown into sanitized HTML and supplies code-block copy, expand, and wrap controls. These tests protect that rendering and interaction behavior without changing production code.

flowchart LR
  A[Markdown fixtures] --> B[Markdown renderer]
  B --> C[Sanitized HTML]
  C --> D[Rendering assertions]
  C --> E[Code-block controls]
  E --> F[Clipboard and interaction assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -8. Total -8 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 299 307 -8
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 299 307 -8

Review metrics

None.

Technical review

Best possible solution:

Keep rendering and clipboard coverage together with shared test helpers, preserving the existing assertions and production behavior.

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

Not applicable to this test reorganization; current source confirms the previous fixture defect is corrected, without executing tests.

Is this the best way to solve the issue?

Yes. Reusing the existing code-block suite and extracting unchanged test helpers is a focused way to improve organization without creating competing coverage.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • 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 PR changes tests and test support only; production rendering and clipboard behavior are unchanged, so contributor runtime proof is not required.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is bounded test organization 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: This maintainer-authored PR changes tests and test support only; production rendering and clipboard behavior are unchanged, so contributor runtime proof is not required.

Evidence

What I checked:

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-07T19:57:36.440Z sha eef42ed :: needs changes before merge. :: [P2] Restore the HTML language tag 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.
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 7, 2026
@steipete
steipete merged commit 8e3c321 into main Sep 7, 2026
130 checks passed
@steipete
steipete deleted the steipete/upg-ui-split branch September 7, 2026 20:17
@steipete

steipete commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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: 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