Live GitHub PR demo + shared diff-viewer core#19
Merged
Conversation
Extract the diff-viewer engine and chrome (StatusBar, FileList, FileTreeBody,
FileDiffHeader, sidebar + the shadcn primitives they use) into a new
@diffhub/diff-core workspace package, consumed verbatim by both apps/cli and the
new diffhub.blode.co live demo at /{owner}/{repo}/pull/{number}.
The demo fetches a PR's diff from GitHub server-side (cache-only, no token) and
streams it into the exact CLI viewer. Git-only StatusBar controls (branch/watch/
comments/diff-mode) are now optional props; the demo shows base <- head branch
badges and an Auto/Light/Dark theme toggle, scoped dark by default.
- Tailwind @source so the package's utility classes are generated in both apps
- Palette scoped at <html> so base-ui portaled popups (dropdowns) match the theme
- Invisible opacity nudge works around a Chrome compositing skip on CodeView's
shadow-DOM grid (renders blank until a repaint is forced)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extract the CodeView paint nudge into a shared useCodeViewPaintNudge hook used by both the CLI DiffViewer and the web ReadOnlyDiffView. On first mount Chrome can skip compositing CodeView's freshly-rendered shadow-DOM grid, leaving the diff blank (line backgrounds only, no code) until the user scrolls; the hook flicks the scroll container's opacity to 0.999 and back to force a repaint with no visible change. Move @diffhub/diff-core to devDependencies in apps/cli: it's a build-time workspace package inlined into the standalone output via transpilePackages, not a runtime dependency, so the published (private, unpublished) package must not appear in the cli's runtime dependencies. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a live PR viewer to diffhub.blode.co (
/{owner}/{repo}/pull/{number}) that renders any public GitHub PR in the exact CLI viewer, and extracts the diff engine + chrome (StatusBar, FileList, FileDiffHeader, sidebar) into a shared@diffhub/diff-corepackage consumed by both apps.Also fixes a CodeView paint quirk where the diff could render blank (line backgrounds only) until you scroll, via a shared
useCodeViewPaintNudgehook used by both viewers.@diffhub/diff-coreis a build-time dev dependency of the CLI (inlined into the standalone output), so the published package stays self-contained.🤖 Generated with Claude Code