Skip to content

quick-label-removal is not showing on issues #8226

Open

Description

@Brend-Smits

Description

It seems that the quick-label-removal feature broke. I have a private repository in a private GitHub.com organization.

image

As you can see the 'gear icon' is there, so I do have permission to manage labels here, but the 'remove' icon that quick-label-remove is suppose to arrive is missing.
Inspecting the css classes, I can see that the css class is: octicon octicon-gear, while in the codebase we seem to be looking for .label-select-menu .octicon-gear.

The weird thing is that on my open source repository here: Brend-Smits/Brend-Smits#2 it is working just fine. The css selectors are also different. I think this was working due to caching.

CSS Selectors open source repo:
https://gist.github.com/Brend-Smits/ab991dcab0e45c1f5f8dcbfaae0a7487

CSS Selectors private repo in an enterprise org:
https://gist.github.com/Brend-Smits/969762b0508d56a2900be1bb7b107210

How to replicate the issue + URL

Example repo: Brend-Smits/Brend-Smits#2

Extension version

24.12.20

Browser(s) used

Microsoft Edge Version 131.0.2903.147 (Official build) (arm64)

Token ⚠️

  • I set a token in the options page. I understand that some features require a token to work.

Activity

  1. fregante commented on Jan 16, 2025

    @fregante
    Member
  2. Brend-Smits commented on Jan 16, 2025

    @Brend-Smits
    Author

    Due to:

    Ah got it! I searched through that issue searching for 'quick-label-removal' and found no matches, hence I decided to open an issue ^^ Sorry about that!

    Anything that I can help with to perhaps help fix this problem?

  3. fregante commented on Jan 16, 2025

    @fregante
    Member
  4. Brend-Smits commented on Jan 17, 2025

    @Brend-Smits
    Author

    hey @fregante,

    I looked into this yesterday evening but it seems that it's quite a challenge to get the proper labels by html element or css class.
    Previously they had a class name such as 'issue-label' or 'label-list', but no more of that.
    All the class names now look automatically generated (example):

    TokenBase__StyledTokenBase-sc-47c3884c-0 eeZJmp rgh-seen--4692655537 d-inline-flex

    or

    Box-sc-g0xbh4-0 gOJubP prc-Link-Link-85e08 rgh-seen--16806542854

    What I current have...
    First I check if I can edit the labels:

    function canEditLabels(): boolean {
    	return elementExists('.octicon-gear');
    }

    Next, I can get the overall div where the labels are located by looking for (this is also not perfect..):

    function getLabelList(): HTMLElement {
    	return $('div[data-testid="issue-labels"] a[data-muted="true"]');
    }

    However, the removeLabelList is where I get stuck. I can't get the closest object. I assume here I need to get a name of the label..

    function removeLabelList(): void {
    	const list = getLabelList();
    	list.closest('details')!.addEventListener('toggle', restoreLabelList, {once: true});
    	list.replaceChildren();
    }

    I will have another look tonight, but if you have any pointers on how you would handle these auto generated classes to create a reliable solution, please let me know.
    Also fair disclaimer, I'm not a JS developer, so please let me know if you have tips..

  5. fregante commented on Jan 17, 2025

    @fregante
    Member

    We'll have to use .textContent

  6. Brend-Smits commented on Jan 17, 2025

    @Brend-Smits
    Author

    We'll have to use .textContent

    Awesome, I will have another look tonight and let you know.

  7. Brend-Smits commented on Jan 18, 2025

    @Brend-Smits
    Author

    I've gotten it to work for the new beta version. However, I then found out this has to be backwards compatible.. because the pull request page uses still an old layout and not everyone uses the new layout yet.

    This is another challenge I have yet to solve.

  8. changed the title [-]`quick-label-removal` is not showing, even though I have permission[/-] [+]`quick-label-removal` is not showing on new issue beta [/+] on Jan 18, 2025
  9. SunsetTechuila commented on Jul 8, 2025

    @SunsetTechuila
    Contributor

    @fregante the old ui was completely removed for non-enterprise users, right?

  10. fregante commented on Jul 8, 2025

    @fregante
    Member

    It's still used on PRs

    Adding support while keeping the old version should not be more difficult: just add one more observer and one more handler for that observer. Once the old view is finally removed, we'll just delete the old code.

  11. SunsetTechuila commented on Jul 8, 2025

    @SunsetTechuila
    Contributor

    just needed some reference to better understand what the code from #7397 does

  12. fregante commented on Jul 8, 2025

    @fregante
    Member

    Here's what's happening in that PR:

    • removing the labels sends HTTP requests and then manually hides the dom elements
    • the dropdown contains a form with the state of the labels (which ones are enabled and which aren't)
    • that form is not updated during the removal, so if you use it, it will restore what you just removed

    That PR removes that form so that GitHub reloads a fresh version of it.

  13. SunsetTechuila commented on Jul 8, 2025

    @SunsetTechuila
    Contributor

    It's still used on PRs

    and the feature is broken on PR pages too: the label list becomes empty if you try to open it immediately after removing a label

    Image Image
  14. 10 remaining items

  15. SunsetTechuila commented on May 25, 2026

    @SunsetTechuila
  16. SunsetTechuila commented on May 25, 2026

    @SunsetTechuila
    Contributor

    While checking the code, I noticed that this feature is being implemented by GitHub (behind the issues_react_remove_labels_oneclick flag):

    Image
  17. changed the title [-]`quick-label-removal` is not showing on new issue beta [/-] [+]`quick-label-removal` is not showing on issues[/+] on May 25, 2026
  18. fregante commented on May 25, 2026

    @fregante
    Member

    this doesn't really help because updating takes 2-3 seconds, which is too slow

    That's fast enough for me, particularly because the modal updates even after being open and interacted with. In my earlier tests it was fast enough to barely even require using label.hidden = true on the clicked label.

    Image
  19. igorsantos07 commented on Nov 26, 2026

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions