Skip to content

feat: Filter Kits and Assets by Custody on Locations view#2226

Merged
DonKoko merged 12 commits intoShelf-nu:mainfrom
manish-singh-bisht:feat/kit-assets-filter-locationView
Dec 8, 2025
Merged

feat: Filter Kits and Assets by Custody on Locations view#2226
DonKoko merged 12 commits intoShelf-nu:mainfrom
manish-singh-bisht:feat/kit-assets-filter-locationView

Conversation

@manish-singh-bisht
Copy link
Copy Markdown
Contributor

closes #2172

Code style follows the existing filters.

FILTER.webm

@vercel
Copy link
Copy Markdown

vercel bot commented Dec 1, 2025

@manish-singh-bisht is attempting to deploy a commit to the Whaleagency Team on Vercel.

A member of the Team first needs to authorize it.

@manish-singh-bisht
Copy link
Copy Markdown
Contributor Author

manish-singh-bisht commented Dec 1, 2025

@DonKoko ready for review

the ui for this new filter looks a bit bad to me, would appreciate some design to make it look better if you feel the same about the ui.

@carlosvirreira
Copy link
Copy Markdown
Contributor

Are you in our discord? Can you add me as a friend? https://discord.gg/W9CHm7eu

@manish-singh-bisht
Copy link
Copy Markdown
Contributor Author

Are you in our discord? Can you add me as a friend? https://discord.gg/W9CHm7eu

sent a friend request

@carlosvirreira
Copy link
Copy Markdown
Contributor

Hi @manish-singh-bisht thanks for the PR. In terms of placement. You could place it next to the search bar as we have on the assets tab. I think that this will make it so that when we filter the UI does not jump around. Thanks!

Screenshot 2025-12-03 at 11 37 50

@DonKoko DonKoko moved this to 🏗 In progress in 🗺️ Shelf Roadmap Dec 4, 2025
@DonKoko DonKoko moved this from 🏗 In progress to 👀 In review in 🗺️ Shelf Roadmap Dec 4, 2025
@vercel
Copy link
Copy Markdown

vercel bot commented Dec 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
shelf-docs Ignored Ignored Preview Dec 8, 2025 7:56pm

Copy link
Copy Markdown
Contributor

@DonKoko DonKoko left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Here are some issues that need to be addressed:

  • If we are going to be filtering by custodian, we should also add a custodian column in the tables to make the UX complete. Now when I filter, I have no way to verify the results I get are correct.
  • The location of the custodian filter button is not ideal, it looks out of place. Can you place it on the left side, next to the sorting, as Carlos suggested
  • Missing "Without Custody" Support for Kits

In app/modules/location/service.server.ts at line 1015, the kit filtering logic does NOT handle the special "without-custody" value, but the assets filtering does (line 93):

Assets filter (CORRECT):

if (teamMemberIds && teamMemberIds.length) {
  assetsWhere.OR = [
    // ... other conditions
    ...(teamMemberIds.includes("without-custody")
      ? [{ custody: null }]
      : []),
  ];
}

Kits filter (MISSING):

if (teamMemberIds && teamMemberIds?.length) {
  kitWhere.custody = {
    custodianId: {
      in: teamMemberIds,
    },
  };
}

The kits route UI includes the withoutValueItem prop (line 183 in the assets route), but it's MISSING from the kits route. Users can select "Without custody" for assets but not for kits, and even if they could, it wouldn't work server-side.

  • Kit Filtering Logic is Too Restrictive

The kit filter only checks custody.custodianId, but the assets filter checks multiple conditions:

  • Direct custody by team member
  • Custody by the team member's linked user
  • Ongoing/overdue bookings with the team member as custodian

For consistency, kits should support the same filtering patterns as assets.


These are the major stuff I have found. Please address them and update your PR. Let me know if you have any questions.

@manish-singh-bisht
Copy link
Copy Markdown
Contributor Author

@DonKoko updated the pr

custodian column
correct placement of the filter
inclusion of the "without custody" for kits filter
kit filter have same filtering pattern as assets

filter2.webm

@DonKoko
Copy link
Copy Markdown
Contributor

DonKoko commented Dec 8, 2025

@manish-singh-bisht i did some adjustments to the styles and deploying it to our staging for final testing. If all is good we will merge.

@carlosvirreira
Copy link
Copy Markdown
Contributor

@DonKoko tested it- functionality wise it works well - could we add a chevron down to make the button a bit more obvious? Kind of like our 'sort by' ascending/descending.

Copy link
Copy Markdown
Contributor

@DonKoko DonKoko left a comment

Choose a reason for hiding this comment

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

We are good to go. I just made some styling changes 🤟🏼

@DonKoko DonKoko merged commit 8ff539b into Shelf-nu:main Dec 8, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in 🗺️ Shelf Roadmap Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

[Feature request]: Filter Kits and Assets by Custody on Locations view

3 participants