Skip to content

Add interactive website#6

Merged
deeplook merged 25 commits into
mainfrom
feat/website
Jun 9, 2026
Merged

Add interactive website#6
deeplook merged 25 commits into
mainfrom
feat/website

Conversation

@deeplook

@deeplook deeplook commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Description

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • Tests pass (make test)
  • Linting passes (make lint)
  • Documentation updated (if needed)

deeplook added 25 commits June 2, 2026 16:02
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
- 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 deeplook merged commit 1d72cd0 into main Jun 9, 2026
6 checks passed
@deeplook deeplook deleted the feat/website branch June 9, 2026 14:19
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