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

Schedule help panel auto-dismiss when automatically opened #6289

Closed
wants to merge 1 commit into from

Conversation

acelaya
Copy link
Contributor

@acelaya acelaya commented Mar 27, 2024

This is a naive approach to fix #6277

This PR adds a 5-minute timeout that closes the help panel automatically, and is scheduled as soon as some annotation of any type is created by current user, but only if the help panel was auto-displayed in the first place.

When the timeout callback triggers, it not only closes the help panel, but also updates the show_sidebar_tutorial profile preference, preventing it to show the next time.

There's an edge case, not covered by this PR, which is that, if the timeout is scheduled and the page is reloaded after the callback is executed, the timeout will be re-scheduled from scratch. This is probably negligible, but we could consider tracking the "progress" somehow so that we can continue from there once reloaded.

This PR does not cover animation enhancements described in #6277

session.dismissSidebarTutorial();
}, 5 /** 60*/ * 1000);
}
}, [currentUserHasAnnotations, isSidebar, profile, session, settings, store]);
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'm thinking maybe this logic should be moved to the HelpPanel itself.

In there we are also handling that the show_sidebar_tutorial profile preference is disabled if the panel is manually closed.

When that happens, we should also clear the timeout if it is still in progress.

@acelaya
Copy link
Contributor Author

acelaya commented Apr 8, 2024

Closing until we have a bit more capacity to review this

@acelaya acelaya closed this Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider automatically closing the help panel if auto-opened and user creates annotations
1 participant