Skip to content
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

feat(user): persist the hide completed sets checkbox #1521

Merged

Conversation

wescopeland
Copy link
Member

@wescopeland wescopeland commented Apr 26, 2023

This PR enhances the "Hide completed sets" checkbox to enable cookie-driven persistence.

Summary of changes:

  • "Hide completed sets" has been relabeled to "Hide completed games"
  • Upon checking or unchecking the checkbox, a cookie is given a "true" or "false" value.
  • This cookie is inspected upon page load, and if set to "true", completed games are given the hidden Tailwind class.
  • Some imports and linting rules have slightly been adjusted to take advantage of the @/ import path defined in the tsconfig. This also was conflicting with a linting rule which did not understand tsconfig baseUrl and paths values. This has been remediated by adding eslint-import-resolver-typescript to the eslint import resolver settings.
  • toggleUserCompletedSetsVisibility() is no longer being lazy-loaded. It is small enough that lazy loading it hurts performance more than helps it. As a result, I have moved it out of the dynamic folder and into the utils folder.

ref: https://discord.com/channels/310192285306454017/1100897119709179915

This also resolves an issue where some browsers automatically set the checkbox on previous/next navigations, but the checkbox doesn't do anything. That issue should go away as a result of the changes in this PR.

@Jamiras Jamiras merged commit 7388b11 into RetroAchievements:master Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants