-
-
Notifications
You must be signed in to change notification settings - Fork 839
feat(web): #872 bulk tag deletion #900
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
Conversation
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.
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]); |
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.
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.
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.
Fixed in ffef39a
const pathname = usePathname(); | ||
const [currentPathname, setCurrentPathname] = useState(""); | ||
|
||
useEffect(() => { | ||
if (pathname !== currentPathname) { | ||
setCurrentPathname(pathname); | ||
setIsBulkEditEnabled(false); | ||
} | ||
}, [pathname, currentPathname]); |
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.
Should we maybe here do an unmount hook instead?
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 are right. Fixed in ffef39a
onPressedChange={setIsBulkEditEnabled} | ||
> | ||
<Pencil className="mr-2 size-4" /> | ||
Bulk Edit |
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.
We have a translation for this in actions.bulk_edit
that we can use.
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.
Thank you! Change it to use translation in ffef39a
<InfoTooltip size={15} className="my-auto ml-2" variant="explain"> | ||
<p>Bulk Edit Tags</p> | ||
</InfoTooltip> |
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.
This is probably redundant, we can remove it
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.
Removed in ffef39a
apps/web/lib/bulkTagActions.ts
Outdated
selectedTags: ZTagBasic[]; | ||
visibleTags: ZTagBasic[]; |
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.
Does the store actually care about the name of the tag or is the ids enough?
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.
No we don't need the name. Fixed it in ffef39a
Thank you for your review! That's totally fine, if there's any issue please feel free to request other changes |
Thanks a lot @lexafaxine for addressing the feedback and for the PR! |
#872
Add bulk tag deletion feature
Changes
Demo video
https://drive.google.com/file/d/192R-6t2cZPy2g8Dn_9BIRtrONs-Ir38z/view?usp=sharing