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

Improve browser history integration with the navigation Table of Contents (ToC) filter #213

Open
indirectlylit opened this issue Apr 6, 2021 · 10 comments
Assignees
Labels
category: supporting code Implementation of the system help wanted Open source contributors welcome P3 - low Priority: Stretch goal type: proposal New feature or request type: task Something that needs to be done

Comments

@indirectlylit
Copy link
Contributor

Desired behavior

Follow up from #209 (review)

Persist trailing debounced changes (wait time ~2s) to the filter as query string changes and push them onto the browser history stack.

For example:

URL action
/ first URL
/?filter=button after enter 'button' into ToC filter
/kbutton?filter=button after clicking KButton entry
/?filter=button browser back
/ browser back

Current behavior

search filter persists indefinitely after hittting the back button, which can be surprising

(Optional) The Value Add

Simple way to navigate both pages and ToC filter using standard browser behaviors

(Optional) Possible Tradeoffs

More items added to browser history stack. Might want to update title with filter info so there aren't confusing duplicates

@indirectlylit indirectlylit added category: supporting code Implementation of the system tag: beginner friendly type: proposal New feature or request type: task Something that needs to be done labels Apr 6, 2021
@indirectlylit indirectlylit mentioned this issue Apr 6, 2021
4 tasks
@nucleogenesis nucleogenesis added help wanted Open source contributors welcome P3 - low Priority: Stretch goal labels Jun 11, 2024
@nucleogenesis
Copy link
Member

The issue here can be replicated by:

  • Going to the KDS docs page
  • Typing a search query into the left-sidebar's search bar
  • Clicking any of the headings on the main content page (to be scrolled down to that section)
  • Use the browser's back button, trying to go back to the point before you filtered the side panel
  • See that you are instead never taken to the page state where the side panel was not filtered, but instead, are taken back to the page before you went to the KDS site

This is relatively low-impact, but would be an improvement in any case.

@MisRob MisRob changed the title Improve browser history integration with nav ToC filter Improve browser history integration with the navigation Table of Contents filter Jun 13, 2024
@MisRob MisRob changed the title Improve browser history integration with the navigation Table of Contents filter Improve browser history integration with the navigation Table of Contents (ToC) filter Jun 13, 2024
@RONAK-AI647
Copy link
Contributor

Assign it me please. @MisRob @indirectlylit @nucleogenesis

@AlexVelezLl
Copy link
Member

Hi @RONAK-AI647! I Will assign this to you. Please let us know if you have any questions. Please take a look at the code changes of #209 for more context of the current implementation.

@RONAK-AI647
Copy link
Contributor

As much I can see , the problem is the the nav-search filter bar does not get clear even after pressing browsers back button . Here I made some changes , but it yet requires to click the back button twice, it should be cleared as soon as the page is left, right???

Screen.Recording.2024-11-27.224917.mp4

@AlexVelezLl
Copy link
Member

Hi @RONAK-AI647! No, this is the expected haviour. You can see in the example table in the issue description that two back actions are needed to clear the filter. So this is the correct behaviour! :)

@RONAK-AI647
Copy link
Contributor

Means I got it , should I raise a PR

@AlexVelezLl
Copy link
Member

Yes! Please raise a PR 🤗.

@RONAK-AI647
Copy link
Contributor

20241130-1437-21.0790526.mp4

@AlexVelezLl and maintainers , please notice this behavior , the last clip I shared showed the desired behaviors but I wonder it behave differently now .

It performs the first three actions of the table below but the last one is not executing

Image. I don't know whats going wrong , have not even changed anything since the last commit.

@RONAK-AI647
Copy link
Contributor

Thank you everyone , the issue is dealt , I raised a PR .

@MisRob
Copy link
Member

MisRob commented Dec 17, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: supporting code Implementation of the system help wanted Open source contributors welcome P3 - low Priority: Stretch goal type: proposal New feature or request type: task Something that needs to be done
Projects
None yet
Development

No branches or pull requests

5 participants