Skip to content

Conversation

@benjaminleonard
Copy link
Contributor

Knocking a few polish issues down.

This fixes:

  • Some table border issues, on the mini table and the larger tables without a more actions cell.
  • Updates the instance disk mini table with the size and gives the type a more readable name
  • Fixes issue with more actions cell centering and improves that in general, whole cell is now clickable and no longer need the negative margin padding hack
  • Fixes pagination visual issues
  • Removes overall table cell hover
  • Updating badges to match designs, adding extra colours and updating status badge component to use these
  • Fixes open link SVG alignment in a couple of spots

Fixes #1326
Fixes #1287
Fixes #1082
Fixes #1078
Fixes #1332
Fixes #1079
Fixes #1077

- More consistency, previously the widths changed
- The button now fills the entire cell and doesn't rely on the negative padding and margin hack
- Vertically centered
- Remove defunct wrapper
Fixes #1326
Fixes #1287
Fixes #1082
- Update to latest designs (Fixes #1332)
- Remove ghost variant, is defunct
- Rename component to better reflect usage (non-solid version is default)
- Add extra theme colours and apply to `StatusBadge.tsx`
@vercel
Copy link

vercel bot commented Mar 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
console-ui-storybook ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 2, 2023 at 9:16PM (UTC)

@benjaminleonard
Copy link
Contributor Author

On status badge colours, I tried to use the dim badge at the default and the solid version when it'd be useful to draw attention to the status of something. Will be interesting to test out in practice. For example runnning is a normal idle state, but repairing is a significant action so we might want to highlight that.

I'm also happy to be convinced otherwise in the name of consistency.

image


const defaultStyles = 'ring-1 ring-inset'

export const badgeColors: Record<BadgeVariant, Partial<Record<BadgeColor, string>>> = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

now that we're defining styles for every color, we can remove the Partial here

Copy link
Collaborator

Choose a reason for hiding this comment

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

And then you can remove the invariant check because every combination is guaranteed to be valid

{/* 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"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is to make the whole cell clickable, right? Nice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

<span className="ml-1 inline-block text-accent-secondary">GiB</span>
</>
)}
</MiniTable.Cell>
Copy link
Collaborator

@david-crespo david-crespo Mar 1, 2023

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 admit Type: Attach/Create is definitely weird. How about Type: 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.

image

I still find the green active styling with nested outlines kind of busy.

Copy link
Contributor

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 InstanceDiskAttachment language of attach/create should 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 the Type: Attach/Create nomenclature but potentially add a tooltip on the header if further clarification were needed.

Copy link
Collaborator

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.

Copy link
Collaborator

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

Screenshot 2023-03-02 at 3 09 12 PM

After

Screenshot 2023-03-02 at 3 08 49 PM

meta: { thClassName: 'w-12 action-col', tdClassName: 'action-col' },
meta: {
thClassName: 'action-col',
tdClassName: 'action-col children:p-0 w-[0.1%]',
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems to work just as well with w-0. However since we know the cell is w-10, any problem with using that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Happy to use either. For whatever reason it felt like if I chose the small value and let the table constrain the width I'd only have to define the width once, and therefore only change it in one place if it was changed later.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, that's a good point. In that case I think I like w-0 + a comment.

Copy link
Collaborator

@david-crespo david-crespo left a comment

Choose a reason for hiding this comment

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

Pending bikeshedding on the disks table, this is great.

@david-crespo
Copy link
Collaborator

We can figure out the disk stuff later.

@david-crespo david-crespo merged commit cc08529 into main Mar 2, 2023
@david-crespo david-crespo deleted the polish-202302 branch March 2, 2023 21:30
@benjaminleonard
Copy link
Contributor Author

Cool — I'll revisit that later.

Thanks for mergin'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants