Skip to content

feat(web): side-by-side diff, and a conclusion that names its commit - #26

Merged
springfall2008 merged 6 commits into
mainfrom
feat/diff-split
Nov 27, 2026
Merged

springfall2008 merged 6 commits into
mainfrom
feat/diff-split

Conversation

@springfall2008

Copy link
Copy Markdown
Owner

What

Side-by-side diff. The drawer's Diff tab now reads like GitHub's "Files changed" split view:

  • The commit message (or the commit list) at the top, then "N files changed, +a −d".
  • One card per file. The header shows the path (old → new for a rename), a badge for new, deleted, renamed or binary files, and +/− counts. Headers stay pinned and fold on click.
  • Old lines on the left and new on the right, with line numbers. Removed rows are red, added rows green, the changed part of a pair is highlighted, and hunk headers are separator rows.
  • Context of 3, 10 (the default) or the whole file: /diff takes context=3|10|all, and anything else is 400 before git runs.
  • "Full width" widens the drawer across the page.
  • Cards open within a 3,000-row budget (and a file over 400 rows starts folded), so a whole-file diff of many files stays responsive.
  • The last file is marked cut short whenever the server cut the text at 2 MiB.
  • git's C-quoted paths (non-ASCII, quotes, backslashes) show unquoted.
  • The patch is parsed in the browser by a pure web/public/diffparse.js.

A conclusion names its commit. The skill's conclusion template gains Commit: <sha> on <branch>, copied from the fact that proves the goal. In the drawer, a conclusion's Diff tab opens on "All changes vs main", the whole winning branch. The predbat-memory conclusion was backfilled with that line in shared memory.

Design: docs/superpowers/specs/2026-11-27-diff-split-design.md; plan: docs/superpowers/plans/2026-11-27-diff-split.md.

Tests

  • deno task check and 341 unit tests pass.
  • Parser tests cover pairing, line numbers, new, deleted, renamed and binary files, cut-short text, quoted paths, wordParts and the row budget.
  • parsePatch on a real 29-file branch diff matches git diff --shortstat exactly. Real quoted-path output also parses correctly.
  • The reviewer additionally ran the parser on committed .patch files, header-like content lines and cuts at every byte offset. Nothing threw.
  • Not viewed in a browser by the author; checked by hand on a local server.

Deferred minors

  • A trailing tab is kept on paths with spaces.
  • A cut that ends on a newline can add an empty row.
  • A merge commit's combined diff shows as text with "No file changes".
  • Full width and the drag handle conflict.
  • An emoji can be split in a changed-word highlight.
  • A new or deleted binary file is labelled only "binary".
  • \ No newline is not shown.
  • The diff toolbar does not wrap at the narrowest drawer.
  • No tests yet for header-like content lines, quoted paths in ---/+++, or a cut between hunks.
  • A workspace's diff prefix config is not overridden.

After merge

Restart deno task web from the new main. No hosted change.

🤖 Generated with Claude Code

springfall2008 and others added 6 commits November 27, 2026 09:51
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A conclusion opens on all changes vs main. The predbat-memory conclusion
was backfilled with its Commit: line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- cards open within a 3,000-row budget, so a whole-file diff of many files
  stays responsive
- the last file is marked incomplete whenever the server cut the text
- git's C-quoted paths (non-ASCII, quotes, backslashes) show unquoted

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@springfall2008
springfall2008 merged commit c59e360 into main Nov 27, 2026
2 checks passed
@springfall2008
springfall2008 deleted the feat/diff-split branch November 27, 2026 11:24
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