您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Make GitHub's PR sidebar actually usable - resizable, with tooltips and optional horizontal scrolling. Settings are persistent and configurable via a button on the toolbar.
🎚️ Slidebar — GitHub PR Sidebar Enhancer
⚠️ IMPORTANT: GitHub partially fixed this!
As of August 2025, GitHub's "Files Changed" experience update is in preview and includes:
✓ Resizable sidebar
✓ Full file names on hover
✗ No horizontal scrolling (still optional with Slidebar)
If horizontal scrolling is a must-have for you, Slidebar is still here. Otherwise, consider uninstalling to reduce bloat. No hard feelings.
Even though I used this userscript privately and only shared it after GitHub's update, I'm gonna go ahead and take credit for inspiring them to fix their jank. You're welcome, internet.
Read more: GitHub Community Discussion →
Finally, a PR sidebar that doesn't make you want to throw your mouse.Resize it. See full file names. Scroll when needed. You know, basic stuff GitHub forgot (update: they remembered! see above 👆).✨ What you get
- 📐 Resizable sidebar — Drag the edge to your heart's content (200-600px range)
- 💬 Smart tooltips — Hover truncated file names to see the full path
- ↔️ Horizontal scrolling — Optional side-scroll for those
really/deeply/nested/component/files/Button.tsx
names- 💾 Persistent settings — Your width preference survives refreshes
- 🎯 Zero-jank — Handles GitHub's SPA navigation cleanly
🚀 Why Slidebar beats squinting
Problem GitHub's Take Slidebar's Fix Long file names src/compon...tsx
🤦Full names on hover or scroll Sidebar too narrow Deal with itFixed!Drag to resize (persisted!) Deep folder structures Good luckMostly fixedMake it wider, see everything Horizontal scroll Still nope Slidebar's got you 📦 Installation & Usage
Getting started
- Install the userscript (you're already here!)
- Navigate to any GitHub PR, pull request list, or compare page
- Hover between the sidebar and content area to reveal the draggable edge
- Look for the Slidebar icon in the toolbar to access settings
- Drag the sidebar edge to resize (if enabled)
⚙️ Configuration
Click the Slidebar icon in the toolbar to open the settings modal:
🔧 Options– Enable Sidebar Resizing — Adds a draggable edge
– Show Tooltips — Display full paths on hover
– Horizontal Scrolling — Side-scroll instead of truncation
– Sidebar Width — Manual input (200-600px)🎨 Features in Detail
- Smart resize handle — Appears on hover, subtle blue when dragging
- GitHub-native UI — Uses GitHub's own CSS variables for perfect theme matching
- SPA-aware — Handles navigation without breaking or duplicating
- Memory efficient — Cleans up observers and listeners properly
- Retry logic — Gracefully handles slow page loads (max 10 attempts)
- Width constraints — Sensible min/max to prevent breaking layouts
🔒 Privacy & Permissions
Zero tracking, pure local enhancement
No analytics. No network calls. No external resources. Everything runs locally.
Permissions explained:
GM_setValue
/GM_getValue
— Store your preferences locallyGM_addStyle
— Inject the UI stylesThat's it. No sketchy grants, no unsafeWindow, no external dependencies.
💡 Pro Tips
- Optimal width: Most find 350-400px hits the sweet spot for file names vs. diff space
- Performance: Horizontal scrolling can feel sluggish on massive PRs - tooltips might be better
- GitHub's new preview: If you're in the preview, you might only need this for horizontal scrolling
- Reset: Delete stored config via your userscript manager to reset defaults
📋 Compatibility
- Sites:
github.com/*/pull/*
,github.com/*/pulls/*
,github.com/*/compare/*
- Browsers: Chrome, Edge, Firefox, Safari, Opera, Maxthon (all the browsers I know of with userscript managers)
🐛 Known Issues
- GitHub updates: Their new preview might conflict - disable one or the other
- Large PRs: 1000+ files might see slight lag with horizontal scrolling enabled
- Narrow screens: Minimum 200px width might still be too wide for some layouts
🧾 Changelog
1.0.0
- Complete rewrite for stability and performance
- Fixed critical style assignment bug
- Added proper SPA navigation handling
- Improved memory management (cleanup observers/listeners)
- Better error handling with retry limits
- Consistent UI using GitHub's CSS variables
- Proper cleanup on navigation
0.3.0
- Initial release with basic features
- Config modal, resize, tooltips, horizontal scroll
Slidebar — Because GitHub has better things to do.
Trunc' popped by AstroMash