-
Notifications
You must be signed in to change notification settings - Fork 4.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
App Header React migration #4245
Conversation
Thanks to @gabrieldutra realized that the mobile version is crappy. |
Quick things I noticed:
|
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 haven't tested the whole thing yet, but from my experience so far I can tell that mobile experience is a lot better 😁:
- Navigation is much simpler (no more sub-sub-menus)
- Now it closes the dropdown when you select an option
- It's got
position: fixed
, so it's easily accessible from anywhere in page
For the desktop version I liked the blue bottom border and wdyt of having a black text color instead? (That gray feels de-emphasized to me)
</Dropdown> | ||
</div> | ||
<div className="header-logo"> | ||
<a href={clientConfig.basePath}> |
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.
<a href={clientConfig.basePath}> | |
<a href="./"> |
It annoys me that this depends on a backend config and it doesn't fit our Redash-preview case, for example... I wonder if the above works for Multi-org 🤔
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.
That actually works for multi-org!
Learned sth new today :)
fetch().$promise.then(({ results }) => { | ||
setLoading(false); | ||
setItems(results); | ||
}); |
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.
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.
Very true. Fixed!
10x @arikfr
(It's the default ant-design dropdown menu color that we have across the site)
I had to do some cunning css to recreate the way it is in the current version.
Personally, I don't see the point in it. |
@gabrieldutra I was waiting for @arikfr to say sth about it 😄 |
{currentUser.isAdmin && ( | ||
<Menu.Item key="settings"> | ||
<a href="data_sources" className="menu-item-button"> | ||
<i className="fa fa-sliders" /> |
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.
Considering the Help Trigger has a Tooltip on its own, wdyt about adding a Tooltip here as well? So will be a "standard" Icon Button behavior
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.
Done. Also converted it to <Button>
so it has the cool click animation.
It does look like something Arik would say 😂. I prefer black, but |
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.
Looks good 👍
- I agree about the color of the text. While the idea of making it take less focus is valid it still looked pale.
- We might want to add some caching to favorites, so it doesn't fetch on every click.
Why? Some short time span (1 minute?) will help with making sure that repeated clicks on the menu don't require new data. |
Cuz if a user adds or removes faves, the fave menu would be out of date until a minute has passed. I think that's no good. |
Of course. I didn't look too much into it, but in a single check I saw that one of the favs endpoint returned results in 300ms and the other in 700ms. This feels borderline acceptable, no? Specially for repeated presses. The other option is a Favorties "service" class, that holds current state and has a simple method of |
Borderline acceptable how? The user wait time is 0 on repeated presses.
Sure sounds good. Ok to implement this in a subsequent PR? (Don't want the PR to balloon 🎈) |
Correction - there IS a wait, but only when there're no faves in the list. |
Why? If the values are memoized, then it's fine to leave as is. |
You're right I changed it now.
👍 |
$route.reload(); | ||
} | ||
|
||
function Desktop() { |
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.
Although implicit (and it's not a blocker for this) I would prefer naming those DesktopHeader
and MobileHeader
(or Navbar 🙂).
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.
+1 for this 🙂
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.
Looking forward to share to my friends such improvements in Mobile UX :)
Code looks great and I didn't find any issues in UI. Only thing is the favorites loading that is a bit annoying, which will be fixed soon. I left one last comment.
Thanks, Ran! 🎉
client/app/components/app-header/components/FavoritesDropdown.jsx
Outdated
Show resolved
Hide resolved
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.
New header looks even better than previous one (especially on mobile) 🎉
Few comments, no blockers at all (up to you to accept them or not 👍)
client/app/components/app-header/components/FavoritesDropdown.jsx
Outdated
Show resolved
Hide resolved
$route.reload(); | ||
} | ||
|
||
function Desktop() { |
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.
+1 for this 🙂
Co-Authored-By: Gabriel Dutra <nesk.frz@gmail.com>
Co-Authored-By: Levko Kravets <levko.ne@gmail.com>
Linter crashes for a some reason 🤔 |
TODO
Changes
Manually tested