Skip to content

Add button to delete current branch on /tree/ #8617

Closed

Description

@fregante

Description

  1. You visit a repo's branches list
  2. Open a branch to see what's inside
  3. Want to delete it because it's useless

How long does it take to go back to the list and locate it without mistakes?

Example URLs

https://github.com/refined-github/refined-github/tree/test/bun

Image

Activity

  1. kidonng commented on Sep 4, 2025

    @kidonng
    Member

    This could be implemented in a similar fashion to quick-repo-deletion:

    1. Get current branch
    2. Add a button which links to /branches/all?query=<branch>#rgh-delete-branch
    3. Check for hash and auto click the delete button (or no automation)
  2. francopetruu commented on Jan 31, 2026

    @francopetruu
  3. fregante commented on Apr 23, 2026

    @fregante
    MemberAuthor

    The hard part here is actually deciding how to tell the user what happened. The button on /branches has little to no visual feedback.

    An API call + showToast + clearing the page (like for quick-repo-deletion) is the most straightforward for this, except we lose the ability to undo the deletion.

    Redirecting the user to /branches would mean either visually inviting the user to click a 24x24 button or informing that the action has been completed.

  4. fregante commented on Jul 15, 2026

    @fregante
    MemberAuthor

    Found an easy way:

    1. API request
    2. redirect to https://github.com/refined-github/refined-github/activity?activity_type=branch_deletion

    Existing example:

    await showToast(async () => {
    blameUrl.branch = await getPullRequestBlameCommit(prCommit, prNumbers, blameUrl.filePath);
    blameUrl.hash = 'L' + $('.react-line-number', blameHunk).textContent;
    location.assign(blameUrl.href);
    }, {
    message: 'Fetching pull request',
    doneMessage: 'Redirecting',
    });

  5. added
    small
    on Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedenhancementsmall

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions