-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
UI: Fixes for Sidebar and Search #13027
Conversation
…o navigate the tree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looks good. Suggested minor UI tweaks in the comments. Request below:
Recently opened back button
I realize that there's no obvious way to get back to the components list from the "Recently opened" view. Video description
To make it dead obvious, add a back button "« Back to components" above clear history. Perhaps it'd also make sense to allow the [esc] key to go back from this state as well.
Co-authored-by: Dominic Nguyen <[email protected]>
Co-authored-by: Dominic Nguyen <[email protected]>
Done 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build failing due to type errors:
@storybook/ui: src/components/sidebar/Search.stories.tsx(35,13): error TS2741: Property 'closeMenu' is missing in type '{ results: any; query: string; getMenuProps: (props?: any) => { key: any; }; getItemProps: (props?: any) => { key: any; }; highlightedIndex: number; }' but required in type '{ query: string; results: DownshiftItem[]; closeMenu: (cb?: () => void) => void; getMenuProps: (options?: GetMenuPropsOptions, otherOptions?: GetPropsCommonOptions) => any; getItemProps: (options: GetItemPropsOptions<...>) => any; highlightedIndex: number; }'.
@storybook/ui: src/components/sidebar/Search.stories.tsx(42,8): error TS2741: Property 'closeMenu' is missing in type '{ query: string; results: DownshiftItem[]; getMenuProps: (options?: GetMenuPropsOptions, otherOptions?: GetPropsCommonOptions) => any; getItemProps: (options: GetItemPropsOptions<...>) => any; highlightedIndex: number; }' but required in type '{ query: string; results: DownshiftItem[]; closeMenu: (cb?: () => void) => void; getMenuProps: (options?: GetMenuPropsOptions, otherOptions?: GetPropsCommonOptions) => any; getItemProps: (options: GetItemPropsOptions<...>) => any; highlightedIndex: number; }'.
@storybook/ui: src/components/sidebar/SearchResults.stories.tsx(80,33): error TS2741: Property 'closeMenu' is missing in type '{ query: string; results: { item: SearchItem; matches: { value: string; indices: number[][]; }[]; score: number; }[]; getMenuProps: (props?: any) => { key: any; }; getItemProps: (props?: any) => { key: any; }; highlightedIndex: number; }' but required in type '{ query: string; results: DownshiftItem[]; closeMenu: (cb?: () => void) => void; getMenuProps: (options?: GetMenuPropsOptions, otherOptions?: GetPropsCommonOptions) => any; getItemProps: (options: GetItemPropsOptions<...>) => any; highlightedIndex: number; }'.
@storybook/ui: src/components/sidebar/SearchResults.stories.tsx(82,33): error TS2741: Property 'closeMenu' is missing in type '{ results: any; query: string; getMenuProps: (props?: any) => { key: any; }; getItemProps: (props?: any) => { key: any; }; highlightedIndex: number; }' but required in type '{ query: string; results: DownshiftItem[]; closeMenu: (cb?: () => void) => void; getMenuProps: (options?: GetMenuPropsOptions, otherOptions?: GetPropsCommonOptions) => any; getItemProps: (options: GetItemPropsOptions<...>) => any; highlightedIndex: number; }'.
@storybook/ui: src/components/sidebar/SearchResults.stories.tsx(84,34): error TS2741: Property 'closeMenu' is missing in type '{ query: string; results: { item: SearchItem; matches: any[]; score: number; }[]; getMenuProps: (props?: any) => { key: any; }; getItemProps: (props?: any) => { key: any; }; highlightedIndex: number; }' but required in type '{ query: string; results: DownshiftItem[]; closeMenu: (cb?: () => void) => void; getMenuProps: (options?: GetMenuPropsOptions, otherOptions?: GetPropsCommonOptions) => any; getItemProps: (options: GetItemPropsOptions<...>) => any; highlightedIndex: number; }'.
Can you please fix?
Tests are failing for some reason not related to this PR. |
Issue: #13000
What I did
I added a "No components found" message:
Instead of showing the treeview, I made sure that the history will always show at least one item. After all, you will always have a component selected, so technically that one should always be at the top of the list.
Fixed this by removing focus from the expand-all button when using the arrow keys to navigate the tree.
This was a bug and is fixed now.
Fixed. Now when you click a node to expand/collapse it, it will get highlighted as well.
How to test
See the above descriptions and videos for manual QA.