-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
Appearance settings for compact posts #440
Conversation
elpendor
commented
Jul 15, 2023
- Thumbnail position (either left or right)
- Voting buttons visibility (toggles visibility for upvote/downvote buttons)
I think you should rename the show voting buttons "never" variant. It's not really never, it's not in compact mode. Also you don't need to make a new PR with your changes, just push a new commit to your branch and this will update. |
@rsammelson Which name do you propose instead? |
I'm not sure, maybe "not compact", others have proposed turning off the vote buttons completely in the future, which would then make sense as "never" |
Yeah that fixes the problem; at that point you could also make them booleans instead of making more types. |
I did it that way because that's how other booleans were handled (see OCommentThreadCollapse). I didn't want to break the existing pattern and figured there might be a reason for it. |
Done. I left CompactThumbnailPositionType as a type though. Even if it's just two values, it does not really represent a boolean and would require pointless refactoring for it to be easily readable. |
Sorry for the conflicts - settings stuff is in flux! |
No problem, it's understandable. I just fixed the conflicts and merged the new commits. Also moved CompactSettings to the new AppearanceSettings. |
@burakcan if you have a moment can you look at this, specifically 426634f? I'm having a problem where we add a new setting to I guess we could add add migration logic to upgrade to a new version of the DB when a new setting is added, but that doesn't really seem sustainable and then there's duplicated logic. (There's also duplicated initial settings in the redux store initial values..) I'm wondering if we should just have getSetting return undefined if it doesn't exist? And then just don't insert defaults into the database initially? That would also ensure we have a single source of truth for defaults: The Redux store. Again please take a look at 426634f where I did this and let me know your thoughts. (And @elpendor you as well!) edit: Oh and @rsammelson! |
(Due to no feedback yet, I'm going to go ahead and merge this as-is. Please open another PR or issue to discuss further!) |
I just got a chance to look, it looks pretty much good to me. I, at least, like this approach better. |
Sorry, I'm out of town right now and couldn't check the code. I agree, for now this seems like a better approach. Haven't read the code entirely but if my PR needs to be adapted to this new pattern, I'll fix it when I get back. |
Hi sorry I'm also out of town so couldn't check yet. I'll try to take a look this week. Edit: quickly took a look on mobile. I agree this makes more sense. My bad on the design of defaults. |