From b3c2ea5ba5e5753c5b4c847402aa4556260fb7f6 Mon Sep 17 00:00:00 2001 From: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@buzz.block.builderlab.xyz> Date: Thu, 30 Jul 2026 15:16:16 -0700 Subject: [PATCH] feat(desktop): restore compact link preview cards Co-authored-by: Taylor Ho Signed-off-by: Taylor Ho --- .../src/shared/ui/link-preview-attachment.tsx | 425 +++++++----------- desktop/tests/e2e/messaging.spec.ts | 251 ++++------- 2 files changed, 253 insertions(+), 423 deletions(-) diff --git a/desktop/src/shared/ui/link-preview-attachment.tsx b/desktop/src/shared/ui/link-preview-attachment.tsx index 2fd843999..5a85dd943 100644 --- a/desktop/src/shared/ui/link-preview-attachment.tsx +++ b/desktop/src/shared/ui/link-preview-attachment.tsx @@ -1,11 +1,103 @@ -import { ChevronDown, ChevronUp, X } from "lucide-react"; -import { useEffect, useRef, useState } from "react"; +import { Globe, X } from "lucide-react"; import type { ResolvedLinkPreview } from "@/shared/lib/useResolvedLinkPreviews"; import { cn } from "@/shared/lib/cn"; import { Button } from "@/shared/ui/button"; +import { + Attachment, + AttachmentContent, + AttachmentMedia, + AttachmentTitle, + AttachmentTrigger, +} from "@/shared/ui/attachment"; -function LinkPreviewIdentity({ preview }: { preview: ResolvedLinkPreview }) { +function LinearLogo({ className }: { className?: string }) { + return ( + + ); +} + +function GitHubLogo({ className }: { className?: string }) { + return ( + + ); +} + +function GoogleDriveLogo({ className }: { className?: string }) { + return ( + + ); +} + +function GoogleDocsLogo({ className }: { className?: string }) { + return ( + + ); +} + +function GoogleSheetsLogo({ className }: { className?: string }) { + return ( + + ); +} + +function GoogleSlidesLogo({ className }: { className?: string }) { + return ( + + ); +} + +function getHostname(preview: ResolvedLinkPreview): string { + try { + return new URL(preview.href).hostname.replace(/^www\./, ""); + } catch { + return preview.provider; + } +} + +function LinkPreviewLogo({ preview }: { preview: ResolvedLinkPreview }) { if (preview.faviconDataUrl) { return ( ); } - return null; -} -function getHostname(preview: ResolvedLinkPreview): string { - try { - return new URL(preview.href).hostname.replace(/^www\./, ""); - } catch { - return preview.provider; + switch (preview.kind) { + case "github-issue": + case "github-pull-request": + case "github-repository": + return ; + case "linear-issue": + return ; + case "google-drive-file": + case "google-drive-folder": + return ; + case "google-docs-document": + return ; + case "google-sheets-spreadsheet": + return ; + case "google-slides-presentation": + return ; + case "generic-link": + return