mirror of
https://github.com/nexu-io/open-design.git
synced 2026-10-27 09:51:12 +01:00
Python files in Design Files cannot be previewed inline today: the side panel falls back to BinaryViewer and users can only download or open externally, even though `.py` is plain text and reasonable to inspect in-app. Root cause: `kindFor()` in `apps/daemon/src/projects.ts` (line 278) classifies files into coarse buckets the frontend uses to pick a viewer. The `'code'` branch lists `.js / .mjs / .cjs / .ts / .tsx / .json / .css` but not `.py`, so Python files fall through to `'binary'`. The frontend already renders the `'code'` bucket via `TextViewer` in `apps/web/src/components/FileViewer.tsx`, so once a file lands in the `'code'` bucket it gets the existing read-only code preview for free. Fix: add `'.py'` to the `'code'` extension list. No frontend change needed — `TextViewer` handles it on receipt. Scope: this PR keeps the change minimal to match the issue (`.py` only). Other commonly-requested text-like extensions (`.yaml / .yml / .toml / .sh`, plus other code languages) can be added in a follow-up if maintainers want that surface area. Closes #61