Skip to content

Conversation

@ImTheKai
Copy link
Collaborator

@ImTheKai ImTheKai commented Jan 6, 2026

Now, if you click the search bar, you will automatically end up on the topics page, and the sidebar search input field is highlighted. Only if there are search results, the actual search page will be shown.

This makes the search flow more intuitive compared to the current version.

@ImTheKai ImTheKai requested a review from dutow January 6, 2026 11:13
Copy link
Collaborator

@dutow dutow left a comment

Choose a reason for hiding this comment

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

Can we base it on an #anchor instead? instead of topics?focus=1, we could use topics#search, and autofocus on it using javascript.

With a little server side logic, we can make it even better:

  • if we are on a page with the search sidebar set, the search link is only "#search"
  • otherwise, it's topics_path(anchor: "search")

Which means that no matter on which page we are with a search bar, we'll never refresh/navigate to somewhere else if we don't have to.

Signed-off-by: Kai Wagner <kai.wagner@percona.com>
@ImTheKai
Copy link
Collaborator Author

ImTheKai commented Jan 6, 2026

You're totally right @dutow and I adjusted the behavior now, as this feels way smoother and also avoids the unnecessary reload. I also dropped the search header from the sidebar, as this was already duplicated, as the search button itself "claims" the search.

@ImTheKai ImTheKai merged commit 94d8fc8 into Percona-Lab:main Jan 6, 2026
2 of 3 checks passed
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.

2 participants