[Chore] Capture typed host messages in Story Gallery - #1446
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review. 📜 Recent review details🧰 Additional context used📓 Path-based instructions (7)Enforce repository policy: routine PRs must not add changesets or edit changelogs except during release preparation. Verify documentation describes real behavior and contracts, and deprioritize prose-only nits that do not affect correctness...⚙️ CodeRabbit configuration file Files:
Require regression coverage at the lowest valid harness with behavior-focused assertions, including relevant negative, error, false/unset, and boundary cases. Check cleanup and deterministic async behavior and prefer shared typed test helpe...⚙️ CodeRabbit configuration file Files:
Check strict typing and exhaustive behavior across normal, boundary, error, cancellation, retry, and compatibility paths. Verify promises and errors are handled, existing helpers are reused, and new code introduces no `any`, unjustified dou...⚙️ CodeRabbit configuration file Files:
Check React state and effect dependencies, cleanup, accessibility, i18n, and light/dark theme behavior. New markup should use Tailwind; add VS Code CSS variables to `src/index.css` before Tailwind use. Use Vitest for behavior and Playwright...⚙️ CodeRabbit configuration file Files:
Act as an adversarial second-opinion reviewer. Verify PR claims against implementation, contracts, and tests. Trace changed inputs through normal, boundary, error, cancellation, retry, and default paths and their consumers. Seek plausible c...⚙️ CodeRabbit configuration file Files:
Fix lint violations in new TypeScript code instead of suppressing them.📄 CodeRabbit inference engine (AGENTS.md) Files:
Use `playwright/vscode-messages.ts` to inspect outbound `vscode.postMessage` payloads.📄 CodeRabbit inference engine (webview-ui/AGENTS.md) Files:
🧠 Learnings (1)📓 Common learnings🪛 LanguageToolwebview-ui/AGENTS.md[grammar] ~69-~69: Ensure spelling is correct (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) 🔇 Additional comments (5)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe Playwright gallery now captures typed outbound VS Code messages through a shared helper. It persists mocked webview state, clears captured messages during unmount, and updates the announcement visual test to validate message payloads without parsing browser console output. ChangesVS Code message capture
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change improves Story Gallery test message capture without altering production runtime behavior or user-facing functionality. No actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 6 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (6 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. (2 skipped: 2 unsupported.) Full details: Regression EvidenceExplanation The changed message-capture behavior has focused Playwright coverage. Full details: Trust And Persistence InvariantsExplanation No explicit trust or persistence failure is introduced. The changed gallery shim only appends outbound messages to an in-memory
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
webview-ui/playwright/gallery/main.tsxESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. webview-ui/playwright/vscode-messages.tsESLint skipped: the matched ESLint configuration already failed (missing-dependency). webview-ui/src/components/chat/__tests__/Announcement.links.visual.tsxESLint skipped: the matched ESLint configuration already failed (missing-dependency). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…markdown Per webview-ui/AGENTS.md, this PR changes user-visible markdown rendering, spacing, and overflow styling, so it needs a pixel receipt: - Add a task-header-markdown story to the shared gallery harness (Zoo-Code-Org#1446): an expanded TaskHeader with representative user-authored markdown (heading, bold, inline code, bullets, external link, soft breaks, and path/@problems/@Terminal mentions) plus enough content to overflow the max-h-80 prompt box. - Add TaskHeader.visual.tsx: asserts the deterministic expanded state (heading, list items, mention spans, br soft breaks, actual overflow) and snapshots all four VS Code themes. - Baselines generated in the pinned Docker Playwright container (task-header-markdown-{dark,light,high-contrast,high-contrast-light}.png). Existing Vitest coverage (semantic behavior) is unchanged.
Related GitHub Issue
Closes: #517
Description
Adds a gallery-local VS Code API shim that captures outbound
WebviewMessagevalues before application modules load. A shared typed Playwright helper exposes those messages to visual tests, and the gallery resets the buffer between story mounts to prevent test leakage.Migrates the Announcement link visual test away from console parsing and verifies that remounting clears previously captured messages.
Test Procedure
pnpm --filter @roo-code/vscode-webview check-types.pnpm test.Pre-Submission Checklist
Visual Snapshots
No user-visible UI changed. Browser proof is not applicable; the affected Announcement Story Gallery test continues to validate its committed visual baseline.
Videos (interaction / animation only)
Not applicable.
Documentation Updates
Additional Notes
The captured message list uses the repository's shared
WebviewMessagetype rather than parsing console output. The shim remains isolated to the Story Gallery document and does not affect extension runtime behavior.Get in Touch
Mention
@roomoteon this PR or follow up through the linked task.