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

✨ Fetch workspace data in batches and add advanced filtering #206

Merged
merged 10 commits into from
Oct 4, 2024

Conversation

foysalit
Copy link
Contributor

@foysalit foysalit commented Sep 30, 2024

Depends on bluesky-social/atproto#2836

Use the newly available getRepos and getRecords endpoints to bulk fetch data for workspace items. This also allows us to provide additional context to workspace items without expanding into full view mode per item.

Screenshot 2024-09-30 at 17 09 32

This PR also adds a way to filter items from the workspace based on a combination of options among accounts and other content type which allows mods to select/unselect items from workspace in batches.

Screenshot 2024-10-04 at 20 46 33

@arcalinea arcalinea temporarily deployed to workspace-bulk-fetch-repos-records - ozone-staging PR #206 October 4, 2024 18:44 — with Render Destroyed
@foysalit foysalit changed the title ✨ Fetch workspace data in batches using getRepos and getRecords ✨ Fetch workspace data in batches and add advanced filtering Oct 4, 2024
@@ -106,7 +106,7 @@ export const ModerationLabel = ({
})

return (
<Popover className="relative">
<Popover className="relative z-20">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this known z-index value helps us overlap other content on labels.

}: {
listData: WorkspaceListData | undefined
}) => {
const [filters, setFilters] = useState({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this can be cleaned up a bit bit it's not bad for a very isolated component.

const handleRemoveSelected = () => {
const selectedItems = Array.from(
formRef.current?.querySelectorAll<HTMLInputElement>(
'input[type="checkbox"][name="workspaceItem"]:checked',
) || [],
).map((checkbox) => checkbox.value)
removeItemsMutation.mutate(selectedItems)
removeItemsMutation.mutate(selectedItems as string[])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are the checkbox values always strings, never e.g. undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, these checkboxes always carry the value of the did/uri

Copy link
Collaborator

@devinivy devinivy left a comment

Choose a reason for hiding this comment

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

Nice 👍

@foysalit foysalit merged commit 5d6b019 into main Oct 4, 2024
3 checks passed
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.

3 participants