Skip to content

add: View Branch on GitHub Context Menu Item#21251

Merged
niik merged 6 commits intodesktop:developmentfrom
DylanDevelops:ravel/view-branch-context-menu-item
Nov 28, 2025
Merged

add: View Branch on GitHub Context Menu Item#21251
niik merged 6 commits intodesktop:developmentfrom
DylanDevelops:ravel/view-branch-context-menu-item

Conversation

@DylanDevelops
Copy link
Contributor

Closes #21071

Description

I added the ability to open the branch on GitHub if it exists on the remote. I accomplished this by crafting a URL with parameters retrieved from the repository. This was the solution I came up with to craft this URL; however, if you know of a better way, let me know!

Additionally, I conditionally render the context menu based on whether the remote name variable exists. I'm not sure if this is the best way to do this, either, but it seems to work. Please let me know if there is an easier variable I can check.

Screenshots

Main Branch:
Screenshot 2025-11-13 at 2 07 39 PM

Branch w/ Pull Request:
Screenshot 2025-11-13 at 2 07 51 PM

Local Branch:
Screenshot 2025-11-13 at 2 08 04 PM

Release notes

Notes: [add] "View Branch on GitHub" option on branch list context menu

Introduces a new context menu item allowing users to view the current branch on GitHub if an upstream remote is set. Implements the handler in BranchDropdown and updates the context menu item generation logic.
Renamed onViewBranchOnGithub to onViewBranchOnGitHub for consistency and to fix a typo in the branch dropdown component.
Simplified variable usage in onViewBranchOnGitHub by directly accessing props and removing redundant assignments.
@github-actions github-actions bot added external Pull request originating outside of the Desktop core team triage For incoming issues labels Nov 13, 2025
Copy link
Member

@niik niik left a comment

Choose a reason for hiding this comment

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

Thanks @DylanDevelops! Left two suggestions but happy to bring this in once that's resolved

DylanDevelops and others added 3 commits November 27, 2025 08:43
Co-authored-by: Markus Olsson <j.markus.olsson@gmail.com>
Co-authored-by: Markus Olsson <j.markus.olsson@gmail.com>
Removed redundant assignment of the 'url' variable in the BranchDropdown component to ensure only the correct URL is used when opening a branch in the browser.
@DylanDevelops
Copy link
Contributor Author

@niik I implemented your suggested changes and fixed up the small formatting issues. When I tested, everything seemed to work great! Let me know if this looks good or if there is anything else I should do.

@DylanDevelops DylanDevelops requested a review from niik November 27, 2025 17:25
Copy link
Member

@niik niik left a comment

Choose a reason for hiding this comment

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

Love it, thanks a bunch @DylanDevelops

@niik niik merged commit 46e9923 into desktop:development Nov 28, 2025
7 checks passed
@DylanDevelops DylanDevelops deleted the ravel/view-branch-context-menu-item branch November 28, 2025 15:37
@DylanDevelops
Copy link
Contributor Author

Thank you, @niik!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external Pull request originating outside of the Desktop core team triage For incoming issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "View Branch on GitHub" to Branch Context Menu

2 participants