-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Code Insights: Improve dashboard select UI #43029
Conversation
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits 893613a and 204ffb6 or learn more. Open explanation
|
Codenotify: Notifying subscribers in OWNERS files for diff 204ffb6...893613a.
|
- Add aria attribute to the popover trigger - Fix problem with return focus to target - Remove legacy RAF schedule call in tether - Add new hook API for exposing popover state
- Fix group option layout - Fix scroll into view logic (add scroll into center functionality)
45d0a8e
to
d068b76
Compare
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.
The insights related changes look fine to me. I don't like that you need to append numbers to duplicate dashboard names and that they would be inconsistent between users.
@@ -46,7 +47,22 @@ export const getDashboards = (apolloClient: ApolloClient<unknown>, id?: string): | |||
}) | |||
) | |||
|
|||
export function deserializeDashboardsOwners( | |||
function makeDashboardTitleUnuque(dashboards: InsightsDashboardNode[]): InsightsDashboardNode[] { |
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.
I'm not sure how I feel about this. I assume this would not be common, but also it's user specific so my Chris Dashboard
might be your Chris Dashboard 2
.
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.
Yeah, you're right that there is a possibility to have non-consistent dashboard names. I don't like this behaviour either. I did this because reach ui combobox doesn't work with non unique items. I think this problem is bad anyway (with number suffix or without)
- I believe if someone wants to share a dashboard they would probably go with dashboard URL where we have unique id instead of copy past title
- Even if we someone uses title as something for looking for a dashboard I think even without numbers it would confuse users, without number they will see different amount of dashboards, so inconsistent problem persists here.
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.
Agree two with the same name is just as bad so I don't consider this a blocker if the change brings other positive benefits.
I haven't been able to get the web preview link to work for this, I get an error so I could try it to get a sense of how it feels to use aside from playing in the storybook, which worked well for me. |
@chwarwick the web app link is broken because of redirect issue |
Thanks @vovakulikov that worked and I didn't have any issues with dashboard select. Not sure if it's related to this change but I keep getting stuck in the screen reader after changing dashboards it repeats "Loading, Loading, Loading.... ". |
@chwarwick thanks for checking implementation! Yeah, this issue with loading state that's the infamous, here is an issue for this https://github.com/sourcegraph/sourcegraph/issues/41684 |
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.
Thank you for making this improvement @vovakulikov! It works really nicely, the keyboard navigation is smooth. No issues from my side. Well done!
I've noticed that the three dots menu icon for dashboard context menu has the incorrect color:
- it should be $icon-color
- it is: $body-color in light mode
- renders as a dark grey in dark mode, even though it has the $body-color color assigned
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.
From the insights side 👍
Thanks for UI and tech review! The issue with three dot context menu and the dark theme is covered in a separate issue, I will address it in a next PR. |
It seems like this change has introduced an endless recursion in combination with the git blame view (maybe other views as well?): https://github.com/sourcegraph/sourcegraph/issues/43335#issuecomment-1288942023 |
Problem
This PR improves dashboard select UI on the code insight dashboard page. Previously this select was built with Listbox UI from reach-ui. And it was good enough but we had a few problems with
Solution
In this PR we replace Listbox UI with combination of wildcard Popover and Combobox UI. This gives us better UI/UX.
Tradeoffs
Test plan
App preview:
Check out the client app preview documentation to learn more.