Repository navigation
Future document diagnostics: broken links, HTML checks and live browser console #466
Description
Status
Deferred, no implementation during current release. Investigate current Markdown/HTML parser, source editor, and browser preview after Claude lands them; avoid duplicate validation or console infrastructure.
Goal
Add a low-noise, offline-first Problems surface while editing Markdown/HTML/CSS, and an optional browser console for runtime errors and resource failures in trusted previews. Go from an actionable warning to the exact source location without disrupting the document workspace.
Related
#460 hybrid editing, #461 source/render workspace, #462 Markdown/HTML features, #402 native editor. Leverage browser CDP Runtime, Log and Network selectively; don't recreate a giant devtools stack.
Scope
Static, local checks: missing local image/font/CSS paths, unresolved relative Markdown links or file fragments, duplicate heading IDs, malformed image/link references, basic HTML parse issues, common accessibility mistakes (e.g., img missing alt, explicit controls lacking labels where checkable), obvious invalid local CSS if a trustworthy parser is available. Do not flag every unconventional but valid construct as broken. Dynamic HTML/JS may not be statically provable.
Runtime browser console (opt-in when trusted preview/browser active): JavaScript exceptions, console warnings/errors, network/resource failures and source URLs/line/column when provided. Safe ordering, bounded log entries, search/filter by severity, clearing and copying reviewed diagnostics. Map to editable local source only when reliable; otherwise label external/generated scripts.
Editor UX: gutter indications, a collapsible Problems/Console view, click/keyboard jump to source, understandable explanation and optional reviewed fix. Errors should not interrupt typing; diagnostics are debounced and cancel stale versions on edit.
Safety
- Opening an untrusted local file for static checks must not run JavaScript or contact external URLs. For path checks, restrict target resolution and never read network endpoints, credentials, symlinks outside allowed root without documented permission.
- Browser console is not a code execution panel by default; keep arbitrary expression evaluation outside initial scope. Scrub/redact URLs, headers, query tokens, secrets and file paths as appropriate; do not implicitly persist all runtime messages in transcripts or share telemetry.
- Debounce/cap parsing and watcher work; no CPU saturation on long documents; no interpreter process when closed.
- Never bypass the fileEdit atomic/conflict pipeline for suggested fixes. Respect NO_COLOR, Safe Glyphs, keyboard/terminal ownership and accessible severity text.
Acceptance / tests
- Code/data model for diagnostic id, source span, severity, confidence, version, source type (static/runtime) and dismiss/recheck behaviour.
- Fixtures with missing local assets, duplicate slugs, broken anchors, valid odd syntax, mixed local/remote refs and hostile paths produce bounded truthful results.
- Refresh and unsaved-buffer diagnostics update without disk writes or stale locations; edits/undo/redo update exact source anchor.
- Trusted runtime JavaScript exception and 404 resource show in live console; JS-off untrusted preview doesn't execute or make network requests.
- Error navigation preserves editor focus; UI handles long/multiline diagnostics and 30/50/80/120 columns.
- Redaction, cleanup, restart, file watcher/child process count, and physical Ghostty/Zed QA tracked.
Non-goals
Full LSP server, automatic lint downloads, silently fixing files, full DevTools or making browser runtime mandatory for static checks.
Activity
raiseCatError commentedon Oct 21, 2026
Resumed for v0.24 (the earlier pause protected the v0.22/v0.23 schedule; the issue text predates v0.23, so scope is reconciled against the current code before implementation). Order and dependencies: docs/development/v024-ledger.md on branch feature/v024-draft-recovery (PR #489).
Merge pull request #499 from raiseCatError/feature/v024-diagnostics
Merge pull request #504 from raiseCatError/feature/v024-browser-console
raiseCatError commentedon Oct 22, 2026
Runtime Console merged into
dev(PR #504, merge be3f6ab). Automated checks are green on the exact head (64831e3, run 39767603153). Physical QA: NOT RUN.What changed:
Cin the Chromium preview of a Markdown or HTML document shows what the page reported for the loaded document:consoleerrors, warnings and messagesIt is read-only. It never turns scripts or the network on, evaluates nothing, and records nothing from
/browserpages or the Mermaid renderer. Entries are redacted before they are stored, and stay in memory with fixed limits.Keys: Tab filters by severity. Typing searches. Shift+↑↓ marks entries. Del clears. Ctrl+C shows the exact text before copying. Enter goes to the line only for an HTML document that hasn't changed since the page loaded; otherwise it says why.
To test (Ghostty and Zed): follow docs/testing/v024-editor-physical-qa.md → Browser Console (#466).
console.error/console.warn, a missing image and a remote<img>.Tto turn scripts on. After the reload, the exception appears, and Enter on it lands on the exact line.rto refresh.password=value.Automated:
browserConsole,browserConsoleViewandbrowserConsoleChrome(real Chromium), plus an independent security review whose confirmed findings were fixed with regression tests. Details are in docs/design/document-workspace.md → Console.Still open for #466: the Problems gutter marker, further languages, and physical QA.