Skip to content

Hide "Bugs" tab when issues are disabled. #10036

Closed

Description

@jannes-io

Description

In one of our repositories we closed all issues as "not planned", and then disabled the "issues" tab entirely. But this extension is still adding the "Bugs" tab despite when you click on it, it has 0 results.

Image Image

If the "Issues" tab is disabled (Repo "Settings" -> "Issues"), the "Bugs" tab should not be added at all.

Example URLs

.

Activity

  1. fregante commented on Sep 4, 2026

    @fregante
    Member

    Can you provide an example URL? The tab already shouldn't appear if the search results give zero results.

  2. jannes-io commented on Sep 4, 2026

    @jannes-io
    Author

    No, it's a private repository and I don't know of any repositories that have issues disabled off the top of my head.

  3. fregante commented on Sep 4, 2026

    @fregante
    Member

    Did you just now disable the issues?

  4. fregante commented on Sep 4, 2026

    @fregante
    Member

    This is a stale cache issue either in Refined GitHub or on GitHub. We rely on GitHub to tell us how many bugs are open. If the search returns 0, then the tab will not appear already.

    If the API returns a wrong number, then it's an API bug (unless our API call is somehow incorrect)

  5. jannes-io commented on Sep 4, 2026

    @jannes-io
    Author

    Negative, the issues tab has been disabled for months.

  6. jannes-io commented on Sep 4, 2026

    @jannes-io
    Author

    @fregante it's not about the issues though, the feature request is more regarding if the issues tab is disabled (in our case, has been for months), then there might still be issues that are open. But the bugs tab should be removed. No point in having a bugs tab if the issues tab is disabled anyway?

  7. fregante commented on Sep 4, 2026

    @fregante
    Member

    if the issues tab is disabled (in our case, has been for months), then there might still be issues that are open

    That's not what the second screenshot shows. If GitHub's own search returns zero results, the API should also return zero results and therefore the tab already shouldn't appear. The logic is already there.

    We need to check what API call is going through:

    1. options page -> debugging -> clear cache
    2. open developer tools
    3. visit that repo in the same tab with the dev tools open
    4. search "graphql" in the network tab
    5. let's see what the JSON response is

    For this repo, it looks like this:

    {
    	"data": {
    		"repository": {
    			"labels": {
    				"nodes": [
    					{
    						"name": "bug",
    						"issues": {
    							"totalCount": 33
    						}
    					},
    					{
    						"name": "github bug",
    						"issues": {
    							"totalCount": 5
    						}
    					},
    					{
    						"name": "oldest bug 🦖",
    						"issues": {
    							"totalCount": 3
    						}
    					}
    				]
    			},
    			"issues": {
    				"totalCount": 0
    			}
    		}
    	}
    }
  8. jannes-io commented on Sep 4, 2026

    @jannes-io
    Author

    I have been able to create a reproduction repository here: https://github.com/jannes-io/bugs-test

    To reproduce:

    1. Create a repo with issues enabled
    2. Create a issue and add the bug label
    3. Disable issues in the repo settings
    4. (optional) clear refined github cache

    Now the "Issues" tab is gone, "Bugs" tab is still there, when clicking it, it shows no issues.

    https://github.com/jannes-io/bugs-test

    {"data":{"repository":{"labels":{"nodes":[{"name":"bug","issues":{"totalCount":1}}]},"issues":{"totalCount":0}}}}

    Refined GitHub should also do a call to repo settings to see if issues tab is enabled at all. Seems like GitHub does something to return no issues when issue tab is disabled for their own search.

  9. fregante commented on Sep 4, 2026

    @fregante
    Member

    Thank you, in the meantime I also validated the issue here 😅

    https://github.com/bfred-it-org/no-issues/issues

    {
    	"data": {
    		"repository": {
    			"labels": {
    				"nodes": [
    					{
    						"name": "bug",
    						"issues": {
    							"totalCount": 1
    						}
    					}
    				]
    			},
    			"issues": {
    				"totalCount": 0
    			}
    		}
    	}
    }

    I can confirm that this is a GitHub issue, which you can also confirm by visiting the labels page:

    Image

    You might want to report it to GitHub, but we can also use Math.min() to ensure that the total number of bugs never exceeds the issue count.

    Will open a PR

  10. self-assigned this
    on Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions