buzz icon indicating copy to clipboard operation
buzz copied to clipboard

feat: Buzz entity links — rich preview cards + in-app navigation for repos, PRs, and issues

Open thomaspblock opened this issue 3 months ago • 1 comments

Summary

Gives Buzz-hosted git entities the same "GitHub-style" chat experience GitHub links already get: rich preview cards, real titles, and click-through — except clicks navigate in-app to the Projects view instead of a browser.

  • Spec: docs/buzz-entity-links.md — link scheme, slices, and deferred work (buzz://project, OS deep links, web routes).
  • Canonical buzz:// deep links: new desktop/src/shared/lib/entityLink.ts with builders + strict parser for buzz://pr?id=…&owner=…&d=…, buzz://issue?…, and buzz://repo?owner=…&d=…, mirrored by a Rust module (crates/buzz-cli/src/links.rs) with a shared golden-format test so the two implementations can't drift.
  • Preview cards: linkPreview.ts recognizes buzz:// entity links and HTTPS relay clone URLs ({origin}/git/<pubkey>/<repo>, the shape agents paste today). Both normalize onto the canonical buzz:// href, so the two spellings of a repo dedupe to one Buzz-provider card (BuzzMark logo) rendered by link-preview-attachment.tsx.
  • Title enrichment: PR/issue cards fetch the real subject from the relay event (subject tag or first content line) via useResolvedLinkPreviews.ts; the cache is community-scoped and reset in resetCommunityState().
  • In-app navigation: clicking a card or inline anchor routes through goProject(owner:dtag) instead of handing the URL to the OS (markdown/entityLinks.tsx). Entity-link and external-anchor logic were extracted out of markdown.tsx to stay under the file-size ratchet.
  • Agent side: buzz pr open, buzz issues create, and buzz repos create now return a ready-made link field, and base_prompt.md instructs agents to paste it verbatim when announcing work.

Test plan

  • [x] Desktop unit tests: 4,147 pass, including new entityLink.test.mjs and linkPreview.test.mjs coverage (golden formats, malformed-link rejection, clone-URL/buzz:// dedupe)
  • [x] Rust: cargo test -p buzz-cli golden-format test, clippy + fmt clean
  • [x] Biome + tsc --noEmit clean; pre-push hooks (desktop-tauri-checks, rust-tests, desktop-test) pass
  • [ ] Manual: paste a relay clone URL and a buzz://pr link in a channel — verify one card each, real PR title, and in-app navigation to the Projects view

thomaspblock avatar Aug 04 '26 09:08 thomaspblock

Screenshots of the new Buzz entity link cards (captured via the E2E mock bridge).

Repo card from an HTTPS clone URL

An agent pastes the relay clone URL ({origin}/git/<pubkey>/<repo>) — it renders as a Buzz · repo card, and both the card and the inline link navigate in-app to the project.

01-repo-card

PR and issue cards from buzz:// deep links

buzz://pr?… and buzz://issue?… links render as cards with the real subject fetched from the relay event (not the hex fallback).

02-pr-issue-cards

Dedupe: two spellings, one card

The same repository referenced as a clone URL and a buzz://repo deep link in one message produces a single card.

03-dedupe

thomaspblock avatar Aug 04 '26 09:08 thomaspblock