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

Fix #1081: Remember that you clicked the X on the "noob" popup #1840

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nicolasbize
Copy link
Contributor

@nicolasbize nicolasbize commented Oct 12, 2019

This adds a new variable isNoobHeaderDismissed in the local storage to remember the fact that a guest has dismissed the noob panel in the Feed page. It addresses #1081 and #1488

bug-1081

Copy link
Contributor

@local-minimum local-minimum left a comment

Choose a reason for hiding this comment

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

It might be a bit problematic if we update the text with info that everyone should see at least once even if you are a veteran. So maybe have the dismiss be valid for X months so you see it once every event. Or have a const NOOB_TEXT_VERSION = 1 that Mike can change when updating the text if he wants everyone to see it. That is probably better. Maybe add a comment next to it explaining that effect.

constructor(props) {
super(props);
this.state = {
isNoobHeaderDisplayed: (!props.user || !props.user.id) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need these first two checks? If we have it in local storage then why bother with the logic about the user being logged in or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we remove the first two checks then the popup will be visible for the users that are logged in until they close it. Logged-in users do not see the popup today so this would bring a bit of regression.

Copy link
Contributor

Choose a reason for hiding this comment

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

True, though only until they dismiss it, then they'll never see it again. But it really doesn't matter so much, I'm just used to having cleaner render components (using react and redux) at work and I was hoping having the local storage flag be an excuse to remove the references to user, which I don't think the noob help text component has any business interacting with. But you are right that the feeling of regression might be too annoying.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I definitely think that you've nailed down the philosophy of react/redux using lean components throughout the front-end code and I really like the component breakdown that you've done so far. Let me know if you'd rather go with the regression and I'll remove the user checks.

Cheers

@nicolasbize
Copy link
Contributor Author

That's a good edge case to think about! On the other hand, if you wanted a new different message seen and dismissable by all, would it necessarily replace this noob message or be a new placeholder panel?

I'm thinking that not knowing now what message or what behavior you might need in the future is probably reason enough to not try to write any code to support that usecase until it presents itself.

I can definitely make the changes though if you still feel like it's the right approach, but I'd advise on the cautious side regarding premature engineering.

Thanks for the review, you're always very thorough and thoughtful!

@local-minimum
Copy link
Contributor

You are also right that should we need to reset the users' settings so we consider everyone noob we could just as well just change the local storage key at that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants