Skip to content

feat(frontend): Store last selected game version and platform for download modal #3284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

denisJaved
Copy link

@denisJaved denisJaved commented Feb 21, 2025

Stores last user selected game version and platform (aka modloader) to retrive them before openning download modal.

Resolves #2332

PS: It's my first contribution to modrinth. I'm sorry if i did smth wrong

Stores selected game version and platform(modloader) in localStorage to retrive them when download modal openned
@denisJaved denisJaved changed the title Store last selected game version and platform for download modal feat(frontend): Store last selected game version and platform for download modal Feb 21, 2025
@denisJaved denisJaved force-pushed the remember-game-version-and-platform branch from 30a24fb to 9fdac5a Compare February 22, 2025 08:06
@IMB11 IMB11 added the enhancement New feature or request label May 29, 2025
@IMB11 IMB11 requested a review from Copilot May 29, 2025 13:22
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the download modal by persisting the last user-selected game version and platform using localStorage. Key changes include:

  • Replacing ButtonStyled blocks with Accordions for game version and platform selection.
  • Introducing helper functions (setSelectedGameVersion and setSelectedPlatform) to update both reactive refs and localStorage.
  • Loading persisted selections on the client when the page is loaded.
Comments suppressed due to low confidence (2)

apps/frontend/src/pages/[type]/[id].vue:328

  • Confirm that changing this condition from v-else-if to v-if does not inadvertently render the platform Accordion for resourcepack projects, potentially affecting the intended download flow.
v-if="project.project_type !== 'resourcepack'"

apps/frontend/src/pages/[type]/[id].vue:880

  • [nitpick] Ensure that using localStorage with the keys 'selected_game_version' and 'selected_platform' is consistent with the application standards, and consider any necessary type handling for stored values.
if (import.meta.client) {

@@ -1009,7 +979,18 @@ const licenseIdDisplay = computed(() => {
return id;
}
});

function setSelectedGameVersion(version) {
Copy link
Preview

Copilot AI May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding inline documentation for the new setSelectedGameVersion and setSelectedPlatform functions to clarify their role in persisting user selections.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend
Development

Successfully merging this pull request may close these issues.

The download modal should remember what was selected
3 participants