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

[Bug]: Tags filter UI is filtering "recently opened" results #29502

Open
shilman opened this issue Oct 31, 2024 · 0 comments
Open

[Bug]: Tags filter UI is filtering "recently opened" results #29502

shilman opened this issue Oct 31, 2024 · 0 comments

Comments

@shilman
Copy link
Member

shilman commented Oct 31, 2024

Describe the bug

When search is focused but there is no query, we show "recently opened" stories in the sidebar.

The recently open story IDs are stored in localStorage, meaning that they can correspond to any Storybook running on the port. So to avoid problems, we filter those story IDs down to stories that actually exist in the currently open Storybook.

For some reason, the list of stories that we filter by, is in turn filtered down by the selected tags. So if you have play-fn selected but have not recently viewed any play-fn stories, the list will be empty and the sidebar will be blank. Unfortunately, this state is pretty easy to hit.

This seems like a bug because we should be checking against ALL stories in the current Storybook and not the list filtered by play-fn. If we make this change, it means that it's possible to navigate to a recently viewed story that is NOT showed in the sidebar.

As a related fix, we could also make it so that the currently selected story is ALWAYS shown in the sidebar even if it doesn't match the current set of filters. It could disappear from the sidebar as soon as the user navigates away from the story.

Reproduction link

N/A

Reproduction steps

No response

System

any

Additional context

No response

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

1 participant