Skip to content

Toggle reviewed files with Space - #1

Merged
bdice merged 2 commits into
mainfrom
agent/toggle-files-with-space
Aug 17, 2026
Merged

Toggle reviewed files with Space#1
bdice merged 2 commits into
mainfrom
agent/toggle-files-with-space

Conversation

@bdice

@bdice bdice commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

Note: Because this PR changes the core keybinding from Escape to Space, it is not intended for upstream submission.

  • support both the redesigned and classic GitHub Files changed interfaces
  • use Space to toggle the hovered file's Viewed state
  • collapse viewed files and advance the next rendered file to the top of the visible diff region
  • expand viewed files and keep the restored file at the top of the visible diff region
  • preserve normal Space behavior while typing in comments and form fields
  • measure GitHub's sticky header dynamically to avoid scrolling file headers underneath it
  • point userscript updates and documentation at this customized fork

Why

The original userscript relies on DOM selectors from GitHub's older review interface and an Escape handler that no longer works reliably. GitHub's redesigned interface exposes different file containers and accessible toggle state. This fork also uses a workflow optimized for reviewing many small files in sequence.

User impact

Hovering a diff and pressing Space now provides a reversible review workflow: mark and advance, or restore and refocus. The shortcut does not intercept spaces typed into editable controls.

Validation

  • node --check main.js
  • git diff --check

Comment thread README.md Outdated
@bdice
bdice marked this pull request as ready for review August 17, 2026 23:04
@bdice
bdice merged commit 6312a9a into main Aug 17, 2026
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