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

feat(admin-ui): DataTable + Skeleton components #4489

Open
wants to merge 24 commits into
base: feat/new-admin-ui
Choose a base branch
from

Conversation

leopuleo
Copy link
Contributor

@leopuleo leopuleo commented Jan 13, 2025

Changes

This PR introduces two new components and improves many others.

Skeleton

The Skeleton component displays the loading state throughout the admin app. It follows the shadcn/ui specifications and may be updated as we await the final designs.

The previous Skeleton component used the react-loading-skeleton package, now removed.

Table + DataTable

These two components are used to display data across multiple admin app views. The Table component provides the backbone components and is used internally by DataTable, which handles data and column definitions.

The DataTable component will receive improvements in the future, migrating it to a first-test architecture approach.

Other improvements

Checkbox
Integrating the Checkbox component within the DataTable revealed several enhancements:

  • The label prop is no longer required, enhancing component alignment when not supplied.
  • We are forcing the check icon size and color: while using it inside a DropdownMenu component, its size and color were slightly odd.
  • Fixed the component display when the Checkbox is checked and indeterminate.

How Has This Been Tested?

Jest + Manual

@leopuleo leopuleo requested a review from adrians5j January 13, 2025 14:21
@leopuleo leopuleo self-assigned this Jan 13, 2025
@leopuleo leopuleo marked this pull request as ready for review January 13, 2025 14:47
Copy link
Member

@adrians5j adrians5j left a comment

Choose a reason for hiding this comment

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

First look over the PR, looks good. Was expecting it to be more complex initially hehe.

Besides the code review, here are just a couple of extra notes / questions.

1. Backlog - Resetting Sorters

Right now, the moment you click on a column, the sorter is applied. Cool.
If I click again on it, a reverse sorter is applied. Also cool.
Now, the third time I click, I would expect for the sorter to be dismissed. But what happens is the sorter again gets reversed.

This is most probably outside of the scope for this PR (it always worked like this), but I'd maybe still backlog this?

image

2. Backlog - Which Columns Are Sortable?

In the future, maybe we can see how to signal to the user which columns are sortable and which aren't. Just so the user does not need to hover over columns, and figure it out by just looking at the cursor. Maybe we check with Kreso?

image

3. Page Builder Issue

There's a bug here. If I open Page Builder (list of pages view), I get:
image

4. Backlog - Column Resizing UX

For me at least, the column resizing UX is good, but not the best.

It's fine when I resize the far left column, because the right ones just keep moving left/right as I'm doing it.

But when I resize a column in the middle, then, instead of just the right columns, the left columns also resize (shrink in their width).

Feels weird to me.

I believe you had a resizing-related chat with Kreso, and I saw he mentioned Notion. I tried column resizing in Notion, and for me that felt much better.

But yeah... the title of this point does mention "Backlog", so for now, I'd just backlog this and move on with higher P stuff.

<div className={cn(resizerVariants({ isResizing }), className)} {...props} />
);

export { Resizer, ResizerProps };
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
export { Resizer, ResizerProps };
export { Resizer, type ResizerProps };

Copy link
Member

Choose a reason for hiding this comment

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

Did not go yet into details, but the first think I noticed is a solid amount of code in this file. Let's maybe extract some of the code (where possible) into separate files?

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

Successfully merging this pull request may close these issues.

3 participants