mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-07-02 12:22:22 +00:00
* fix: download original file from artifact preview panel for office documents The preview panel download button serialized the rendered HTML preview instead of the original binary for office artifacts (pptx/xlsx/docx) produced by the code interpreter, so users got an `index.html` text scrape rather than the file. The inline chat card was unaffected because it downloads the real file via `useAttachmentLink`. Thread the original-file download metadata (filepath/file_id/source/user) through `fileToArtifact` onto the Artifact, and update `DownloadArtifact` to fetch the original file through that same path for preview-only office artifacts. Text, source, and markdown artifacts keep the blob path so their in-panel content (and edits) still download as-is. Closes #14002 * fix: require a usable route before downloading the original artifact file A shared link to a non-snapshotted code-execution office artifact strips source/user and deletes filepath while keeping file_id (share sanitization + applyShareFileRoute). The preview-panel download gate treated that lone file_id as sufficient, so it routed to an empty useCodeOutputDownload fetch and downloaded nothing instead of falling back to the preview-content blob. Take the original-file branch only when useAttachmentLink can actually fetch: a non-empty filepath (http target, share route, or code-output URL) or full local-file metadata (isLocallyStoredSource + file_id + user). Export isLocallyStoredSource from LogLink so the panel reuses the same predicate. * fix: only show artifact download success after the file is delivered useAttachmentLink swallows fetch errors (an expired code-output URL or a 404 share download) and resolves without throwing, so the preview-panel download button flipped to the success checkmark even when no file was downloaded. Return a boolean from handleDownload (true once a download is initiated, false on error/empty response) and only mark the artifact download as succeeded when a file was actually delivered. The return value is ignored by the existing onClick callers. |
||
|---|---|---|
| .. | ||
| public | ||
| scripts | ||
| src | ||
| sw | ||
| test | ||
| babel.config.cjs | ||
| check_updates.sh | ||
| index.html | ||
| jest.config.cjs | ||
| jest.resolver.cjs | ||
| nginx.conf | ||
| package.json | ||
| postcss.config.cjs | ||
| tailwind.config.cjs | ||
| tsconfig.json | ||
| vite.config.ts | ||