Skip to content

Render a markdown subset when displaying task bodies in the TUI#96

Merged
MJohnson459 merged 2 commits into
mainfrom
render-markdown-body
Jul 26, 2026
Merged

Render a markdown subset when displaying task bodies in the TUI#96
MJohnson459 merged 2 commits into
mainfrom
render-markdown-body

Conversation

@MJohnson459

Copy link
Copy Markdown
Contributor

Render a markdown subset in TUI task bodies.

Task bodies are markdown but the popup and cockpit detail pane rendered them as plain text. Added a hand-rolled renderer (crates/voro/src/markdown.rs, matching the editor.rs no-dependency precedent) exposing one pure fn body_lines(&str) -> Vec<Line<'static>>. Both render sites in ui.rs (popup ~L219 and draw_detail ~L714) now call it in place of the previous lines().map(...).

Supported subset: bold, inline code (cyan fg), fenced code blocks (dimmed, markdown inert inside), #-### headings (bold, hashes stripped), and -/* bullets (• glyph). Anything unrecognised — unclosed fence, unmatched ** or backtick, 4+ hashes — degrades to literal text; content is never dropped or mangled.

Presentation only: no voro-core, schema, or storage changes. draw_detail scroll measurement (Paragraph::line_count) still works on the styled lines. CLI 'voro show' and the question field stay plain, unchanged.

Verified: cargo test --workspace (211 pass, incl. 12 new unit tests covering each construct, mixed bold+code, unclosed fence, unmatched **, plain passthrough, blank-line preservation) and cargo clippy --all-targets -D warnings clean. Eyeballed both surfaces via the verify skill against a scratch DB; ANSI capture confirms real bold/cyan/dim/bullet styling in both popup and detail pane.

Branch render-markdown-body.

MJohnson459 and others added 2 commits July 26, 2026 11:12
main does not compile its test targets. #95 removed DispatchCtx's
session_task_id field; #93 was branched before that landed and added two
test-only DispatchCtx literals that still assign it. Each PR was green on
its own base, and because both sites are inside #[cfg(test)] modules
`cargo build --workspace` still passes — only `cargo test` and
`cargo clippy --all-targets` fail, so the breakage reached main unnoticed.

Delete the two assignments, matching the neighbouring literal in the same
test module that already omits the field. No behaviour change.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_0146m6RCmCo8i64XpfXSqEJ4
Task bodies are written in markdown but the popup and detail pane rendered
them as plain text. Add a hand-rolled renderer (matching the editor.rs
no-dependency precedent) that styles a small subset: **bold**, `inline
code`, fenced code blocks, #-### headings, and -/* bullets.

The logic lives in one pure function, markdown::body_lines, isolated behind
a module boundary so a real parser could be swapped in later. Both render
sites in ui.rs call it in place of the previous lines().map(...). Anything
the renderer does not understand — including malformed markup like an
unclosed fence or an unmatched ** — degrades to literal text so content is
never dropped or mangled.

Presentation only: no voro-core, schema, or storage changes. Scroll
measurement in draw_detail keeps working since it operates on the styled
lines. Verified with cargo test/clippy and by eyeballing both surfaces
against a scratch DB (ANSI capture confirms bold/cyan/dim/bullet styling).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_0146m6RCmCo8i64XpfXSqEJ4
@MJohnson459
MJohnson459 force-pushed the render-markdown-body branch from 165d120 to 112c723 Compare July 26, 2026 10:20
@MJohnson459
MJohnson459 merged commit fd29dc7 into main Jul 26, 2026
6 checks passed
@MJohnson459
MJohnson459 deleted the render-markdown-body branch July 26, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant