Skip to content

fix(web): peel annotated tags and resolve short ids wherever a ref resolves (FG-1) - #150

Merged
PastaPastaPasta merged 1 commit into
masterfrom
fix/fg1-ref-resolution
Sep 29, 2026
Merged

PastaPastaPasta merged 1 commit into
masterfrom
fix/fg1-ref-resolution

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

Summary

Fix group FG-1 from the dash showcase QA ledger: ref resolution. Annotated tags are now peeled everywhere a ref resolves, short commit ids work in ?ref=, and errors that can never succeed no longer offer "Try again".

  • L-01 (S1): annotated tags can be browsed. Before, 306 of the dash mirror's 575 tags, including every release tag, failed on code, blob, commits, history, blame and zip with <oid> is not a commit, because a ref's tip is the tag object and nothing peeled it. Now:
    • A new peel / peelToCommit (lib/view/tree-nav.ts) follows annotated tags to what they name, including nested tags (tag → tag → commit), bounded at 16. A tag's target is only asked its type when it is too large to be a tag.
    • A new resolveTip (lib/view/tip.ts) resolves a view's starting object (a short id, then any tags) and caches {oid, type} for the session. That's safe because objects are hash-checked: an id always names the same bytes. Nothing a tag says about itself is cached, since in a private repo that's decrypted content. A tag view costs one extra object read the first time and none after, and warm views paint at once. The tip commit is primed into the history memo, so branch views pay no extra cold read.
    • A ResolvedTip gate (components/repo/resolved-tip.tsx) runs before the tree, blob, commits/history, blame and home views. The zip and the commit page peel too.
    • The home page's commit column, commit count and the About card key on the peeled commit.
    • Tags of trees or blobs: a tag of a tree lists that tree (code, zip). A tag of a blob opens that file on the blob view. History and blame say plainly that the tag names a tree or file, not a commit, and link to it.
  • L-02: the tags list shows the commit.
    • Each chip shows the commit its tag names, peeled lazily once it scrolls into view: one read per tag, through one read-ahead walker, keyed by the tip so a force-moved tag's chip starts over.
    • Listing answers trust a tag's declared target type and live in a separate cache. The views never read that cache.
    • The list reads only the published browse index: it never starts the in-browser clone, and shows the tips as they are when no index will be ready. The branches page starts no browse index at all.
    • A tag object's id opens the commit page with "tagged v23.1.8", and the wrong "names a file or directory" copy now names what the object is.
  • Release pages: "Browse files" (and on a release's own page, "View commit") appear when a live tag has the release's name.
  • L-32: short SHAs in ?ref= resolve through the locator's prefix index.
    • An ambiguous prefix gets the "Ambiguous commit id" state with the matching commits.
    • A pinned id the repo does not hold reads "Commit not found", with Try again.
    • Branch and tag names still win over a hex-looking name.
    • The not-found copy reads "No branch, tag or commit named …".
  • L-28: commit-page file links keep the commit (ref=<commit>).
  • L-63: a folder path in /repo/blob redirects to /repo/tree (a replace, so Back skips it). Errors no retry can fix show no "Try again" in any browse state: a wrong object type, a malformed object, an ambiguous or non-commit id. Missing objects and "Commit not found" keep it. A pack whose storage stopped answering still shows the storage-unreachable card.

Coordination: repo-home-content.tsx changes by one wrapper only (RootBody receives the peeled commit), so the perf work's reads are untouched. The last-change column keys by the peeled commit.

Ledger: L-01, L-02, L-28, L-32, L-63 (dash-forge-qa/evidence/dash-ux/LEDGER.md, FG-1).

Tests

  • lib/view/tag-peel.test.ts (29 tests):
    • parseTag, and peeling commits, tags, nested tags, and tags of trees and blobs;
    • a tag of a large blob asks only its type;
    • the depth bound, and verify: false costing one read;
    • the zip and the commit page through a tag;
    • the cache: one read per id, listing answers kept apart, and only {oid, type} stored;
    • short, ambiguous, unknown and pinned-missing ids;
    • the About card's short-id lookup;
    • history-memo priming (fails without it);
    • which errors are permanent.
  • components/repo/resolved-tip.test.tsx: a tag of a blob reaches a file view but not a history view; a pack outage shows the storage card; "Commit not found" offers Try again and an ambiguous id does not.
  • components/repo/ref-list-content.test.tsx: a chip shows the peeled commit and follows a force-moved tag (fails without the key); the tip shows as-is when no index will be ready; the branches list starts no browse index.
  • lib/view/refs.test.ts: a short hex param is now pinned (L-32 changes this on purpose); other unknown names stay unresolved.
  • e2e/tag-refs.spec.ts: read-only, on moutai against the dash mirror.

Live verification

Build c7b92ab (this PR's head), served on a private port, with the port's owner and the served sha checked before the run. tag-refs.spec.ts ran on moutai: 6 passed.

  • tr-1: v23.1.8 on home, blob, commits, history and blame, with no error (L-01);
  • tr-2: the v23.1.8 zip builds;
  • tr-3: the tags list chip shows 728f505, and the tag object's commit page says "tagged v23.1.8" (L-02);
  • tr-4: ?ref=1deab35186f9c lists commits (L-32);
  • tr-5: a 2017 commit's file link opens the file at that commit (L-28);
  • tr-6: blob?path=src lands on the tree (L-63).

Before/after screenshots of 8 pages are in the QA workspace. Before is master at a050f8c (79b6c521 is not a commit / Try again); after is this build (v23.1.8's tree at 728f505).

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 21 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: f1c69023-ab54-4f96-9cd1-6c947bb22dfd

📥 Commits

Reviewing files that changed from the base of the PR and between 4c86c2a and dd6f33d.

📒 Files selected for processing (30)
  • forge-web/components/repo/blame-content.test.tsx
  • forge-web/components/repo/blame-content.tsx
  • forge-web/components/repo/blob-content.tsx
  • forge-web/components/repo/clone-box.tsx
  • forge-web/components/repo/commit-content.tsx
  • forge-web/components/repo/commits-content.tsx
  • forge-web/components/repo/ref-list-content.test.tsx
  • forge-web/components/repo/ref-list-content.tsx
  • forge-web/components/repo/ref-switcher.tsx
  • forge-web/components/repo/releases-content.tsx
  • forge-web/components/repo/repo-facts-card.tsx
  • forge-web/components/repo/repo-home-content.tsx
  • forge-web/components/repo/repo-rail.tsx
  • forge-web/components/repo/resolved-tip.test.tsx
  • forge-web/components/repo/resolved-tip.tsx
  • forge-web/components/repo/tag-commit.tsx
  • forge-web/components/repo/tree-content.tsx
  • forge-web/e2e/helpers.ts
  • forge-web/e2e/tag-refs.spec.ts
  • forge-web/lib/view/commit-log.ts
  • forge-web/lib/view/git-objects.ts
  • forge-web/lib/view/path-history.ts
  • forge-web/lib/view/pool.ts
  • forge-web/lib/view/refs.test.ts
  • forge-web/lib/view/refs.ts
  • forge-web/lib/view/repo-facts.ts
  • forge-web/lib/view/tag-peel.test.ts
  • forge-web/lib/view/tip.ts
  • forge-web/lib/view/tree-nav.ts
  • forge-web/lib/view/zip.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…solves

Annotated tags (every dash release tag) failed on code, blob, commits, history, blame and zip with '<oid> is not a commit': a ref's tip is the tag object and nothing peeled it (L-01). Views now resolve their tip through resolveTip: a short id through the locator (L-32), then any nested tags, cached for the session as {oid, type}. Tags of trees and blobs get their own views. The tags list shows each tag's commit (L-02), commit-page file links keep the commit (L-28), a directory path in /repo/blob opens the tree (L-63), and errors no retry can fix show no Try again. Storage outages still show the storage card.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@PastaPastaPasta
PastaPastaPasta merged commit 69823e1 into master Sep 29, 2026
6 checks passed
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