Skip to content

feat(desktop): enrich link previews with page metadata - #3316

Open
tellaho wants to merge 3 commits into
mainfrom
tho/link-ograph-embeds
Open

feat(desktop): enrich link previews with page metadata#3316
tellaho wants to merge 3 commits into
mainfrom
tho/link-ograph-embeds

Conversation

@tellaho

@tellaho tellaho commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Category: improvement
User Impact: Messages now show richer, more recognizable previews for supported HTTPS links.

Problem: Link cards relied on URL-derived or sender-entered labels, so they often lacked the page context users needed. Generic HTTPS links had no compact preview at all.

Solution: Fetch bounded Open Graph, Twitter, or HTML title metadata through the native networking boundary, while preserving provider-specific labels and safe URL fallbacks. Generic links use a bundled globe icon, and unsafe or unavailable metadata fails closed without changing the visible link.

File changes

desktop/src-tauri/src/commands/link_preview.rs
Adds hardened, bounded page-metadata retrieval and title/site-name extraction for public HTTPS URLs.

desktop/src-tauri/src/lib.rs
Registers the native link-preview metadata command.

desktop/src/features/communities/useCommunityInit.ts
Clears ephemeral preview metadata when the active community changes.

desktop/src/shared/lib/linkPreview.test.mjs
Covers generic HTTPS previews, exclusions, ordering, deduplication, and title fallbacks.

desktop/src/shared/lib/linkPreview.ts
Recognizes generic public HTTPS links while retaining specialized provider previews and existing limits.

desktop/src/shared/lib/useResolvedLinkPreviews.ts
Resolves fetched metadata through an ephemeral, deduplicated client cache and merges it into card models.

desktop/src/shared/ui/link-preview-attachment.tsx
Uses the bundled globe as the neutral source mark for generic web previews.

Reproduction steps

  1. Run Buzz Desktop and open a channel containing a GitHub, Linear, or Google link; confirm its existing provider label remains and its title resolves from page metadata when available.
  2. Send a public generic https:// URL and confirm a compact card appears below the visible original link with a globe source icon.
  3. Send an http:// URL and confirm Buzz leaves the link visible without generating a preview card.
  4. Switch communities and confirm previews resolve normally without carrying cached metadata across communities.

Screenshots

Generic source icon before/after: image

npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w and others added 3 commits July 28, 2026 06:47
Co-authored-by: npub14vtk7pvazqrq9639qu7e560wnqtl0d53ca4gjuvq6jzf3k2el23qqlwa7f <ab176f059d100602ea25073d9a69ee9817f7b691c76a897180d48498d959faa2@buzz.block.builderlab.xyz>
Signed-off-by: npub14vtk7pvazqrq9639qu7e560wnqtl0d53ca4gjuvq6jzf3k2el23qqlwa7f <ab176f059d100602ea25073d9a69ee9817f7b691c76a897180d48498d959faa2@buzz.block.builderlab.xyz>
Co-authored-by: npub14vtk7pvazqrq9639qu7e560wnqtl0d53ca4gjuvq6jzf3k2el23qqlwa7f <ab176f059d100602ea25073d9a69ee9817f7b691c76a897180d48498d959faa2@buzz.block.builderlab.xyz>
Signed-off-by: npub14vtk7pvazqrq9639qu7e560wnqtl0d53ca4gjuvq6jzf3k2el23qqlwa7f <ab176f059d100602ea25073d9a69ee9817f7b691c76a897180d48498d959faa2@buzz.block.builderlab.xyz>
Co-authored-by: Taylor Ho <[email protected]>
Signed-off-by: Taylor Ho <[email protected]>
@tellaho
tellaho force-pushed the tho/link-ograph-embeds branch from fb62b1e to e8d3c1f Compare July 28, 2026 14:51
@tellaho
tellaho marked this pull request as ready for review July 28, 2026 15:28
@tellaho
tellaho requested a review from a team as a code owner July 28, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant