Skip to content

feat(web): blame progress, partial keep, permalinks and git-exact alignment; repo shell before the SDK; hosting doc - #151

Merged
PastaPastaPasta merged 8 commits into
masterfrom
perf/blame-history-shell
Sep 29, 2026
Merged

PastaPastaPasta merged 8 commits into
masterfrom
perf/blame-history-shell

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

Summary

These changes follow up the S-1 PR (#142), from the dashpay/dash QA sweep. Items: FG-4 (blame and history), L-54 (nothing on screen until the SDK loads), L-70 (blame misattribution), and two docs for the owner.

FG-4: blame

  • One lookup seam (pathVersions). Blame finds a file's versions through pathVersions(reader, tip, path) (lib/view/path-history.ts). Today it walks first-parent history. The seam is where a push-time index can answer later without touching the view (see docs/design/last-change-index-v2.md).
  • Progress while searching (L-23). The status used to sit at "Reading the file's history… 0%" for 40–55 s on dash. It now reads "Looking for the file's versions · N commits examined", updated every 50 commits, then the compared-versions line.
  • Cancel keeps the partial result (L-23). A stopped run shows its table. Lines from the versions compared are exact; the rest sit on the oldest version reached. The table is marked "Stopped" and offers Run again. Previously Cancel said "Stopped before any version was compared" and threw the work away.
  • Permalinks (L-33).
    • Line numbers select #L ranges, with shift-click to extend (the same useLineSelection as the file view).
    • y pins the URL to the commit.
    • Copy permalink copies the full …/blame/<oid>/<path>#Lx-Ly URL.
  • Phone layout (L-34). On a phone the commit column is an 80 px age gutter; it was 288 of 390 px. The subject and link show from sm up.

L-70: blame agrees with git blame on dashstrings.cpp

  • Cause. Where a file repeats lines (QT_TRANSLATE_NOOP("dash-core", ""), our Myers diff paired different copies than git's xdiff does. That gave 2 of 429 lines to the wrong commits.
  • Fix. lib/view/xdiff.ts ports git v2.52.0's xdiff: xdl_trim_ends, xdl_cleanup_records (the rule that decided these pairings), and xdl_split with its heuristics and cost fallback. lineMap uses it after git blame's trim_common_tail, then the existing compaction. The diff views keep their diff.
  • Checked against real git:
    • 600 random pairs with repeated lines;
    • 8 large pairs that reach the heuristics;
    • the 2000-case blame property test;
    • the 33 real first-parent versions of src/qt/dashstrings.cpp, which now give no differing lines (blame-l70.test.ts, run with the dumped versions).

L-54: the repo is named before the SDK arrives

  • Change. While the 23 MB SDK wasm downloads, the repo scaffold shows the owner, name and tabs from the address, and while the repo resolves or a private repo's keys are checked. Nothing in it is read from Platform, so it claims nothing.
  • Result on Slow 3G (nr-1). The shell and repo name paint at 1.25 s; before this, only a progress bar showed for about 3 minutes. The screenshot is in evidence.

Docs

  • docs/dev/hosting.md: what the owner configures on Cloudflare for forge.dashhq.org.
    • Measured today: the wasm is cf-cache-status: DYNAMIC (not edge-cached), and /_next/static is max-age=600.
    • Cache Rule: /_next/static/ edge-cached for a year, with a 4xx status TTL.
    • Transform Rule: immutable on 200s.
    • Compression Rules: zstd, Brotli, Auto.
    • An nginx equivalent.
  • docs/design/last-change-index-v2.md. A proposal for the history-index agent, to take up after its v1 lands: per-path version lists (K=32 plus blob oids), so blame and History need no walk.

Dash numbers (cold, moutai, fresh context)

Before After
Blame src/clientversion.h: progress "Reading the file's history…" at 0% for 40–55 s commits examined, updated every 5 s from 10 s on
Blame src/clientversion.h: done 59.9 s / 272 requests (QA) 121 s / 427 requests, 135 versions, exact (moutai was about 4× slower than at QA time today)
Blame src/qt/dashstrings.cpp vs git 2 of 429 lines differ 0
Home on Slow 3G: the repo named about 180 s (after the SDK) 1.25 s

The blame walk's request count is unchanged by this PR: finding versions still means walking first-parent history. The proposed v2 index is what removes the walk.

Tests

  • Unit: blame progress while searching; the partial result on stop; the partial table on Cancel (component test); the xdiff git-oracle tests; the tail-trim arithmetic. The full suite passes (2800+).
  • e2e:
    • code-browsing-parity hb-2b: line select, shift-extend, an absolute permalink, y, and the gutter at 390 px under 96 px.
    • network-resilience nr-1: the repo name and tabs are visible while the SDK downloads.
  • Live on moutai against this build (6024407): 81 passed across code-browsing-parity, v2-home, page-budget, a11y and v2-reads; mobile 33 passed; nr-1 passed.

Review

  • code-review-validator (opus): all findings applied:
    • the absolute permalink;
    • the shell header also shown while a private repo's keys are checked;
    • hosting-doc rules scoped (status TTL, response code, Compression Rules, the nginx add_header inheritance);
    • pathVersions keeps one walker;
    • xdiff counts heuristic scans against its work bound;
    • owner shortening applied to ids only;
    • the age link taken out of the tab order.
  • code-simplifier: the oracle test now uses the real pipeline, one result builder, and duplicate handlers removed.

Ledger: L-23, L-33, L-34, L-54, L-70 (dash-forge-qa/evidence/dash-ux/LEDGER.md). Evidence: dash-forge-qa/evidence/impl/perf-blame-history-shell/.

🤖 Generated with Claude Code

PastaPastaPasta and others added 7 commits September 29, 2026 10:49
docs/dev/hosting.md: what forge.dashhq.org serves today (the wasm uncached at the edge, hashed chunks revalidated every 10 min) and the Cloudflare cache and transform rules that make /_next/static immutable and edge-cached (L-54). docs/design/last-change-index-v2.md: per-path version lists so blame and History need no walk, proposed after the history index v1 lands.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ow mobile column

FG-4 part 1. The version lookup goes through pathVersions(), one function a push-time index can answer later (docs/design/last-change-index-v2.md). Progress counts commits examined while the history is searched (L-23), and a cancelled run keeps its table: compared versions exact, the rest on the oldest reached, with Run again. Line numbers select #L ranges, y pins the commit and Copy permalink links it (L-33). On a phone the commit column is an age gutter (L-34).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
While the Platform SDK downloads (minutes on a slow link) or the repo resolves, the repo scaffold shows the owner, name and tabs from the address, with nothing claimed from Platform. nr-1 asserts it on Slow 3G. Also a live helper that dumps a file's versions for offline blame checks.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Blame compared versions with our Myers diff plus git's compaction; where a file repeats lines, xdiff's record cleanup and middle-snake split pair different copies, so 2 of 429 lines of dashstrings.cpp went to other commits than git blame gives. lineMap now runs a port of git v2.52.0 xdiff (xdl_trim_ends, xdl_cleanup_records, xdl_split with its heuristics) after git blame's common-tail trim, then the existing compaction. Checked against git: 600 random pairs with repeated lines, 8 large pairs through the heuristics, the 2000-case blame property test, and the 33 real dashstrings.cpp versions. The diff views keep their diff.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…cle test; blame copies a full permalink

Code-simplifier findings: the git-oracle test checks the exported gitChangeMarks lineMap uses, not a copy; one builder for blame's full and partial results; pathVersions keeps one read-ahead walker across its strides; blame's Copy permalink is a full URL, as the file view's.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…link out of the tab order, xdiff heuristic work counted; hosting rules scoped

The repo shell header also shows while a private repo's membership and keys are checked. The blame age link (for phones) is out of the tab order and labelled. The shell shortens only identity ids. xdiff counts the heuristic and fallback scans against its work bound. pathVersions and the v2 doc say Blame uses it and History follows. hosting.md: a 4xx status TTL and a status-200 condition on the immutable header, Compression Rules with an Auto fallback and a zstd-capable check, and an nginx block that repeats COOP/COEP inside the location (add_header replaces inherited ones) without replacing the MIME map.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 53 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: 9070fc4d-635f-40c2-83cb-e8f4d79ece95

📥 Commits

Reviewing files that changed from the base of the PR and between 24eb0f5 and f2eb52f.

📒 Files selected for processing (21)
  • docs/design/last-change-index-v2.md
  • docs/dev/hosting.md
  • 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/permalink.ts
  • forge-web/components/repo/repo-scaffold.tsx
  • forge-web/components/repo/repo-shell-header.tsx
  • forge-web/e2e/code-browsing-parity.spec.ts
  • forge-web/e2e/discovery-urls.spec.ts
  • forge-web/e2e/network-resilience.spec.ts
  • forge-web/e2e/page-budget.spec.ts
  • forge-web/e2e/rate-budget.spec.ts
  • forge-web/lib/view/blame-core.ts
  • forge-web/lib/view/blame-dump.live.test.ts
  • forge-web/lib/view/blame-l70.test.ts
  • forge-web/lib/view/blame.test.ts
  • forge-web/lib/view/blame.ts
  • forge-web/lib/view/path-history.ts
  • forge-web/lib/view/xdiff.test.ts
  • forge-web/lib/view/xdiff.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.

…not match

The shell header renders the repo's tabs (/repo/issues, /repo…) while the page resolves, so a bare href*=/repo/issue or /repo prefix matched a tab and rb-1a counted before any read went out. Match issue links (/repo/issue/?…number=) and a tag's commit or release link instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@PastaPastaPasta
PastaPastaPasta merged commit 4c86c2a into master Sep 29, 2026
6 checks passed
PastaPastaPasta added a commit that referenced this pull request Sep 29, 2026
…-line owner, tab fades)

After rebasing on the repo shell header (#151): while the SDK loads, owner/name is the page's h1 and truncates on a phone, the owner label comes from the shared ownerLabel, and the tabs use the shared TabStrip. The rail's mirror provenance uses the byline Time element.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
PastaPastaPasta added a commit that referenced this pull request Sep 29, 2026
…-line owner, tab fades)

After rebasing on the repo shell header (#151): while the SDK loads, owner/name is the page's h1 and truncates on a phone, the owner label comes from the shared ownerLabel, and the tabs use the shared TabStrip. The rail's mirror provenance uses the byline Time element.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
PastaPastaPasta added a commit that referenced this pull request Sep 29, 2026
…-line owner, tab fades)

After rebasing on the repo shell header (#151): while the SDK loads, owner/name is the page's h1 and truncates on a phone, the owner label comes from the shared ownerLabel, and the tabs use the shared TabStrip. The rail's mirror provenance uses the byline Time element.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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