Slidebar - GitHub PR Sidebar Enhancer

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.

安装此脚本
作者推荐脚本

您可能也喜欢CodePen.md - Copy as Markdown

安装此脚本
作者
AstroMash
日安装量
0
总安装量
0
评分
0 0 0
版本
1.0.0
创建于
2025-08-17
更新于
2025-08-17
大小
22.0 KB
许可证
MIT
适用于

🎚️ 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 it Fixed!  Drag to resize (persisted!)
Deep folder structures  Good luck Mostly fixed  Make it wider, see everything
Horizontal scroll  Still nope  Slidebar's got you


📦 Installation & Usage

Getting started

  1. Install the userscript (you're already here!)
  2. Navigate to any GitHub PR, pull request list, or compare page
  3. Hover between the sidebar and content area to reveal the draggable edge
  4. Look for the Slidebar icon in the toolbar to access settings
  5. 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 locally
  • GM_addStyle — Inject the UI styles

That'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