docs(readme): add generated product showcase - #25
Conversation
📝 WalkthroughWalkthroughAdds a deterministic Playwright workflow that renders a README showcase with mocked application data, captures ChangesREADME showcase workflow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Playwright
participant ShowcasePage
participant TauriMock
participant DocsImages
Playwright->>ShowcasePage: Load mocked README showcase
ShowcasePage->>TauriMock: Request configuration and status data
TauriMock-->>ShowcasePage: Return deterministic responses
Playwright->>ShowcasePage: Validate iframes and toggle status
Playwright->>DocsImages: Save overview screenshot
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@e2e/readme-screenshots.screenshot.ts`:
- Around line 87-92: Replace the Date.now() value in the hook_runtime_status
mock with a fixed timestamp so screenshot fixtures remain deterministic; if the
settings UI computes relative time from lastEventAt, also freeze the page clock
in the screenshot setup.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1eede323-5737-4b73-9463-dcd4e358421f
⛔ Files ignored due to path filters (1)
docs/images/agent-cat-overview.pngis excluded by!**/*.png
📒 Files selected for processing (7)
README.mdREADME.zh-CN.mde2e/fixtures/readme-showcase/index.htmle2e/fixtures/readme-showcase/style.csse2e/readme-screenshots.screenshot.tspackage.jsonplaywright.config.ts
| case "hook_runtime_status": return { | ||
| receiverRunning: true, | ||
| socketPath: "agent-cat.sock", | ||
| lastEventAt: Date.now(), | ||
| lastEvent: "PermissionRequest", | ||
| lastEventIsTest: false, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Keep the screenshot mock clock deterministic.
Line [90] injects Date.now() into a workflow documented as deterministic. If the settings UI renders or evaluates lastEventAt, repeated screenshot runs can produce different output or status state. Use a fixed mock timestamp and freeze page time if relative-time logic is involved.
Proposed fix
- await page.addInitScript(({ mockConfig, mockEvents, version }) => {
+ await page.addInitScript(({ mockConfig, mockEvents, version, mockNow }) => {
...
- lastEventAt: Date.now(),
+ lastEventAt: mockNow,
...
- }, { mockConfig: config, mockEvents: statusEvents, version: packageVersion });
+ }, {
+ mockConfig: config,
+ mockEvents: statusEvents,
+ version: packageVersion,
+ mockNow: 1_750_000_000_000,
+ });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@e2e/readme-screenshots.screenshot.ts` around lines 87 - 92, Replace the
Date.now() value in the hook_runtime_status mock with a fixed timestamp so
screenshot fixtures remain deterministic; if the settings UI computes relative
time from lastEventAt, also freeze the page clock in the screenshot setup.
Summary
Verification
Summary by CodeRabbit
Documentation
New Features
Tests