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

[#57904] meeting reload button will take you to your previous spot on the page #16809

Conversation

EinLama
Copy link
Contributor

@EinLama EinLama commented Sep 25, 2024

Ticket

https://community.openproject.org/wp/57904

What are you trying to accomplish?

Whenever another user makes changes to a meeting, you will get a flash notification that encourages you to reload in order to see the updated contents of the page.

Until now, your viewport was moved back all the way up to the beginning of the page whenever you clicked on that reload button.

With this feature, clicking the reload button will remember your current position on the page and move you back down again.

Caveat: if you do not use the reload button, but trigger a reload manually, your position will be discarded.

Screenshots

reload_refresh.mov

What approach did you choose and why?

Introduced a new boolean value that can be set via Stimulus to enable this feature. If done so, the pollForChangesController will track the last known scroll position before reloading the page.

Restoring the last known position only happens when the reload button is used. This is done so that the last known position on the page is NOT restored when you re-enter a meeting page that you've visited previously.

The scroll position is remembered in the sessionStorage. This means it is exclusive to the current tab. Additionally, the current path with the meeting id is used as a key. This avoids positional changes on the wrong page when visiting multiple meeting pages after another.

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@EinLama
Copy link
Contributor Author

EinLama commented Sep 25, 2024

Opinions please: should this feature have a feature spec? Since those are rather costly, and this functionality is mostly "nice to have", I deemed it not worth it in this case.

@EinLama EinLama marked this pull request as ready for review September 25, 2024 13:45
@EinLama EinLama marked this pull request as draft September 25, 2024 13:46
@EinLama EinLama force-pushed the feature/57904-meeting-reload-button-doesnt-take-you-to-your-previous-spot-on-the-page branch 2 times, most recently from e8c8de8 to f7ad2bb Compare September 25, 2024 14:29
EinLama and others added 2 commits September 25, 2024 16:34
This way, a page controller can grasp more DOM elements on the page.

Co-authored-by: Oliver Günther <[email protected]>
@EinLama EinLama force-pushed the feature/57904-meeting-reload-button-doesnt-take-you-to-your-previous-spot-on-the-page branch from f7ad2bb to 58f8a1f Compare September 25, 2024 14:34
@EinLama EinLama marked this pull request as ready for review September 25, 2024 14:35
@oliverguenther oliverguenther self-requested a review September 25, 2024 14:51
@opf opf deleted a comment from github-actions bot Sep 25, 2024
@EinLama EinLama merged commit a56b53d into dev Sep 25, 2024
14 checks passed
@EinLama EinLama deleted the feature/57904-meeting-reload-button-doesnt-take-you-to-your-previous-spot-on-the-page branch September 25, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants