Render a markdown subset when displaying task bodies in the TUI#96
Merged
Conversation
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
force-pushed
the
render-markdown-body
branch
from
July 26, 2026 10:20
165d120 to
112c723
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.