From 324551538b22abddfa4306da7e00bdf36c8583ed Mon Sep 17 00:00:00 2001 From: Nexus Dev Date: Thu, 2 Apr 2026 00:03:03 +0000 Subject: [PATCH] feat(25-04): wire ChatCodeFilePreview into ChatFilePreview and mark FILE-07 FILE-13 Complete - Add code category branch in ChatFilePreview routing to ChatCodeFilePreview - Mark FILE-07 (one-click download) as Complete in REQUIREMENTS.md - Mark FILE-13 (cross-device access) as Complete in REQUIREMENTS.md - Update Traceability table for FILE-07 and FILE-13 --- .planning/REQUIREMENTS.md | 8 ++++---- ui/src/components/ChatFilePreview.tsx | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.planning/REQUIREMENTS.md b/.planning/REQUIREMENTS.md index b13d42a6..fffc9127 100644 --- a/.planning/REQUIREMENTS.md +++ b/.planning/REQUIREMENTS.md @@ -89,13 +89,13 @@ - [x] **FILE-04** — Dual scoping: a file uploaded during a project-linked conversation lives in `files/projects//` but is also referenced by the chat message; a file in a general chat (no project context) lives in `files/chat//` - [x] **FILE-05** — File upload from chat input via drag-and-drop or button; file is stored on disk and its metadata is written to libSQL - [x] **FILE-06** — Inline file preview in chat: images render inline, PDFs show a first-page preview, code files show a syntax-highlighted preview -- [ ] **FILE-07** — One-click file download from chat for any attached or generated file +- [x] **FILE-07** — One-click file download from chat for any attached or generated file - [ ] **FILE-08** — Agent-generated files (code output, specs, presentations) stored in `files/projects//generated/`, linked to the originating task and conversation in libSQL - [ ] **FILE-09** — Git integration: `files/` is a git repository; every file operation (upload, generate, replace, delete) creates a commit with a descriptive message - [ ] **FILE-10** — Version history: user can view the git log for any file and see its change history - [ ] **FILE-11** — Placeholder asset tracking: Nexus auto-maintains a `PLACEHOLDERS.md` manifest in each project directory; when a placeholder is replaced by a final asset, the manifest and DB are updated with the replacement chain - [x] **FILE-12** — File scope promotion: a chat-scoped file can be promoted to a project scope; a project file can be referenced in any chat conversation -- [ ] **FILE-13** — Cross-device file access: files are served via the Nexus server API so a file uploaded on one device is accessible on any other device on the network +- [x] **FILE-13** — Cross-device file access: files are served via the Nexus server API so a file uploaded on one device is accessible on any other device on the network --- @@ -174,10 +174,10 @@ The following are explicitly deferred: | FILE-04 | Phase 25 | Complete | | FILE-05 | Phase 25 | Complete | | FILE-06 | Phase 25 | Complete | -| FILE-07 | Phase 25 | Pending | +| FILE-07 | Phase 25 | Complete | | FILE-08 | Phase 25 | Pending | | FILE-09 | Phase 25 | Pending | | FILE-10 | Phase 25 | Pending | | FILE-11 | Phase 25 | Pending | | FILE-12 | Phase 25 | Complete | -| FILE-13 | Phase 25 | Pending | +| FILE-13 | Phase 25 | Complete | diff --git a/ui/src/components/ChatFilePreview.tsx b/ui/src/components/ChatFilePreview.tsx index 8e821aa8..4e1be910 100644 --- a/ui/src/components/ChatFilePreview.tsx +++ b/ui/src/components/ChatFilePreview.tsx @@ -1,4 +1,5 @@ import { ChatFileCard } from "./ChatFileCard"; +import { ChatCodeFilePreview } from "./ChatCodeFilePreview"; import type { ChatFile } from "@paperclipai/shared"; interface ChatFilePreviewProps { @@ -24,6 +25,10 @@ export function ChatFilePreview({ file, contentPath }: ChatFilePreviewProps) { ); } - // For all non-image types (code, document, other): render the file card with download + if (file.category === "code") { + return ; + } + + // For all non-image, non-code types (document, other): render the file card with download return ; }