-
Notifications
You must be signed in to change notification settings - Fork 51
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
Persist some frontend preferences in localStorage #4559
Merged
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c92fd1d
Store some user preferences in local storage
carlobeltrame a73e508
Add self-healing print config mechanism
carlobeltrame 2350df1
Be careful to not mutate constant
carlobeltrame f466dc9
Fix setting preferences without previous storage
carlobeltrame 509a713
Persist paperSize preference per camp as well
carlobeltrame 1144263
Remove debug log statements
carlobeltrame c4fd5a3
Add print config reset button
carlobeltrame b94ad10
Split up storage into separate keys per setting
carlobeltrame 03f7629
Add tests for preference saving
carlobeltrame 51991ef
Lint
carlobeltrame 82f2a9c
Fix paper size display in responsive layout
carlobeltrame de71681
Use fancy operator
carlobeltrame e109324
Clean up test
carlobeltrame File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove this functionality? This prevents a layout jump when you toggle the displaySize, because it changes the responsiveLayout to be papersize before the animation takes place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to remove the previous local storage implementation, which was done in the composable useDisplaySize.js. When doing this, I overlooked the
nextTick
and local copy of the state in there. But I am mostly convinced it does not make any perceivable difference. If it does, can you tell me which one of these screencasts comes from dev (withnextTick
) and which one comes from my local instance (withoutnextTick
)?Blind Test A.webm
Blind Test B.webm
However, previously the paper size display of the responsive layout was broken in this PR. I fixed this now in 82f2a9c.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, shouldn't this be a computed and not a function in 82f2a9c?
Maybe this was required with the initial local value variant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the computed when I switched from the composition API paradigms back to the options API way for this feature.
What advantages do you expect from using a composition API computed here over a simple function like we do for the other provided values? I did try passing down the plain value, but that isn't reactive. The Vue 3 docs explicitly recommend using a computed for this case, but it seemed inconsistent with our other provides, and I didn't want to touch all other provides. But if you insist on using computed for just this one provide, I can change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind the implementation. I just hope that it won't break at random :D