terry-staging #16

Merged
terry merged 96 commits from terry-staging into main 2026-06-05 16:33:12 +00:00
2 changed files with 25 additions and 3 deletions
Showing only changes of commit 908f89ac24 - Show all commits

View File

@@ -9,6 +9,7 @@ import { VideoBubble } from "./bubbles/VideoBubble";
import { LinkPreviewCard } from "./LinkPreviewCard";
import { formatDateTime } from "./utils/formatTime";
import { FavoriteButton } from "../../favorites/FavoriteButton";
import { BubbleAttachmentDownloadButton } from "./BubbleAttachmentDownloadButton";
export type MessageBubbleVariant = "default" | "latest";
@@ -106,6 +107,12 @@ export function MessageBubble({
onFavoriteChange?.(post.id, favorited)
}
/>
{isFileBubble && post.attachments.length === 1 ? (
<BubbleAttachmentDownloadButton
postId={post.id}
attachment={post.attachments[0]}
/>
) : null}
</div>
</div>
) : null}

View File

@@ -19,7 +19,15 @@ import { FavoriteButton } from "../../../favorites/FavoriteButton";
import { BubbleAttachmentDownloadButton } from "../BubbleAttachmentDownloadButton";
import type { MessageBubbleVariant } from "../MessageBubble";
function AttachmentRow({ postId, att }: { postId: string; att: Attachment }) {
function AttachmentRow({
postId,
att,
showDownload,
}: {
postId: string;
att: Attachment;
showDownload: boolean;
}) {
const { Icon, color } = fileIcon({ mime: att.mime, filename: att.filename });
const displayFilename = filenameWithExtension(att.filename, att.mime);
const [previewFailed, setPreviewFailed] = useState(false);
@@ -70,7 +78,9 @@ function AttachmentRow({ postId, att }: { postId: string; att: Attachment }) {
{formatBytes(att.sizeBytes)}
</div>
</div>
<BubbleAttachmentDownloadButton postId={postId} attachment={att} />
{showDownload ? (
<BubbleAttachmentDownloadButton postId={postId} attachment={att} />
) : null}
</div>
);
}
@@ -195,7 +205,12 @@ export function FileDocBubble({
return (
<div className="flex flex-col gap-3">
{post.attachments.map((att) => (
<AttachmentRow key={att.id} postId={post.id} att={att} />
<AttachmentRow
key={att.id}
postId={post.id}
att={att}
showDownload={post.attachments.length >= 2}
/>
))}
{text ? (
<CollapsibleText className="message-stream-copyable-text select-text whitespace-pre-wrap break-words text-[15px] font-medium leading-6 text-neutral-100">