Linear View Diff is a Chrome extension that adds a View Diff button to Linear review pages. It finds the linked GitHub pull request, prefetches the PR data in the background, and opens an in-page overlay with a file tree and rendered diffs.
- Adds a Linear-styled
View Diffbutton next toView PRon Linear review pages. - Prefetches GitHub pull request metadata, changed files, and diff text when the Linear page loads.
- Renders changed files with
@pierre/treesand diffs with@pierre/diffs. - Optimized so that the diff viewer stays snappy even with huge changes.
- Supports private repositories through an optional GitHub token stored in Chrome sync storage.
- Handles binary or oversized files with a fallback message when GitHub does not provide a text patch.
- Node.js 24+
- npm
- Chrome or another Chromium browser that supports Manifest V3 extensions
Install dependencies:
npm installBuild the extension:
npm run buildType-check only:
npm run typecheckWatch option-page changes during development:
npm run dev- Run
npm run build. - Open
chrome://extensions. - Enable Developer mode.
- Click Load unpacked.
- Select the generated
distdirectory. - Open or refresh a Linear review page matching
https://linear.app/*/review/*.
Public pull requests can load without a token, subject to GitHub API rate limits.
For private repositories or higher rate limits:
- Create a fine-grained GitHub token.
- Grant read-only access to Pull requests and Contents for the target repositories.
- Open the extension options page.
- Paste and save the token.
- Refresh Linear.
src/content/: Linear content script, overlay UI, GitHub API integration.src/options/: Extension options page for storing a GitHub token.public/manifest.json: Manifest V3 definition copied intodistby Vite.scripts/build-content.mjs: esbuild content-script build with compatibility patches for Linear pages.dist/: Generated extension output loaded into Chrome or zipped for publishing.
- The content script runs on
https://linear.app/*/review/*. - The extension calls
https://api.github.com/*and follows GitHub API pagination for PR files. - Reload the unpacked extension after every build while developing locally.