-
Notifications
You must be signed in to change notification settings - Fork 30
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
[feat] Add new themes #85
Conversation
- Update styles - Add new components - Add package react-popper (2.2kb gzip)
- Update build
# Conflicts: # dashboard/assets/packages/ui/dist/assets/index-2172ee12.js # dashboard/assets/packages/ui/dist/index.html
if (options.axes.length > 2) { | ||
options.axes[2].side = 1 | ||
} | ||
const options = createOptions({ plot, theme, width }) | ||
|
||
function onCreate(chart: uPlot) { |
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.
@szkiba is this function still required? I'm yet to see it being used.
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.
It is about to set second vertical axe to right side... if any
- Add hover state to IconButton - Add hover state to Menu.Item
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.
Big improvement and looks nice!
Predictably, you can guess what my comments are going to be about as I review all PRs using just my keyboard and screen reader 😬
Two other nits:
390px has a nice layout but once I go beneath that (or have browser zoom enabled), it reverts to multiple columns:
At certain resolutions the card metrics have uneven heights due to the titles wrapping to two lines. I think with a little bit of flex magic these could line up nicely still.
|
||
useEventListener("mouseup", handleClickAway, documentRef) | ||
|
||
return <>{cloneElement(children, { ref: handleRef })}</> |
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.
Can we add a keyboard listener event to this as well so if you tab into or out of it it knows to close it? (And also 'esc' closes it 😄 ).
|
||
return ( | ||
<> | ||
<IconButton ref={setReferenceElement} name="options" variant="text" onClick={() => setIsOpen(!isOpen)} /> |
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.
aria-label="Menu"
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.
Given this some thought and I also think it should have aria-expanded={isOpen ? 'true' : ' false}
.
active: [ | ||
itemBase, | ||
{ | ||
color: vars.colors.text.primary | ||
} | ||
], |
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.
In both light and dark modes I can barely see the active states. I think these could be improved so they are easier to identify.
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 think you might have missed re-looking at this one 😃
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.
Hmm I'd updated the theme and thought there was quite a strong difference now :/
Screen.Recording.2023-11-03.at.13.37.19.mov
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.
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.
Few last comments! I missed a bit of cleanup from last time removing some of the redundant aria attributes and roles and gave a bit more thought to the menu.
I think you missed updating the active and hover states for the menu 😃
<ClickAwayListener onClickAway={() => setIsOpen(false)}> | ||
<Paper | ||
{...attributes.popper} | ||
aria-label="Menu" |
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.
Whoops, wrong place. This wants to be on the IconButton
above rather than on the Paper
component.
))} | ||
</main> | ||
</div> | ||
<Flex direction="column" gap={3} role="tabpanel" id={`tabpanel-${idx}`} aria-labelledby={`tab-${idx}`}> |
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.
Sorry, I missed these the first time round. You can drop the role
, id
and aria-labelledby
attributes here, they aren't hooked up correctly and I think in the context of this app they aren't really tabs.
active: [ | ||
itemBase, | ||
{ | ||
color: vars.colors.text.primary | ||
} | ||
], |
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 think you might have missed re-looking at this one 😃
{options.map((option, index) => ( | ||
<Item | ||
key={option.id} | ||
aria-controls={`nav-${index}`} |
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.
Can remove the aria-controls
here as it isn't hooked up correctly and as said for the tab panel, I think isn't the right tool to use in this context.
|
||
return ( | ||
<> | ||
<IconButton ref={setReferenceElement} name="options" variant="text" onClick={() => setIsOpen(!isOpen)} /> |
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.
Given this some thought and I also think it should have aria-expanded={isOpen ? 'true' : ' false}
.
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.
Awesome job, looks great! 💪
What?
This PR adds a rewrite of the UI for the ui package
Why?
We wanted to update the UIs & UX so that they feel more aligned to the k6 product.
Dark Mode
Light Mode
How to test?
/dashboard/assets/packages/ui
yarn && yarn dev
go run mage.go run script.js
Notes
@szkiba given how dynamic your framework is, would it be possible to add a one-off component for displaying a summary of stats (see screenshot of design) or does that break the model?
Checklist
go run mage.go lint
) and all checks pass.go run mage.go test
) and all tests pass.