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

Jumping to random CMS tabs when navigating pages #1684

Open
2 tasks done
satrun77 opened this issue Feb 22, 2024 · 2 comments
Open
2 tasks done

Jumping to random CMS tabs when navigating pages #1684

satrun77 opened this issue Feb 22, 2024 · 2 comments

Comments

@satrun77
Copy link
Contributor

satrun77 commented Feb 22, 2024

Module version(s) affected

5.1, but basically every version ever made.

Description

The CMS tries to remember what tab you were looking at when you save your page.

This is there so the content author stays on the same tab when the response comes back from the server. However, it remember your tab for the rest of your session. So you keep going back to that tab by default all the time.

Related issue silverstripe/silverstripe-cms#2924

How to reproduce

  • Go to a CMS page with tabs.
  • Access a tab different from Main.
  • Save the page.
  • You stay on the same tab.
  • Navigate to a different page in the CMS.
  • Come back to your original page.

Possible Solution

Find the bit that reload the tab you were looking at on step 4, and unset the session storage flag after you read it.

Additional Context

The currently displayed tab is recorded in the session storage on save.

Validations

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)

PRs

See #1684 (comment) about changes that are still required

@GuySartorelli
Copy link
Member

GuySartorelli commented Feb 22, 2024

The linked PR is merged and it will be automatically tagged by GitHub actions, and within a week or so it'll be merged up to and tagged in CMS 5. Let me know if you need that sooner @satrun77

I'm going to leave this open though because there's still a scenario in which it's not fixed. In the PR description:

The fix is to remove the tab state after navigating away from the page. Note that the state is not removed if the URL from the address bar is changed manually.

And in #1683 (comment):

For the situation when the URL is changed manually, could we add a TTL to the saved value and if it's expired, reset the saved tab to the default? Could be quite short lived I'd say.

Alternatively, could it be safe to assume there should only be one tab stored for the current session, so any other URL can remove the saved state for other pages? Do we need to index the storage by the URL at all?

@GuySartorelli GuySartorelli removed their assignment Feb 22, 2024
@satrun77
Copy link
Contributor Author

@GuySartorelli It is all good we can use fork for now until new release for CMS 5

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

No branches or pull requests

2 participants