3.0 KiB
3.0 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 02-log-failed-diagram-source | Log failed Mermaid diagram source | done | 2 |
|
plan.md | ../../specs/ui/requirements/mermaid-rendering.md |
Task 02: Log failed Mermaid diagram source
Acceptance
- Every rejected chat or task-plan Mermaid render emits one searchable
[mermaid]console.errorcontaining the parser error and complete original diagram source. - The same entry includes complete normalized source only when normalization changed the input, and it uses flat multiline text that can be copied directly from browser logs.
- Existing toast, inline-error, debounce, recovery, and stale-render behavior remains unchanged.
Verification
cd apps
pnpm install --frozen-lockfile
pnpm --filter @kandev/web test -- \
components/shared/mermaid-utils.test.ts \
components/shared/mermaid-block-streaming.test.tsx
pnpm --filter @kandev/web exec eslint \
components/shared/mermaid-utils.ts \
components/shared/mermaid-utils.test.ts \
components/shared/mermaid-block.tsx \
components/shared/mermaid-block-streaming.test.tsx \
components/editors/tiptap/tiptap-mermaid-extension.ts \
--max-warnings 0
Files likely touched
apps/web/components/shared/mermaid-utils.tsapps/web/components/shared/mermaid-utils.test.tsapps/web/components/shared/mermaid-block.tsxapps/web/components/shared/mermaid-block-streaming.test.tsxapps/web/components/editors/tiptap/tiptap-mermaid-extension.tsdocs/plans/mermaid-sequence-semicolon-rendering/plan.mddocs/plans/mermaid-sequence-semicolon-rendering/task-02-log-failed-diagram-source.md
Dependencies
Task 01. Build on the final shared normalizer signature and its normalized output.
Parallelism
Sequential. This task shares mermaid-utils.ts and its tests with Task 01, then wires both
renderer-specific rejection paths.
Inputs
docs/specs/ui/requirements/mermaid-rendering.mddocs/plans/mermaid-sequence-semicolon-rendering/plan.mdapps/web/AGENTS.md.agents/skills/tdd/SKILL.md.agents/skills/debug/references/instrumentation.md.agents/skills/mobile-parity/SKILL.md
Risks
- Full diagram source may contain sensitive text. Keep the requested diagnostic client-side and rely only on the existing user-initiated browser-log export path.
- Log flat text rather than a collapsed object so users can copy the complete source.
- Report only after a render promise rejects; do not log transient streaming prefixes that never reach Mermaid because debounce cancellation suppresses them.
Output contract
Report RED/GREEN evidence, files changed, exact verification results, blockers or residual risks,
and update this task plus plan.md to done.
Completion evidence
- RED: the chat rejection regression observed no
console.errorcall. - GREEN:
pnpm --filter @kandev/web test -- components/shared/mermaid-utils.test.ts components/shared/mermaid-block-streaming.test.tsx(32 tests). - GREEN: changed-file ESLint completed with
--max-warnings 0.