feat(custom-fields): add usage count column to Custom Fields list#2250
Merged
feat(custom-fields): add usage count column to Custom Fields list#2250
Conversation
Add a "Used on" column to the Custom Fields settings page that displays the number of assets using each custom field. This helps admins identify unused or underutilized custom fields that may create UI clutter. The count is computed by querying the AssetCustomFieldValue table and grouping by customFieldId. The count updates on page load and shows "0 assets" for unused fields, "1 asset" for single use, or "X assets" for multiple uses. Changes: - Update getFilteredAndPaginatedCustomFields service to fetch and attach usage counts using Prisma groupBy query - Add "Used on" column header in the Custom Fields list UI - Display usage count in TeamMemberRow component with proper formatting
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
DonKoko
previously approved these changes
Jan 7, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a "Used on" column to the Custom Fields settings page to display how many assets are using each custom field. This helps administrators identify unused or underutilized custom fields that may contribute to UI clutter.
Key changes:
- Enhanced the
getFilteredAndPaginatedCustomFields()service to compute usage counts via a Prisma groupBy query on AssetCustomFieldValue records - Added a new "Used on" table column with proper singular/plural formatting ("1 asset" vs "X assets")
- Updated TypeScript types to include
usageCountin the custom field payload
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| app/modules/custom-field/service.server.ts | Added parallel query to fetch usage counts using groupBy, created a Map for efficient lookup, and attached counts to custom field records |
| app/routes/_layout+/settings.custom-fields.index.tsx | Added "Used on" column header, updated TypeScript type definition to include usageCount, and implemented conditional formatting for the count display |
DonKoko
approved these changes
Jan 7, 2026
Contributor
Author
|
thanks for deploying! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a "Used on" column to the Custom Fields settings page that displays
the number of assets using each custom field. This helps admins identify
unused or underutilized custom fields that may create UI clutter.
Changes
getFilteredAndPaginatedCustomFields()service to fetch usagecounts using Prisma groupBy query on AssetCustomFieldValue table
Implementation Details
The usage count is computed by counting distinct assets with non-null values
for each custom field. The query runs on page load and uses an efficient
Map-based lookup to attach counts to custom field records.
Acceptance Criteria Met
Files Changed
app/modules/custom-field/service.server.tsapp/routes/_layout+/settings.custom-fields.index.tsx