Skip to content

ref(issues): Extract modal into hook, allow local dismissal #89741

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

Merged
merged 2 commits into from
Apr 16, 2025

Conversation

leeandher
Copy link
Member

@leeandher leeandher commented Apr 16, 2025

For whatever reason, it's possible that users do not create assistant records, which will cause annoying behaviour like repeatedly popping the tour modal. I'm guessing this has something to do with an ad blocker, or /assistant/ being flagged on their network or something oddly specific.

Either way, to make it a bit more resilient, we can add a back up check with local storage. This should prevent any further issues of repeated modals since only super users can ever reset this local storage value in-app.

The component was also getting pretty confusing, so pulled it all into its own hook.

@leeandher leeandher requested a review from a team as a code owner April 16, 2025 14:54
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 16, 2025
),
{
modalCss: IssueDetailsTourModalCss,
onClose: handleEndTour,
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to add if (reason) here so that this only occurs when the modal is dismissed by the user? I think that this will get called from props.closeModal() otherwise which I don't think we want (since that happens if they click to start the tour)

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call, that makes sense 👍

isCompleted: isTourCompleted,
} = useIssueDetailsTour();

const [localTourState, setLocalTourState] = useLocalStorageState(
Copy link
Member

Choose a reason for hiding this comment

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

If localstorage is actually necessary it seems like we would want to use it as a backup everywhere we currently use /assistant/ - do you think that's the case?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think maybe, though there are a bunch of other places we use the assistant that would need addressing so it's probably out of scope for now. If we have time we can look into the cause for this user's bad assistant state but I think it's a little early for a broad change (though it's worth noting)

If reports keep coming in we should look into it further, this page is just extremely high traffic so I'm being cautious.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also something we should note for building a TourStore to resolve the concurrent tour issues (related to #89733)!

@leeandher leeandher requested a review from malwilley April 16, 2025 17:00
@leeandher leeandher merged commit 26af7dd into master Apr 16, 2025
46 checks passed
@leeandher leeandher deleted the leander/ls-tour branch April 16, 2025 18:21
andrewshie-sentry pushed a commit that referenced this pull request Apr 22, 2025
For whatever reason, it's possible that users do not create assistant
records, which will cause annoying behaviour like repeatedly popping the
tour modal. I'm guessing this has something to do with an ad blocker, or
`/assistant/` being flagged on their network or something oddly
specific.

Either way, to make it a bit more resilient, we can add a back up check
with local storage. This should prevent any further issues of repeated
modals since only super users can ever reset this local storage value
in-app.

The component was also getting pretty confusing, so pulled it all into
its own hook.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants