Skip to content

Add GitHub Primer syntax highlighting to Changes tab#691

Merged
selfcontained merged 4 commits into
mainfrom
agt_6c4fae21238a/agent-21238a
Jun 26, 2026
Merged

Add GitHub Primer syntax highlighting to Changes tab#691
selfcontained merged 4 commits into
mainfrom
agt_6c4fae21238a/agent-21238a

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Add syntax highlighting to the Changes tab diff viewer using exact GitHub Dark and Light Primer token colors, mapped from Refractor/Prism .token.* classes
  • Fix horizontal scroll losing diff line backgrounds by overriding table-layout: fixedauto on the diff table
  • Update gutter line numbers to use foreground color on add/delete lines (matching GitHub's behavior) and muted gray for context lines
  • Add collapsible file tree with show/hide toggle — the "Show" button lives in a non-scrolling toolbar strip so it stays visible during scroll
  • Introduce data-theme-mode="light"|"dark" attribute on <html> (set in both the pre-paint script and React) to replace brittle per-theme CSS selectors — new themes automatically get correct diff styling
  • Update design lab with a real sample diff from PR Extract routing hook and feedback subcomponents from agents-view #686

Test plan

  • Type check (pnpm run check) passes
  • Web finalization (pnpm run finalize:web) passes — clean build
  • E2E tests pass (126/127 — the one failure is pre-existing flaky terminal-drag-drop test)
  • Verified dark mode syntax colors match GitHub Dark in browser
  • Verified light mode syntax colors match GitHub Light in browser
  • Verified horizontal scroll preserves diff line backgrounds
  • Verified file tree collapse/expand toggle works both directions
  • Verified gutter line number colors match GitHub
  • Frontend UX review persona approved (all 4 findings across 2 rounds resolved)

🤖 Generated with Claude Code

selfcontained and others added 4 commits June 25, 2026 19:20
- Map Refractor/Prism token classes to exact GitHub Dark and Light colors
- Fix horizontal scroll losing diff line backgrounds (table-layout: auto)
- Update gutter line numbers to use foreground color on add/delete lines
- Add file tree collapse toggle with show/hide buttons
- Add data-theme-mode attribute for simplified light/dark CSS targeting
- Set data-theme-mode in pre-paint script to prevent FOUC
- Fix sticky show-file-tree button overlapping file headers
- Increase touch target size on file tree toggle buttons
- Update design lab with real sample diff from PR #686

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Render the "Show file tree" button in a fixed toolbar above the
scrollable diff area instead of inside it, so it remains visible
when the user scrolls through long diffs.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Remove hardcoded ignoreWhitespace: true from the diff route handlers.
The Changes tab now shows all changes including whitespace-only edits,
so users can trust it as a complete audit surface. The ignoreWhitespace
capability remains in agent-diff.ts for a future user-controlled toggle.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
User wants whitespace changes hidden by default in the diff viewer.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@selfcontained
selfcontained merged commit 7410bfa into main Jun 26, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_6c4fae21238a/agent-21238a branch June 26, 2026 02:01
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