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

[dashboard] Fix Teams & Projects top-level menu UX #5077

Merged
merged 2 commits into from
Aug 6, 2021

Conversation

jankeromnes
Copy link
Contributor

@jankeromnes jankeromnes commented Aug 5, 2021

Fixes #4622

BEFOREAFTER
Dropdown is always splitDropdown is only split on sub-pages
Screenshot 2021-08-05 at 17 52 11 Screenshot 2021-08-05 at 17 58 20
Screenshot 2021-08-05 at 17 45 12 Screenshot 2021-08-05 at 17 52 01

@gtsiolis What do you think about this change? Is it a good trade-off? (Nicer on root pages, but still allows breadcrumb navigation when there are breadcrumbs.)

EDIT: Now also fixes #5072 and fixes #5073

Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

@jankeromnes this looks certainly much better than before!

UX looks good to merge. Feel free to request a review for the frontend code if needed. 🏀

Since we're here what do you think of also changing the hover color of the dropdown entries to bg-gray-100? 🤓

Optionally, if this takes less only a few minutes to fix we could also highlight the actively selected team as described in #5072. However, feel free to leave this out of the scope of these changes. ✂️

@roboquat
Copy link
Contributor

roboquat commented Aug 5, 2021

LGTM label has been added.

Git tree hash: cecce1b0a8049d3c9f9c9099e00829aa8d79b33d

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Aug 5, 2021

Many thanks for the quick review! ⚡ Will take a look at the proposed improvements. 😁

/approve

/hold

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Aug 5, 2021

Since we're here what do you think of also changing the hover color of the dropdown entries to bg-gray-100? 🤓

@gtsiolis Is it cool to change them for all Dropdowns ContextMenus everywhere? 👀 (It's a much-used component!)

@jankeromnes jankeromnes force-pushed the jx/teams-projects-polish branch from 2469fbb to 0c3ae1a Compare August 5, 2021 16:43
@roboquat roboquat removed the lgtm label Aug 5, 2021
@gtsiolis
Copy link
Contributor

gtsiolis commented Aug 5, 2021

Is it cool to change them for all Dropdowns everywhere?

@jankeromnes Yeap! This is a general improvement that can benefit all other dropdowns as the component design evolves over time. 🚢

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Aug 5, 2021

Is it cool to change them for all Dropdowns everywhere?

@jankeromnes Yeap! This is a general improvement that can benefit all other dropdowns as the component design evolves over time. 🚢

Awesome! Done ✅ 🎉

Optionally, if this takes less only a few minutes to fix we could also highlight the actively selected team as described in #5072. However, feel free to leave this out of the scope of these changes. ✂️

Hmm, this isn't super easy, since the team selector uses the ContextMenu component, which doesn't really allow custom backgrounds yet.

However, an easy fix could be to make the active item have bg-gray-50 everywhere. Would this look okay? (No hover at all here.)

BEFOREAFTER
Screenshot 2021-08-05 at 18 50 43 Screenshot 2021-08-05 at 18 47 46

(I could also quickly fix the background color "cutting into" the corners.)

@jankeromnes jankeromnes force-pushed the jx/teams-projects-polish branch 2 times, most recently from 00f8b89 to e59103c Compare August 6, 2021 07:06
@jankeromnes
Copy link
Contributor Author

Okay, I think the "active" bg-gray-50 background looks okay like this:

BEFOREAFTER
Screenshot 2021-08-06 at 08 57 18 Screenshot 2021-08-06 at 08 58 05
Screenshot 2021-08-06 at 08 57 27 Screenshot 2021-08-06 at 08 58 14
Screenshot 2021-08-06 at 08 57 37 Screenshot 2021-08-06 at 08 58 20
Screenshot 2021-08-06 at 08 57 44 Screenshot 2021-08-06 at 08 58 27

In dark, we use the same bg-gray-800 for active and hover:

BEFOREAFTER
Screenshot 2021-08-06 at 09 01 19 Screenshot 2021-08-06 at 09 02 00
Screenshot 2021-08-06 at 09 01 28 Screenshot 2021-08-06 at 09 02 08
Screenshot 2021-08-06 at 09 01 35 Screenshot 2021-08-06 at 09 02 14
Screenshot 2021-08-06 at 09 01 44 Screenshot 2021-08-06 at 09 02 20

@gtsiolis Still looks good to you?

Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

Looks great @jankeromnes!

Left two minor comments. Besides these, UX looks good to merge! 🚢

The changes here would probably also resolve #5073, right?

@@ -84,7 +84,7 @@ function ContextMenu(props: ContextMenuProps) {
<div className={`mt-2 z-50 bg-white dark:bg-gray-900 absolute flex flex-col border border-gray-200 dark:border-gray-800 rounded-lg truncated ${props.classes || 'w-48 right-0'}`}>
{props.menuEntries.map((e, index) => {
const clickable = e.href || e.onClick || e.link;
const entry = <div className={`px-4 flex py-3 ${clickable ? 'hover:bg-gray-200 dark:hover:bg-gray-800' : ''} text-sm leading-1 ${e.customFontStyle || font} ${e.separator ? ' border-b border-gray-200 dark:border-gray-800' : ''}`} title={e.title}>
const entry = <div className={`px-4 flex py-3 ${clickable ? 'hover:bg-gray-100 dark:hover:bg-gray-800' : ''} ${e.active ? 'bg-gray-50 dark:bg-gray-800' : ''} ${index === 0 ? 'rounded-t-lg' : ''} ${index === props.menuEntries.length - 1 ? 'rounded-b-lg' : ''} text-sm leading-1 ${e.customFontStyle || font} ${e.separator ? ' border-b border-gray-200 dark:border-gray-800' : ''}`} title={e.title}>
Copy link
Contributor

@gtsiolis gtsiolis Aug 6, 2021

Choose a reason for hiding this comment

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

issue: This is minor but there's a small gap on the corners due to corner radiuses. It should be barely noticable but if there's an easy fix let's also include it here. Otherwise, a follow up issue could suffice. 🏓

A B
Screenshot 2021-08-06 at 10 46 57 AM Screenshot 2021-08-06 at 10 46 43 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh no 🙈 that's so unsatisfying 😬

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Follow-up issue: #5086

components/dashboard/src/components/ContextMenu.tsx Outdated Show resolved Hide resolved
@roboquat roboquat added the lgtm label Aug 6, 2021
@roboquat
Copy link
Contributor

roboquat commented Aug 6, 2021

LGTM label has been added.

Git tree hash: 6c62fdd49576eb88680dfbc0fe8d7860f3a92c6c

Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

praise: Oh, almost forgot! Thanks for using a BEFORE / AFTER tables here for screenshots with the changes. Makes reviewing UX changes so much better. 🌟

@roboquat
Copy link
Contributor

roboquat commented Aug 6, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gtsiolis, jankeromnes

Associated issue: #4622

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jankeromnes jankeromnes force-pushed the jx/teams-projects-polish branch from e59103c to 82564e2 Compare August 6, 2021 08:10
@roboquat
Copy link
Contributor

roboquat commented Aug 6, 2021

New changes are detected. LGTM label has been removed.

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Aug 6, 2021

Okay, should be good to launch as is! 🚀

Releasing the breaks:

/unhold

@roboquat roboquat merged commit f16d4fe into main Aug 6, 2021
@roboquat roboquat deleted the jx/teams-projects-polish branch August 6, 2021 08:26
@gtsiolis gtsiolis mentioned this pull request May 30, 2022
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants