Skip to content

Improve support for branches with slashes - #10333

Merged
fregante merged 5 commits into
mainfrom
claude/slash-branches
Nov 3, 2026
Merged

fregante merged 5 commits into
mainfrom
claude/slash-branches

Conversation

@fregante

@fregante fregante commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Created by Claude, will be reviewed by @fregante first.

getCurrentGitRef returned only the first path segment (branch) on slashed branches because the branch picker no longer has a title, so extractCurrentBranchFromBranchPicker returned an empty string and the lookup fell through to the URL. It now reads the picker text, which always holds the full name. list-prs-for-branch also now inserts its button after the default-branch-button group instead of inside it.

Test URLs

https://github.com/refined-github/sandbox/commits/branch/with/slashes
https://github.com/refined-github/sandbox/tree/branch/with/slashes
https://github.com/refined-github/sandbox/commits/main
Long name https://github.com/refined-github/sandbox/commits/very-very-long-long-long-long-branch-name
Long and slashed https://github.com/refined-github/sandbox/commits/copilot/create-empty-file-linkify-pr-review-state

Checked

Chromium, logged out, on the server-rendered markup of the three URLs above: main returned branch, branch, main; this branch returns branch/with/slashes, branch/with/slashes, main. On the two long-name URLs (41 and 49 characters) the picker still has no title, anywhere inside it, and its text is the full name; the clipping is CSS only. The result is the full name there too. On the repo root the picker text is the default branch name, which getDefaultBranch also relies on.

Not checked (reviewer tasks)

@fregante

fregante commented Nov 1, 2026

Copy link
Copy Markdown
Member Author

Forgot to fix #10332 (comment):

On the commits page it's sometimes being added inside the button group created by default-branch-button. It should not be inside.

Screenshot

@fregante fregante left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The button also works

Image

@fregante fregante changed the title getCurrentGitRef - Read the branch from the picker text Improve support for branches with slashes Nov 1, 2026
@fregante fregante added the bug label Nov 1, 2026
@fregante
fregante marked this pull request as ready for review November 1, 2026 10:58
@fregante
fregante enabled auto-merge (squash) November 3, 2026 08:24
@fregante
fregante merged commit af38f09 into main Nov 3, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant