Fix popular tag counts to reflect selected filters (Fixes #4917)Fix popular tag counts to reflect selected filters (Fixes #4917)Patch 2 #5340
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes an issue where popular tag counts would not update correctly when filters were applied to the project list. Previously, the popular tags always showed frequencies based on all projects, even when filters were active.
Changes Made
1. Updated
projectsService.jsgetPopularTagsfunction to accept an optionalfilteredProjectsparameterfilteredProjectsis provided, the function now recalculates tag frequencies based only on the filtered projects2. Updated
main.jsrenderProjectsfunction to get the filtered projects firstgetPopularTagsto pass the current filtered projectsResult
Now when users apply filters (by name, tags, labels, or date), the popular tags section correctly shows tag frequencies only for the projects that match the applied filters, providing a more accurate and useful user experience.
Fixes #4917