feat(attachments): support local files and video attachments (#6321)

* feat(attachments): support local files and video attachments

Share gateway inspection and send validation for borrowed local paths while preserving binary uploads, original-file ownership, and existing limits.

Related to NAN-284. Native provider video input remains outside this change.

* test: make cross-platform verification fixtures self-contained

* test(webui): align typed fixtures with runtime contracts

* fix(webui): preserve uploaded video playback during history sync

* test(tui): preserve local attachment drafts across resizes

* perf(attachments): preserve upload caches and release video previews

* docs(webui): keep attachment guidance user-focused

* chore: remove redundant dependency comment

* test(providers): make stream idle renewal timing deterministic

* fix(attachments): keep upload byte limits out of local references

Validate common format/count rules separately from upload byte budgets. Keep local inspection and send-time checks metadata-only, and exclude local references from composer and pending-upload totals. Explain upload size rejections with actual size and maximum in all ten locales. Related to NAN-284.

* fix(attachments): retain image references and draft order

* fix(attachments): close local reference UX and authorization gaps

* fix(attachments): preserve focus during asynchronous path confirmation
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-22 18:32:18 +08:00
1 parent 7dfeff9ddf
commit 254f94b068
65 files changed
+1816 -292

No files matched your search

+4 -2
View File
@@ -477,7 +477,7 @@ export function MessageBubble({
{!hasText ? contextMenu : null}
{hasImages ? <ImageGallery images={images} align="right" size="compact" /> : null}
{!hasImages && hasMedia ? (
<MessageMedia media={media} align="right" />
<MessageMedia media={media} align="right" pending={message.deliveryStatus === "sending"} />
) : null}
{quotedContext ? (
<UserQuotedContext
@@ -641,9 +641,11 @@ function mergeCliMentionApps(
function MessageMedia({
media,
align,
pending = false,
}: {
media: UIMediaAttachment[];
align: "left" | "right";
pending?: boolean;
}) {
const inlineImages = useInlineImages();
if (media.length === 0) return null;
@@ -673,7 +675,7 @@ function MessageMedia({
<ImageGallery images={images} align={align} size={align === "left" ? "large" : "compact"} />
) : null}
{nonImages.map((item, i) => (
<AttachmentTile key={`${item.url ?? item.name ?? item.kind}-${i}`} attachment={item} />
<AttachmentTile key={`${item.kind}-${i}`} attachment={item} pending={pending} />
))}
</div>
);