-
Notifications
You must be signed in to change notification settings - Fork 21
Console polish #1379
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
Merged
Merged
Console polish #1379
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0310203
Fix broken border and border radius on mini table
benjaminleonard 93a2058
Improve border when there isn't a more actions cell
benjaminleonard 6dd6e5d
Add size and more human label to disk create/attach
benjaminleonard ed96388
Improved `action-col`
benjaminleonard d2ed167
Update pagination
benjaminleonard 6db92f0
Remove hover across entire table row
benjaminleonard 77e14ec
Badge improvements
benjaminleonard 00a1fe2
Fixes #1079 - SVG alignment
benjaminleonard 1dc6b65
don't need the invariant anymore since we're defining every combo
david-crespo 6f075a1
change source: existing/new back to type: attach/create
david-crespo c0a6486
put the disk type in a badge
david-crespo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,57 +20,58 @@ export const getActionsCol = <TData extends { id?: string }>( | |
| return { | ||
| id: 'menu', | ||
| header: '', | ||
| meta: { thClassName: 'w-12 action-col', tdClassName: 'action-col' }, | ||
| meta: { | ||
| thClassName: 'action-col', | ||
| tdClassName: 'action-col children:p-0 w-10', | ||
| }, | ||
|
|
||
| cell: ({ row }) => { | ||
| // TODO: control flow here has always confused me, would like to straighten it out | ||
| const actions = makeActions(row.original) | ||
| const id = row.original.id | ||
| return ( | ||
| <div className="flex w-full justify-center"> | ||
| <Menu> | ||
| {/* TODO: This name should not suck; future us, make it so! */} | ||
| {/* stopPropagation prevents clicks from toggling row select in a single select table */} | ||
| <MenuButton | ||
| className="-m-3 p-3" | ||
| aria-label="Row actions" | ||
| onClick={(e) => e.stopPropagation()} | ||
| > | ||
| <More12Icon className="text-tertiary" /> | ||
| </MenuButton> | ||
| <MenuList> | ||
| {id && ( | ||
| <MenuItem | ||
| onSelect={() => { | ||
| window.navigator.clipboard.writeText(id) | ||
| }} | ||
| <Menu> | ||
| {/* TODO: This name should not suck; future us, make it so! */} | ||
| {/* stopPropagation prevents clicks from toggling row select in a single select table */} | ||
| <MenuButton | ||
| className="flex h-full w-10 items-center justify-center" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to make the whole cell clickable, right? Nice.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, was previously padded out with a large clickable area but it wasn't edge-to-edge. |
||
| aria-label="Row actions" | ||
| onClick={(e) => e.stopPropagation()} | ||
| > | ||
| <More12Icon className="text-tertiary" /> | ||
| </MenuButton> | ||
| <MenuList> | ||
| {id && ( | ||
| <MenuItem | ||
| onSelect={() => { | ||
| window.navigator.clipboard.writeText(id) | ||
| }} | ||
| > | ||
| Copy ID | ||
| </MenuItem> | ||
| )} | ||
| {actions.map((action) => { | ||
| return ( | ||
| <Wrap | ||
| when={!!action.disabled} | ||
| with={<Tooltip content={action.disabled} />} | ||
| key={kebabCase(`action-${action.label}`)} | ||
| > | ||
| Copy ID | ||
| </MenuItem> | ||
| )} | ||
| {actions.map((action) => { | ||
| return ( | ||
| <Wrap | ||
| when={!!action.disabled} | ||
| with={<Tooltip content={action.disabled} />} | ||
| key={kebabCase(`action-${action.label}`)} | ||
| <MenuItem | ||
| className={cn(action.className, { | ||
| destructive: | ||
| action.label.toLowerCase() === 'delete' && !action.disabled, | ||
| })} | ||
| onSelect={action.onActivate} | ||
| disabled={!!action.disabled} | ||
| > | ||
| <MenuItem | ||
| className={cn(action.className, { | ||
| destructive: | ||
| action.label.toLowerCase() === 'delete' && !action.disabled, | ||
| })} | ||
| onSelect={action.onActivate} | ||
| disabled={!!action.disabled} | ||
| > | ||
| {action.label} | ||
| </MenuItem> | ||
| </Wrap> | ||
| ) | ||
| })} | ||
| </MenuList> | ||
| </Menu> | ||
| </div> | ||
| {action.label} | ||
| </MenuItem> | ||
| </Wrap> | ||
| ) | ||
| })} | ||
| </MenuList> | ||
| </Menu> | ||
| ) | ||
| }, | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,67 @@ | ||
| .ox-mini-table { | ||
| border-spacing: 0px; | ||
| } | ||
| & { | ||
| border-spacing: 0px; | ||
| } | ||
|
|
||
| .ox-mini-table td { | ||
| @apply relative px-0 pt-2; | ||
| } | ||
| & td { | ||
| @apply relative px-0 pt-2; | ||
| } | ||
|
|
||
| .ox-mini-table tr { | ||
| @apply relative; | ||
| } | ||
| & tr { | ||
| @apply relative; | ||
| } | ||
|
|
||
| .ox-mini-table td + td:before { | ||
| @apply absolute top-[calc(0.5rem+1px)] bottom-[2px] block w-[1px] border-l border-secondary; | ||
| content: ' '; | ||
| } | ||
| & td + td:before { | ||
| @apply absolute top-[calc(0.5rem+1px)] bottom-[2px] block w-[1px] border-l border-secondary; | ||
| content: ' '; | ||
| } | ||
|
|
||
| .ox-mini-table tr:last-child td + td:before { | ||
| @apply bottom-[calc(0.5rem+2px)]; | ||
| } | ||
| & tr:last-child td + td:before { | ||
| @apply bottom-[calc(0.5rem+2px)]; | ||
| } | ||
|
|
||
| .ox-mini-table td > div { | ||
| @apply flex h-11 items-center border-y py-3 pl-3 text-accent bg-accent-secondary border-accent; | ||
| } | ||
| & td > div { | ||
| @apply flex h-11 items-center border-y py-3 pl-3 text-accent bg-accent-secondary border-accent-secondary; | ||
| } | ||
|
|
||
| .ox-mini-table td:last-child > div { | ||
| @apply w-12 justify-center pl-0 pr-0; | ||
| } | ||
| .ox-mini-table td:last-child > div > button { | ||
| @apply -mx-3 -my-3 flex items-center justify-center px-3 py-3; | ||
| } | ||
| & td:last-child > div { | ||
| @apply w-12 justify-center pl-0 pr-0; | ||
| } | ||
| & td:last-child > div > button { | ||
| @apply -mx-3 -my-3 flex items-center justify-center px-3 py-3; | ||
| } | ||
|
|
||
| .ox-mini-table tr:hover td > div { | ||
| @apply bg-accent-secondary-hover; | ||
| } | ||
| & tr:hover td > div { | ||
| @apply bg-accent-secondary-hover; | ||
| } | ||
|
|
||
| .ox-mini-table tr:last-child td { | ||
| @apply pb-2; | ||
| } | ||
| & tr:last-child td { | ||
| @apply pb-2; | ||
| } | ||
|
|
||
| .ox-mini-table td:first-child > div { | ||
| @apply ml-2 rounded-l border-l; | ||
| } | ||
| & td:first-child > div { | ||
| @apply ml-2 rounded-l border-l; | ||
| } | ||
|
|
||
| & td:last-child > div { | ||
| @apply mr-2 rounded-r border-r; | ||
| } | ||
|
|
||
| & thead tr:first-of-type th:first-of-type { | ||
| border-top-left-radius: var(--border-radius-lg); | ||
| @apply border-l; | ||
| } | ||
|
|
||
| & thead tr:first-of-type th:last-of-type { | ||
| border-top-right-radius: var(--border-radius-lg); | ||
| @apply border-r; | ||
| } | ||
|
|
||
| & tbody tr:last-of-type td:first-of-type { | ||
| border-bottom-left-radius: var(--border-radius-lg); | ||
| } | ||
|
|
||
| .ox-mini-table td:last-child > div { | ||
| @apply mr-2 rounded-r border-r; | ||
| & tbody tr:last-of-type td:last-of-type { | ||
| border-bottom-right-radius: var(--border-radius-lg); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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 like the size column, don't really like
Source: New, though I admitType: Attach/Createis definitely weird. How aboutType: Existing/New? There's not a good word for this. Maybe there's some more subtle way of indicating existing vs. new, like a column giving some other attribute of the disk that indicates concretely that it exists. Like a created at column showing the create time but obviously only the existing disks have one.I still find the green active styling with nested outlines kind of busy.
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 language consistency here is important. When working with disks across different product interfaces the
InstanceDiskAttachmentlanguage ofattach/createshould be a consistent touch point. We don't want to use different language here than we would in the docs, API, CLI, etc. I would keep theType: Attach/Createnomenclature but potentially add a tooltip on the header if further clarification were needed.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, I do find that convincing. When in doubt, stick close to the API and don't dress it up.
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 changed it back to create/attach but I put it in a badge because it looked weird:
Before
After