3.6 KiB
3.6 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 02-inline-diff-markdown-preview | Render changed Markdown inside Review | done | 2 |
|
plan.md | ../../specs/ui/review-markdown-preview.md |
Task 02: Render changed Markdown inside Review
Acceptance
- Desktop, tablet, and mobile keep the Review dialog open while toggling a
.mdor.mdxrow between its textual diff and a rendered changed-content preview; no file tab or Files viewer opens. - Complete added/untracked diffs render as one document, while modified hunks remain separate and partial/truncated content is visibly labelled.
- Files without renderable new-side Markdown do not expose the action, and the existing sanitized renderer, review state, comments, filtering, and file ordering remain intact.
Verification
cd apps && pnpm install --frozen-lockfile
pnpm --filter @kandev/web test -- --run \
components/review/review-markdown-diff-preview.test.ts \
components/review/review-diff-toolbar.test.tsx \
components/review/review-diff-list-grouping.test.tsx
pnpm --dir web e2e:run tests/review/review-markdown-preview.spec.ts
pnpm --dir web e2e:run -- --project=mobile-chrome tests/review/mobile-review-markdown-preview.spec.ts
cd ..
make fmt
make typecheck test lint
Completed 2026-07-29:
- RED: parser test initially failed because
review-markdown-diff-previewdid not exist; desktop and mobile E2E expectations also failed under the prior dialog-closing navigation behavior. - GREEN: focused Vitest (
18assertions across parser, toolbar, and row-state coverage), desktop Playwright, andmobile-chromePlaywright all passed. - Full verification passed:
make fmt, thenmake typecheck test lint.
Files likely touched
apps/web/components/review/review-markdown-diff-preview.tsxapps/web/components/review/review-markdown-diff-preview.test.tsapps/web/components/review/review-diff-toolbar.tsxapps/web/components/review/review-diff-toolbar.test.tsxapps/web/components/review/review-diff-header.tsxapps/web/components/review/review-diff-list.tsxapps/web/components/review/review-diff-list-grouping.test.tsxapps/web/components/review/review-dialog-surface.tsxapps/web/components/review/review-dialog.tsxapps/web/components/task/dockview-review-dialog.tsxapps/web/components/task/use-review-dialog.tsapps/web/components/task/mobile/session-mobile-review-dialog.tsxapps/web/components/task/mobile/session-tablet-layout.tsxapps/web/e2e/tests/review/review-markdown-preview.spec.tsapps/web/e2e/tests/review/mobile-review-markdown-preview.spec.ts
Dependencies
Task 01 is the shipped baseline whose external navigation behavior this task replaces. Reuse its toolbar entry points and the existing sanitized Markdown renderer.
Parallelism
Sequential. Parser output, toolbar eligibility, row state, responsive behavior, and E2E assertions share one component contract.
Inputs
docs/specs/ui/review-markdown-preview.mddocs/plans/review-markdown-preview/plan.mdapps/web/AGENTS.md.agents/skills/tdd/SKILL.md.agents/skills/e2e/SKILL.md.agents/skills/mobile-parity/SKILL.md
Risks
- Never concatenate separate modified hunks into a fake continuous document.
- Do not render deleted lines or unified-diff metadata as Markdown.
- Do not introduce a second scroll owner inside the mobile Review dialog.
- Keep raw HTML sanitization identical to the existing Markdown preview surface.
Output contract
Report files changed, RED/GREEN test evidence, exact verification results, blockers or residual
risks, and update this task plus plan.md to done.