Skip to content

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

Open
yinkev wants to merge 1 commit into
block:mainfrom
yinkev:feat/repo-file-deep-links
Open

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

Conversation

@yinkev

@yinkev yinkev commented Jul 26, 2026

Copy link
Copy Markdown

Summary

  • extend the existing canonical first-party buzz://repo entity link with an optional atomic repository target
  • preserve repository links through Markdown sanitization and route clicks inside Buzz
  • navigate through the canonical 30617:<owner>:<d-tag> project identity, select the requested branch or full commit, and open the requested file or directory
  • let native repository snapshots include a bounded target 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.

URI contract

Root links remain byte-compatible:

buzz://repo?owner=<64-hex-pubkey>&d=<repo-dtag>

Target links extend that same canonical identity:

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

ref and path are atomic. The parser rejects credentials, ports, URI path components, fragments, unknown or duplicate parameters, malformed identifiers, absolute paths, backslashes, control characters, empty components, . / .., invalid Git refs, and the discarded parallel repo= form.

Implementation

  • one canonical entity-link parser and builder; no parallel repository-file URL authority
  • route-search validation preserves current repositoryId behavior and atomically accepts or discards target state
  • target mode uses the canonical project clone, forces a remote snapshot, opens Files, and resolves files or directories after the requested snapshot loads
  • existing pull-request, tag, default-branch, external-host, and multi-repository behavior remains unchanged when no target is present
  • native snapshots use NUL-delimited git ls-tree, validate explicit refs, commits, and paths before Git work, and add only the exact file or bounded directory descendants outside the normal tree cap
  • malformed or unavailable targets fail closed with repository-root recovery

Validation

Fresh verification after rebasing onto current main:

  • focused parser, Markdown, navigation, snapshot, and target slice: 104 passed
  • full Desktop suite: 4,313 passed
  • Desktop typecheck and production build: passed
  • focused Tauri project-git suite: 38 passed
  • Cargo fmt and Clippy with warnings denied: passed
  • changed-file Biome, pixel-text, pubkey-truncation, diff, and conflict-marker checks: passed
  • all touched files comply with the file-size ratchet; the remaining findings are identical to current upstream's pre-existing set

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 Outdated
Comment thread desktop/src-tauri/src/commands/project_git_focus.rs
Comment thread desktop/src/features/projects/lib/projectRepoSnapshotTarget.ts Outdated
@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
@yinkev
yinkev force-pushed the feat/repo-file-deep-links branch from 6f33e42 to d335190 Compare July 27, 2026 23:40
@yinkev
yinkev marked this pull request as ready for review July 27, 2026 23:40
@yinkev
yinkev requested a review from a team as a code owner July 27, 2026 23:40

yinkev commented Aug 5, 2026

Copy link
Copy Markdown
Author

Author-status audit — refined 2026-08-05: this branch remains valuable, but it now requires a semantic rewrite rather than a mechanical rebase. Upstream commit a1d78f2959b41c63f063ff818076d38c31071a47 established the canonical entity-link contract as buzz://repo?owner=<hex>&d=<repo-dtag>, with one strict parser in desktop/src/shared/lib/entityLink.ts, shared Markdown handling in markdown/entityLinks.tsx, and golden parity with the Rust CLI builder. This branch independently defines buzz://repo?owner=…&repo=…&ref=…&path=…; preserving that parser would create two incompatible meanings for the same scheme and duplicate the newly extracted Markdown seams.

The unique work is still needed: repository ref/path search state, canonical-clone selection, explicit-ref handling, focused-path snapshot inclusion beyond the normal tree cap, and file/directory/root-recovery behavior. The correct refresh is therefore:

  1. keep upstream owner+d as the stable repository identity and route through 30617:<owner>:<d>;
  2. extend the canonical repo entity link with an optional validated ref+path pair (neither or both), rather than adding a parallel repoFileLink namespace;
  3. integrate click handling into current markdown/entityLinks.tsx / entityLink.ts, preserving ordinary repo-root cards and CLI golden strings;
  4. retain this branch’s route search, repository viewer, canonical clone, explicit-ref, and Tauri focused-tree changes;
  5. rerun the current Desktop/Tauri full gates and add compatibility tests proving old owner+d links remain byte-for-byte valid.

The PR stays draft until that rewrite is committed. The current GitHub installation cannot update yinkev/buzz, so no misleading conflict-only rebase has been attempted.

@yinkev
yinkev marked this pull request as draft August 5, 2026 07:23
@yinkev
yinkev force-pushed the feat/repo-file-deep-links branch from 7ed211c to 0a7932f Compare August 5, 2026 18:00
@yinkev
yinkev force-pushed the feat/repo-file-deep-links branch from 0a7932f to 1eee4ad Compare August 5, 2026 18:13
@yinkev
yinkev marked this pull request as ready for review August 5, 2026 18:19
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