-
Notifications
You must be signed in to change notification settings - Fork 55
Chapter Table UI Improvements #403
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
base: master
Are you sure you want to change the base?
Conversation
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
✅ Deploy Preview for houdoku ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
xgi
left a comment
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.
A few minor comments but this looks great. Thanks!
| <span>Read</span> | ||
| </div> | ||
| </DropdownMenuItem> | ||
| <DropdownMenuSeparator /> |
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.
remove this separator
| <span>All Chapters</span> | ||
| </div> | ||
| </DropdownMenuItem> | ||
| <DropdownMenuSeparator /> |
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.
remove this separator
| 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> | ||
| ); |
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.
- 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>
);| <Button variant="outline"> | ||
| <Filter className="w-4 h-4" /> | ||
| Filters | ||
| </Button> |
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.
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()) |
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.
remove this
| {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> | ||
| </> | ||
| )} |
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.
You can just get rid of these buttons
| const chapterListChOrder = get(chapterListChOrderState); | ||
|
|
||
| const uniqueChapters = new Map(); | ||
| const toggleReadChapters = get(ReadChaptersState); |
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.
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
|
Thanks for the feedback xgi. This commit should do it, cheers! |
a7a7d11 to
8598129
Compare
*removed overflow class in table div, it prevented sticky table headers
8598129 to
88dc464
Compare
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