Skip to content

Conversation

lexafaxine
Copy link
Contributor

@lexafaxine lexafaxine commented Jan 18, 2025

#872

Add bulk tag deletion feature

Changes

  • Added bulk selection mode toggle for tags
  • Added bulk actions toolbar with:
    • Select/Unselect all tags option
    • Delete selected tags action
    • Confirmation dialog for bulk deletion

Demo video

https://drive.google.com/file/d/192R-6t2cZPy2g8Dn_9BIRtrONs-Ir38z/view?usp=sharing

Copy link
Collaborator

@MohamedBassem MohamedBassem left a comment

Choose a reason for hiding this comment

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

Hey, I'm really sorry for the delay in the review. Overall, the change looks good to me. I've requested some changes that shouldn't take long to address and then we'll be able to merge this PR!

return () => {
setVisibleTags([]);
};
}, [initialData]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmmm, I don't think you should depend on initial data because it means you'll miss the updates after the first server side rendering. You should depend on data that's coming out of react query later in the function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in ffef39a

Comment on lines 37 to 45
const pathname = usePathname();
const [currentPathname, setCurrentPathname] = useState("");

useEffect(() => {
if (pathname !== currentPathname) {
setCurrentPathname(pathname);
setIsBulkEditEnabled(false);
}
}, [pathname, currentPathname]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we maybe here do an unmount hook instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. Fixed in ffef39a

onPressedChange={setIsBulkEditEnabled}
>
<Pencil className="mr-2 size-4" />
Bulk Edit
Copy link
Collaborator

Choose a reason for hiding this comment

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

We have a translation for this in actions.bulk_edit that we can use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! Change it to use translation in ffef39a

Comment on lines 132 to 134
<InfoTooltip size={15} className="my-auto ml-2" variant="explain">
<p>Bulk Edit Tags</p>
</InfoTooltip>
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 probably redundant, we can remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in ffef39a

Comment on lines 6 to 7
selectedTags: ZTagBasic[];
visibleTags: ZTagBasic[];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the store actually care about the name of the tag or is the ids enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No we don't need the name. Fixed it in ffef39a

@lexafaxine
Copy link
Contributor Author

Hey, I'm really sorry for the delay in the review. Overall, the change looks good to me. I've requested some changes that shouldn't take long to address and then we'll be able to merge this PR!

Thank you for your review! That's totally fine, if there's any issue please feel free to request other changes

@MohamedBassem MohamedBassem merged commit f9c2557 into karakeep-app:main Feb 9, 2025
4 checks passed
@MohamedBassem
Copy link
Collaborator

Thanks a lot @lexafaxine for addressing the feedback and for the PR!

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