Skip to content

Conversation

@purpxd
Copy link

@purpxd purpxd commented Feb 10, 2025

Chapter Table Checkbox Column

Before: Checkbox selects all rows in the table
After: Checkbox selects all rows in current page
I figured maybe it wasn't intended to do that since there was pagination for the tables that the checkbox should only select only the chapters in the current page. Anyway if it was then I added the select all in the options dropdown.

Options Dropdown

Moved the download and marking operations into the options dropdown. I think you wanted some confirmation for the downloads, this solves that. The mark selected operations I moved into the dropdown might be a little redundant since I kept the previous buttons where they were. But included mark all chapters which can be useful

Filter Dropdown

The buttons row was getting too packed and with the addition of the read chapters filter I figured it would be appropriate to move it to a dropdown

Hide Read Filter

This filter solves #326

image

Changes the column checkbox to select rows in the current page rather
than all rows. This will reduce clicks from users when marking large
series that aren't fully completed.
*Moved marked buttons into dropdown, seperating operations for all rows
and selected rows
*Moved Download chapters into dropdown, also seperated for all and
selected
*Moved back the selected buttons back into the main buttons rows using outline variant
*consolidated group and language filters under the filter dropdown
*Removed filter logo
*Swap popover trigger style from button to div
*Have popover show to the right
*Conditionally render chevron
*Added read filter component to filter dropdown
*Modified library state to filter read chapters
@netlify
Copy link

netlify bot commented Feb 10, 2025

Deploy Preview for houdoku ready!

Name Link
🔨 Latest commit 88dc464
🔍 Latest deploy log https://app.netlify.com/sites/houdoku/deploys/67bbd4adf7bb0000089ae157
😎 Deploy Preview https://deploy-preview-403--houdoku.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Owner

@xgi xgi left a comment

Choose a reason for hiding this comment

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

A few minor comments but this looks great. Thanks!

<span>Read</span>
</div>
</DropdownMenuItem>
<DropdownMenuSeparator />
Copy link
Owner

Choose a reason for hiding this comment

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

remove this separator

<span>All Chapters</span>
</div>
</DropdownMenuItem>
<DropdownMenuSeparator />
Copy link
Owner

Choose a reason for hiding this comment

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

remove this separator

Comment on lines 8 to 26
const toggleReadChapters = () => {
setHideReadChapters(!hideReadChapters);
};

return (
<div
className="flex items-center space-x-2 cursor-pointer"
onClick={toggleReadChapters}
>
{hideReadChapters ? (
<Check className="h-5 w-5 text-blue-500" />
) : (
<Square className="h-5 w-5 text-gray-500" />
)}
<span className="text-sm">
Hide Read
</span>
</div>
);
Copy link
Owner

Choose a reason for hiding this comment

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

  • change to "Hide read"
  • I think the check option is better as an actual checkbox, although it's fine to have the click event on the container div. Also would prefer to not have the menu close when toggling this option
return (
    <div
      className="flex items-center space-x-2 cursor-pointer"
      onClick={(e) => {
        e.stopPropagation();
        setHideReadChapters(!hideReadChapters);
      }}
    >
      <Checkbox checked={hideReadChapters} />
      <span className="text-sm">Hide read</span>
    </div>
  );

Comment on lines 353 to 356
<Button variant="outline">
<Filter className="w-4 h-4" />
Filters
</Button>
Copy link
Owner

Choose a reason for hiding this comment

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

doesn't need to be part of this PR, but I think it would be good to have a badge with X selected on the button when either language/group filters are applied.

};

const getAllChapters = (): Chapter[] => {
console.log(table.getCoreRowModel())
Copy link
Owner

Choose a reason for hiding this comment

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

remove this

Comment on lines 475 to 382
{table.getIsSomeRowsSelected() && (
<div className="flex space-x-2 items-end">
<Button variant="outline" className="ml-auto" onClick={() => setSelectedRead(true)}>
<Eye className="w-4 h-4" />
Mark selected read
</Button>
<Button variant="outline" className="ml-auto" onClick={() => setSelectedRead(false)}>
<EyeOff className="w-4 h-4" />
Mark selected unread
</Button>
</div>
</>
)}
Copy link
Owner

Choose a reason for hiding this comment

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

You can just get rid of these buttons

const chapterListChOrder = get(chapterListChOrderState);

const uniqueChapters = new Map();
const toggleReadChapters = get(ReadChaptersState);
Copy link
Owner

Choose a reason for hiding this comment

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

toggleReadChapters doesn't make sense, this is a boolean. Maybe also change ReadChaptersState to something like hideUnreadChaptersState and adjust accordingly?

*filters badge indicator that will also clear filters
*change hide read filter to use actual checkbox
*clean up
@purpxd
Copy link
Author

purpxd commented Feb 18, 2025

Thanks for the feedback xgi. This commit should do it, cheers!

@purpxd purpxd force-pushed the ui-improvement/library-chaptertable branch from a7a7d11 to 8598129 Compare February 18, 2025 18:35
*removed overflow class in table div, it prevented sticky table headers
@purpxd purpxd force-pushed the ui-improvement/library-chaptertable branch from 8598129 to 88dc464 Compare February 24, 2025 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants