Skip to content

feat(desktop): open repository files from message links#2952

Draft
yinkev wants to merge 2 commits into
block:mainfrom
yinkev:feat/repo-file-deep-links
Draft

feat(desktop): open repository files from message links#2952
yinkev wants to merge 2 commits into
block:mainfrom
yinkev:feat/repo-file-deep-links

Conversation

@yinkev

@yinkev yinkev commented Jul 26, 2026

Copy link
Copy Markdown

Summary

  • add a strict first-party buzz://repo URI contract for hosted repository files and directories
  • preserve repository links through Markdown sanitization and route clicks inside Buzz rather than through the OS
  • navigate to the canonical project, force the hosted repository source, select the requested branch or commit, and open the requested file or directory
  • let the native repository snapshot include a bounded focused path beyond the normal 250-entry tree cap
  • fail closed on malformed coordinates and offer Open repository root when a ref or path is unavailable

Closes #2906.

Duplicate search: no overlapping open pull request found; this implements the existing issue above.

URI contract

buzz://repo?owner=<64-hex-pubkey>&repo=<repo-id>&ref=<branch-or-commit>&path=<repository-relative-path>

The parser rejects credentials, ports, extra URI path components, fragments, unknown or duplicate parameters, malformed identifiers, absolute paths, backslashes, control characters, empty components, and . / .. traversal.

Arbitrary file:// access is deliberately unchanged.

Implementation

  • Markdown runtime: preserves and renders valid buzz://repo anchors, including context-menu copy/open behavior
  • Navigation: maps stable repository identity plus repoRef / repoPath search state into the project route
  • Project route: validates repository target search atomically so incomplete or unsafe state is discarded
  • Repository viewer: synchronously uses the hosted snapshot for repository links, opens the Files tab, resolves files/directories after the requested snapshot loads, retries after ref recovery or snapshot replacement, and exposes repository-root recovery
  • Native snapshot: uses NUL-delimited git ls-tree output, safely matches non-ASCII paths, and appends only the exact file or bounded directory descendants outside the normal tree cap
  • Explicit refs: validated refs/heads/, refs/tags/, and refs/nostr/ targets stay on the explicit fetch path; unavailable branches fail instead of silently cloning the default branch
  • Repository identity: explicit links always fetch from the canonical project clone URL rather than an active pull request's alternate/fork URL

This PR implements the Desktop vertical slice while keeping the URI stable for independent web/mobile adoption.

Testing

  • parser/build/round-trip and adversarial URI tests
  • Markdown URL-transform regression tests for buzz://repo, buzz://message, external links, and unsafe schemes
  • route-search validation, ref-precedence, canonical-clone, and synchronous-source tests
  • repository-target file/directory/missing/retry/root-recovery tests
  • native focus-path validation, cap, exact-file, directory-prefix, non-ASCII, and explicit branch-ref tests
  • focused Tauri tests — 13 passed
  • Tauri cargo fmt --check
  • Tauri Clippy with warnings denied
  • changed-file Biome checks
  • pnpm typecheck
  • full Desktop suite — 3,540 passed
  • Desktop production build — passed

Current gate dependency

Current main independently exceeds the existing managed_agents/runtime.rs file-size ratchet after #2176. #2930 restores that gate without changing runtime behavior and has a fully successful GitHub CI run. This PR remains draft until that prerequisite lands and this branch is rebased; no unrelated ratchet workaround is included here.

yinkev commented Jul 26, 2026

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f0f7fa7ba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/src/features/projects/lib/projectRepoSnapshotTarget.ts

yinkev commented Jul 26, 2026

Copy link
Copy Markdown
Author

@codex address that feedback

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@yinkev
yinkev force-pushed the feat/repo-file-deep-links branch from 2f0f7fa to ddd6682 Compare July 26, 2026 09:15
@yinkev

yinkev commented Jul 26, 2026

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ddd668288d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/src/features/projects/ui/ProjectDetailScreen.tsx
Comment thread desktop/src-tauri/src/commands/project_git_focus.rs
Comment thread desktop/src/features/projects/lib/projectRepoSnapshotTarget.ts Outdated
Signed-off-by: kyinhub <kevinpyin@gmail.com>
@yinkev
yinkev force-pushed the feat/repo-file-deep-links branch from ddd6682 to b261069 Compare July 26, 2026 09:38
@yinkev

yinkev commented Jul 26, 2026

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b261069307

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/src/features/projects/ui/ProjectRepositoryPanel.tsx
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.

Feature: open repository files directly from message links

1 participant