Repository navigation
Render images and Mermaid diagrams in file previews - #145
Merged
Merged
Conversation
cursor
Bot
force-pushed
the
cursor/inline-graphics-rendering-57fa
branch
from
October 9, 2026 13:08
800837e to
b3875bf
Compare
Co-authored-by: Web Dev Cody <webdevcody@gmail.com>
Co-authored-by: Web Dev Cody <webdevcody@gmail.com>
Co-authored-by: Web Dev Cody <webdevcody@gmail.com>
cursor
Bot
force-pushed
the
cursor/inline-graphics-rendering-57fa
branch
from
October 9, 2026 18:10
b3875bf to
fdfab07
Compare
webdevcody
marked this pull request as ready for review
October 9, 2026 18:10
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.
This adds inline visual previews to
nebula open, file tabs, and the tree browser so agents can show local images, mockups,.mmdfiles, and Markdown Mermaid blocks without pasting file contents into chat.Contents
What users get
rsvg-convert/magickfallback render in file tabs and the tree browser..mmdfiles and ```mermaid fenced blocks render through localmmdcwhen it is on PATH, with a source-plus-hint fallback when it is not.nebula open <path>only after an explicit user ask.inline_graphicsacceptsauto, protocol names,halfblocks, oroff; enabled modes currently use the portable half-block renderer.Screenshot
How it works
Risk read
🟡 Medium overall: this adds local file decoding and an optional local Mermaid subprocess, but keeps network fetching out of scope.
mmdcon PATH and falls back cleanly when absent.nebula openIPC plumbing.Rollback: reverting this PR removes visual previews, the
inline_graphicssetting, the newimagedependency, screenshot scene, and the updated agent guidance.Technical overview
nebula-tui/src/graphics.rsowns image detection/decoding, Mermaid extraction/rendering, SVG local-tool fallback, content caching, and half-block painting.tree_browser::Previewnow carries optional visual/Mermaid state shared by the tree browser and file tabs.markdown.rscan receive pre-rendered Mermaid diagrams and inject them where fenced blocks used to draw as code.ipc.rsand CLI/help docs now accept text, images and Mermaid diagrams while refusing unrelated binary files.scripts/shot/scenes/graphics-preview.*captures a deterministic tree-browser PNG preview scene.Dependency and size impact
image =0.25.6, default features off, with onlypng,jpeg,gif, andwebpenabled.cargo build --release --locked:origin/main: 16,608,536 bytesVerification
cargo +stable check -p nebula-tui✅cargo +stable test -p nebula-tui✅RUSTUP_TOOLCHAIN=stable cargo fmt --all -- --check✅RUSTUP_TOOLCHAIN=stable cargo check --workspace --all-targets --locked✅RUSTUP_TOOLCHAIN=stable cargo clippy --workspace --all-targets✅ (completed with existing non-fatal warnings)RUSTUP_TOOLCHAIN=stable cargo test --workspace -- --skip tui_drag_past_the_pane_top_autoscrolls_and_copies_the_run✅RUSTUP_TOOLCHAIN=stable make shot SCENE=graphics-preview✅ for.ansi/.txt; PNG rendered manually with the harness renderer and Linux DejaVu Sans Mono after installingpython3.12-venvbecause the default font is macOS Menlo.Note: an unskipped
RUSTUP_TOOLCHAIN=stable cargo test --workspacepassed through all daemon andnebula opene2e coverage, then hung locally on the unrelatedtui_drag_past_the_pane_top_autoscrolls_and_copies_the_rune2e test; the skipped rerun completed green.Follow-ups
rsvg-convertormagick) to avoid bundling a browser/vector stack.