mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-31 16:33:34 +08:00
c2774fc1 routed every pasted file through its native path so non-image files could be attached, and `pathToComposerAttachment` labels all of them `type: 'file'` with no preview source. AttachmentGallery only draws an <img> when `previewUrl` or `data` is set, so a pasted image rendered as the generic file card -- until the tab was reopened, when the same attachment came back from the transcript's inlined image block with base64 `data` and displayed correctly. Live and restored display had drifted apart. Re-inlining the bytes is not the fix: ba28e444 made desktop attachments path-only after a 12-file send inflated the payload to 50MB, and that still holds. attachmentImages resolves an image attachment's source instead -- previewUrl, then data, then an absolute path streamed back through /api/filesystem/file, the endpoint InlineImageGallery already uses for model-produced images. The websocket payload stays path-only. The extension set deliberately matches ConversationService's shouldInlineImageAttachment rather than everything that endpoint can serve: promoting .svg or .avif to `type: 'image'` would make the server inline a media type the API rejects. Those keep the file card, as does an image whose preview cannot load -- a moved file, or a path outside the roots the local server may read. What reaches the model is unchanged; the server already inlined pasted images by extension, so this `type` never decided that.
Claude Code Haha Desktop
基于 Tauri 2 + React 的桌面客户端。
开发
bun install
bun run tauri dev
构建
# macOS (Apple Silicon)
./scripts/build-macos-arm64.sh
# Windows (x64, MSI only)
.\scripts\build-windows-x64.ps1
构建产物位于 build-artifacts/ 目录,文件名会显式包含平台、架构和包类型。
常见问题
macOS 提示"已损坏,无法打开"
xattr -cr /Applications/Claude\ Code\ Haha.app