Skip to content

fix: version tags toggling every supported version and freezing the page - #6967

Open
LarpinWBD wants to merge 1 commit into
modrinth:mainfrom
LarpinWBD:fix/version-tag-toggle
Open

fix: version tags toggling every supported version and freezing the page#6967
LarpinWBD wants to merge 1 commit into
modrinth:mainfrom
LarpinWBD:fix/version-tag-toggle

Conversation

@LarpinWBD

Copy link
Copy Markdown

Fixes #6601

Clicking any game version tag on the versions tab passed the whole game_versions array of the release to toggleFilters, so clicking 26.x (or even a single version tag) selected every version the release supports. On projects supporting a lot of versions this also froze the page for a few seconds, since toggleFilters awaited a needlessly async toggleFilter per version, which let Vue do a full re-render between every iteration (~90 renders on the project from the issue).

Changes:

  • the grouping in formatVersionsForDisplay now also returns which versions each displayed range represents (getVersionGroupsForDisplay), so tags toggle exactly the versions they show. Display output is unchanged, the other callers still get the same labels
  • toggleFilters applies the whole batch synchronously in one update, and selects the missing versions unless all of them are already selected, instead of blindly inverting each one (clicking a half selected range now completes it rather than inverting it, happy to change that if you want different semantics)

Tested the grouping refactor against the old implementation on a bunch of version list shapes (full ranges, partial ranges, snapshots, legacy versions) and the labels come out identical.

Fixes modrinth#6601.

Clicking any game version tag on the versions tab passed the release's
entire game_versions array to toggleFilters, so clicking 26.x (or even a
single version tag) selected every version the release supports. On
projects supporting many versions this also froze the page for seconds:
toggleFilters awaited a needlessly-async toggleFilter per version, which
let Vue flush a full re-render between every iteration (~90 flushes on
the reported project).

- formatVersionsForDisplay's grouping now also returns the member
  versions per displayed range (getVersionGroupsForDisplay), so version
  tags toggle exactly the versions they represent
- toggleFilters applies the whole batch synchronously in one update, and
  selects the missing versions unless all are already selected (instead
  of blindly inverting each one)

Co-Authored-By: Claude <noreply@anthropic.com>
@modrinth-bot

Copy link
Copy Markdown
Member

Pull request changelog

App

Added

Changed

Deprecated

Removed

Fixed

Security

Website

Added

Changed

Deprecated

Removed

Fixed

Security

Hosting

Added

Changed

Deprecated

Removed

Fixed

Security

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Website freezes for several seconds when clicking a version range (i.e. 26.x) and sets wrong filters

2 participants