From fb0eca68e50d2eaefe63e88ccb90eb766c91c702 Mon Sep 17 00:00:00 2001 From: Taylor Ho Date: Thu, 30 Jul 2026 23:10:49 -0700 Subject: [PATCH] refactor(desktop): unify link preview identity styling - Remove legacy provider-specific compact preview logos and layouts in favor of hostname-driven metadata. - Present imageless compact previews with the same 84px height, description support, and left-rule treatment as image-backed cards. - Preserve fetched favicons and make favicon/hostname identity rows link directly to their source URL. - Align rich and compact hostname and description colors on the same secondary foreground treatment. - Expand messaging E2E coverage for equal-height cards, generic favicons, linked hostnames, and imageless descriptions. Co-authored-by: Taylor Ho Signed-off-by: Taylor Ho --- .../ui/compact-link-preview-attachment.tsx | 148 +++--------------- .../ui/rich-link-preview-attachment.tsx | 25 +-- desktop/tests/e2e/messaging.spec.ts | 57 ++++--- 3 files changed, 73 insertions(+), 157 deletions(-) diff --git a/desktop/src/shared/ui/compact-link-preview-attachment.tsx b/desktop/src/shared/ui/compact-link-preview-attachment.tsx index 90fbf448a..73ec27769 100644 --- a/desktop/src/shared/ui/compact-link-preview-attachment.tsx +++ b/desktop/src/shared/ui/compact-link-preview-attachment.tsx @@ -1,5 +1,3 @@ -import { Globe } from "lucide-react"; - import type { ResolvedLinkPreview } from "@/shared/lib/useResolvedLinkPreviews"; import { cn } from "@/shared/lib/cn"; import { @@ -12,84 +10,6 @@ import { } from "@/shared/ui/attachment"; import { LinkPreviewControls } from "@/shared/ui/link-preview-controls"; -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\./, ""); @@ -98,40 +18,6 @@ function getHostname(preview: ResolvedLinkPreview): string { } } -function LinkPreviewLogo({ preview }: { preview: ResolvedLinkPreview }) { - if (preview.faviconDataUrl) { - return ( - - ); - } - - 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