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

Account Based Preferences #191

Open
ShreyanKhanna opened this issue Oct 26, 2022 Discussed in #190 · 7 comments
Open

Account Based Preferences #191

ShreyanKhanna opened this issue Oct 26, 2022 Discussed in #190 · 7 comments
Labels
dark mode enhancement New feature or request indexed db Edits to the IDB (or localstorage) for Vocabustudy page : account Account OR login page : home Homepage page : set detail Set detail overview
Milestone

Comments

@ShreyanKhanna
Copy link

ShreyanKhanna commented Oct 26, 2022

Discussed in https://github.com/orgs/For-0/discussions/190

Originally posted by ShreyanKhanna October 25, 2022
I think it would be a good idea to make it so that the user can change how the Vocabustudy page looks for them such as colors, backgrounds, and patterns(of course we can keep things like the homepage the same) as well as control how many drag & drops, questions, etc. they want. I think that we can have this whole thing in the setting as well as move the light/dark mode there as well. I know it may be too early but just putting it out there for the future.

@ShreyanKhanna ShreyanKhanna added the enhancement New feature or request label Oct 26, 2022
@grimsteel
Copy link
Member

Right now, all of these are stored in localstorage, but the question is: What do you do if someone changes their preferences, and then signs into an account that already has preferences? Which ones do we keep?

@grimsteel grimsteel added page : account Account OR login page : set editor Editor, creator, anything related to editing a set/collection labels Oct 26, 2022
@grimsteel grimsteel added this to the 2.0.0 milestone Oct 26, 2022
@grimsteel grimsteel added page : home Homepage page : set detail Set detail overview dark mode and removed page : set editor Editor, creator, anything related to editing a set/collection labels Oct 26, 2022
@ShreyanKhanna
Copy link
Author

you would put it as the one in the account
also don't let them change it without an account

@ShreyanKhanna
Copy link
Author

ShreyanKhanna commented Oct 26, 2022

as it would be in the account setting which you can't access without an account so they wouldn't be able to change it

@grimsteel
Copy link
Member

Ok
So I will save their preferences when not logged in, but those will always be overridden by account level settings

@grimsteel
Copy link
Member

grimsteel commented Dec 7, 2022

I might as well make a schema

users collection:

ID preferences: map
uid1 see below

Preferences schema:

{
  "hue": 0-360, // or also theme in the future?
  "study_modes": {
    "flashcards": {
      "answer_with": 0-1,
      "starred": true/false
    },
    "learn": {
      "answer_with": 0-1,
      "starred": true/false
    },
    "test": {
      "answer_with": 0-1,
      "starred": true/false,
      "types": 1001 // bitmask
    },
    "match": {
      "answer_with": 0-1,
      "starred": true/false
    }
  },
  "starred": {
    "set_id": [1, 3, 5] // TODO: Rn this is a list of numbers. It would be better to use a bitmask
  }
}

@grimsteel
Copy link
Member

All CRUD operations can only be done if document ID matches user ID

@ShreyanKhanna
Copy link
Author

Right makes sense

@IMGROOT2 IMGROOT2 changed the title Account based preferences Account Based Preferences, Local Storage Additions Dec 20, 2022
@IMGROOT2 IMGROOT2 changed the title Account Based Preferences, Local Storage Additions Account Based Preferences Dec 20, 2022
@IMGROOT2 IMGROOT2 added the indexed db Edits to the IDB (or localstorage) for Vocabustudy label Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dark mode enhancement New feature or request indexed db Edits to the IDB (or localstorage) for Vocabustudy page : account Account OR login page : home Homepage page : set detail Set detail overview
Projects
Status: Roadmap - Low Priority
Development

No branches or pull requests

3 participants