Add interactive website#6
Merged
Merged
Conversation
Launches a FastAPI server that renders the directory tree as a zoomable, navigable D3.js treemap in the browser. Key features: - Collapsible settings sidebar: depth, log-scale (slider 1-10), font size, colormap, canvas size, exclude/include/highlight patterns - Van Wijk cushion shading matching the PNG/SVG renderers - Dark/light mode toggle (dark default) - Multi-selection via shift-click with batch delete and copy-paths - Drag-resizable sidebar with movable divider - Context menu: file/folder info, delete, move, multi-select actions - Live file-system updates via WebSocket + watchdog debounce - Write operations guarded by read-only source detection - Default excludes: .git, .venv, node_modules, .yarn, .pnpm-store, __pycache__, *.pyc, .mypy_cache - Depth slider max set dynamically from actual tree depth - Log scale and default settings applied on initial page load Install extras: pip install 'dirplot[serve]'
- node_to_dict: resolve actual dir name when node.name is empty (e.g. root '.') - zoomInto: build full ancestor chain via pathChain() so breadcrumb shows the complete path, not just the clicked node
- Three tabs replace the flat settings list: Settings (existing), Metrics, Preview - Metrics: GET /api/metrics endpoint runs tree_metrics_dict and renders files/dirs/size/depth/extensions/largest files+dirs - Preview: GET /api/file endpoint serves text (with extension hint for highlight.js) or base64-encoded images; auto-switches to Preview tab on file click - Syntax highlighting via highlight.js@11 CDN; theme follows dark/light mode toggle - Metrics cache invalidated on Apply / Reset so re-opening the tab re-fetches after config changes
- api_file: resolve relative paths against root_path instead of CWD, so preview works regardless of which directory the server was started from - api_file: clearer error message when root_path is None (remote sources) - previewFile: auto-expand sidebar when collapsed so preview is visible
- Promote serve deps to core (fastapi, uvicorn, jinja2, python-multipart) - /api/file reads embedded metadata for .png/.svg/.mp4/.mov and returns it - New /api/file-stream endpoint streams video files for <video> playback - .mp4/.mov/.webm files now render as <video controls> in the preview panel - Metadata table shown below image/video when dirplot metadata is present
… for remote sources
- Add remote file preview via GitHubSource.read_file(); other remote sources return a 403 gracefully - Add PNG/SVG export from toolbar with embedded JetBrains Mono font; export CSS resolves --dir-border at export time so borders appear - Fix export dropdown not collapsing (missing #export-menu.hidden rule) - Add HEIC/HEIF preview via pillow-heif or macOS sips fallback - Add audio file preview (mp3/wav/ogg/flac/aac/m4a/opus/weba) - Fix .mov preview: remap MIME to video/mp4 for Chrome/Firefox compat - Fix binary file hex dump: use errors="strict" so non-UTF-8 files actually reach the 1000-byte hex dump path - Fix absolute local paths in source field not loading - Fix metadata read crash when ffprobe returns invalid JSON - Improve Python rounding in render_png/svg_render (defer to draw time) - Add source history dropdown: localStorage-backed, max 20 entries, per-item delete, closes on outside click via capture-phase listener - Add folder/file border colours as solid #fff/#000 following dark/light - Add pillow_heif to mypy ignore_missing_imports overrides
deeplook
added a commit
that referenced
this pull request
Jun 19, 2026
* feat: add interactive web treemap via `dirplot serve` Launches a FastAPI server that renders the directory tree as a zoomable, navigable D3.js treemap in the browser. Key features: - Collapsible settings sidebar: depth, log-scale (slider 1-10), font size, colormap, canvas size, exclude/include/highlight patterns - Van Wijk cushion shading matching the PNG/SVG renderers - Dark/light mode toggle (dark default) - Multi-selection via shift-click with batch delete and copy-paths - Drag-resizable sidebar with movable divider - Context menu: file/folder info, delete, move, multi-select actions - Live file-system updates via WebSocket + watchdog debounce - Write operations guarded by read-only source detection - Default excludes: .git, .venv, node_modules, .yarn, .pnpm-store, __pycache__, *.pyc, .mypy_cache - Depth slider max set dynamically from actual tree depth - Log scale and default settings applied on initial page load Install extras: pip install 'dirplot[serve]' * fix: correct breadcrumb trail when zooming into deeply nested dirs - node_to_dict: resolve actual dir name when node.name is empty (e.g. root '.') - zoomInto: build full ancestor chain via pathChain() so breadcrumb shows the complete path, not just the clicked node * feat(serve): add Settings/Metrics/Preview tab panel to sidebar - Three tabs replace the flat settings list: Settings (existing), Metrics, Preview - Metrics: GET /api/metrics endpoint runs tree_metrics_dict and renders files/dirs/size/depth/extensions/largest files+dirs - Preview: GET /api/file endpoint serves text (with extension hint for highlight.js) or base64-encoded images; auto-switches to Preview tab on file click - Syntax highlighting via highlight.js@11 CDN; theme follows dark/light mode toggle - Metrics cache invalidated on Apply / Reset so re-opening the tab re-fetches after config changes * fix(serve): fix file preview path resolution and auto-expand sidebar - api_file: resolve relative paths against root_path instead of CWD, so preview works regardless of which directory the server was started from - api_file: clearer error message when root_path is None (remote sources) - previewFile: auto-expand sidebar when collapsed so preview is visible * fix: use browser-ready @highlightjs/cdn-assets for syntax highlighting in preview * feat(serve): show dirplot metadata in image/video previews - Promote serve deps to core (fastapi, uvicorn, jinja2, python-multipart) - /api/file reads embedded metadata for .png/.svg/.mp4/.mov and returns it - New /api/file-stream endpoint streams video files for <video> playback - .mp4/.mov/.webm files now render as <video controls> in the preview panel - Metadata table shown below image/video when dirplot metadata is present * feat(serve): show hex dump of first 1000 bytes for binary file previews * feat(serve): add PDF preview via iframe * chore: add TODO for PDF metadata embedding via pypdf * feat(serve): add search icon; preview tab no longer auto-activated on tile click * feat(serve): remove Apply button; all settings changes apply instantly * feat(serve): add regex toggle to search; highlights invalid patterns * feat(serve): add paired dark/light code theme selector to settings * feat(serve): expand code theme selector to 10 paired dark/light themes * feat(serve): add source input field to toolbar; breadcrumbs move right of it * feat(sources): register Docker, K8s, and S3 as first-class tree sources * feat(sources): support HTTP(S) URLs as archive sources; download to temp file * feat(sources): guard URL archive downloads with 100 MB size limit * feat(serve): add keyboard navigation (j/k, Enter, Esc, /, Backspace) * docs: add web interface (dirplot serve) documentation page * fix(serve): refresh metrics tab content automatically on rescan * fix(serve): metrics endpoint respects current root, depth, and exclude settings * fix(serve): compute metrics client-side from tree data; block preview for remote sources * feat(serve): file preview, export, source history, and media support - Add remote file preview via GitHubSource.read_file(); other remote sources return a 403 gracefully - Add PNG/SVG export from toolbar with embedded JetBrains Mono font; export CSS resolves --dir-border at export time so borders appear - Fix export dropdown not collapsing (missing #export-menu.hidden rule) - Add HEIC/HEIF preview via pillow-heif or macOS sips fallback - Add audio file preview (mp3/wav/ogg/flac/aac/m4a/opus/weba) - Fix .mov preview: remap MIME to video/mp4 for Chrome/Firefox compat - Fix binary file hex dump: use errors="strict" so non-UTF-8 files actually reach the 1000-byte hex dump path - Fix absolute local paths in source field not loading - Fix metadata read crash when ffprobe returns invalid JSON - Improve Python rounding in render_png/svg_render (defer to draw time) - Add source history dropdown: localStorage-backed, max 20 entries, per-item delete, closes on outside click via capture-phase listener - Add folder/file border colours as solid #fff/#000 following dark/light - Add pillow_heif to mypy ignore_missing_imports overrides * chore: bump version to 0.6.0 and update changelog
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.
Description
Type of Change
Checklist
make test)make lint)