Skip to content

feat(gitlab-commit-nav): add x/c commit navigation userscript#1

Merged
solcik merged 1 commit into
mainfrom
feat/gitlab-commit-nav
May 31, 2026
Merged

feat(gitlab-commit-nav): add x/c commit navigation userscript#1
solcik merged 1 commit into
mainfrom
feat/gitlab-commit-nav

Conversation

@davidsolc-ai

Copy link
Copy Markdown
Collaborator

Restores the previous/next commit keyboard shortcuts (x / c) on the GitLab MR single-commit diff view.

GitLab's built-in x/c bindings are broken on versions < 17.10 (gitlab-org/gitlab#499143) — our git.vs-point.cz is on 17.5.5. The Prev/Next <a href> buttons GitLab renders in .commit-nav-buttons still work, so this script binds x/c via Mousetrap and clicks the matching link.

Link resolution is layered for version tolerance: aria-keyshortcutsaria-label → chevron icon data-testid. No-ops outside single-commit view, at boundary commits, or on disabled links.

Becomes redundant once the instance upgrades past 17.10 (native shortcut returns).

  • Same @match/@require/@grant none conventions as the existing scripts
  • Added README table row

Restores the previous/next commit shortcuts (x and c) on the GitLab MR
single-commit diff view, which are broken on GitLab < 17.10
(gitlab-org/gitlab#499143). The Prev/Next <a> buttons GitLab renders
still work, so the script binds x/c via Mousetrap and clicks the matching
.commit-nav-buttons link (resolved by aria-keyshortcuts, with aria-label
and chevron-icon fallbacks).
@davidsolc-ai davidsolc-ai force-pushed the feat/gitlab-commit-nav branch from c02380c to eb7df28 Compare May 31, 2026 19:55
@solcik solcik merged commit 165c596 into main May 31, 2026
2 checks passed
@solcik solcik deleted the feat/gitlab-commit-nav branch May 31, 2026 19:59
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.

2 participants