feat(service-providers): default to reachable nodes and add endorsed provider badge#269
feat(service-providers): default to reachable nodes and add endorsed provider badge#269beck-8 wants to merge 7 commits intoFilOzone:mainfrom
Conversation
|
@beck-8 is attempting to deploy a commit to the FilOz Team on Vercel. A member of the Team first needs to authorize it. |
|
@mirhamasala If you have time, please take a look at this, thank you cc @jennijuju |
There was a problem hiding this comment.
Pull request overview
Adds a default “reachable/accessible” filter to the Service Providers table and introduces an “Endorsed Provider” badge for approved providers to improve default usability and trust signaling within the service-providers UI.
Changes:
- Default filter state now includes a “reachable” (software version present) constraint and a corresponding ReachableFilter UI.
- Approved providers are marked with a 🏅 badge in the provider name cell and explained via a table footnote.
- Table column filtering is wired to apply the new reachable filter on the
softwareVersioncolumn.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/ProviderOverview.tsx | Adds isApproved prop and renders 🏅 badge next to provider name when approved. |
| src/app/service-providers/utils/service-provider-filters.ts | Adds reachableFilterFn to filter by accessibility via softwareVersion presence. |
| src/app/service-providers/utils/map-filter-state-to-column-filters.ts | Maps reachable query state to a column filter on softwareVersion. |
| src/app/service-providers/hooks/use-filter-query-state.ts | Adds reachable to filter state with a default of ['true']. |
| src/app/service-providers/data/column-definition.tsx | Passes isApproved to ProviderOverview and attaches reachableFilterFn to the version column. |
| src/app/service-providers/components/ServiceProvidersTable.tsx | Adds footnote explaining the 🏅 badge. |
| src/app/service-providers/components/ReachableFilter.tsx | New filter UI (Accessible/Unavailable) that toggles the reachable query state. |
| src/app/service-providers/components/MobileTableFilters.tsx | Includes ReachableFilter in the mobile filters panel. |
| src/app/service-providers/components/DesktopTableFilters.tsx | Includes ReachableFilter in the desktop filters popover. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| const DEFAULT_REACHABLE_FILTER = ['true'] | ||
|
|
||
| const filterParsers = { | ||
| status: parseAsArrayOf(parseAsString).withDefault([]), | ||
| location: parseAsArrayOf(parseAsString).withDefault([]), |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| }, | ||
| sortingFn: sortSoftwareVersion, | ||
| sortUndefined: 'last', | ||
| filterFn: reachableFilterFn, |
There was a problem hiding this comment.
The reachable filter is attached to the softwareVersion column, which means this column now carries two concerns (displaying version + filtering reachability). If another filter is ever applied to this column, they'd conflict. Worth considering a dedicated virtual/computed column for reachability to keep things clean and make the relationship explicit.
| reachable: Array<string> | ||
| } | ||
|
|
||
| const DEFAULT_REACHABLE_FILTER = ['true'] |
There was a problem hiding this comment.
Since the default is ['true'], activeFilterCount starts at 1 and hasActiveFilters is true on first load. Does clearFilterQueries (which sets to null) reset back to this default or to empty? If it resets to ['true'], there's no way for users to truly "show all" via the clear button.
| provingPeriodMax: number | null | ||
| ipni: Array<string> | ||
| serviceTier: Array<ServiceTier> | ||
| reachable: Array<string> |
There was a problem hiding this comment.
This is typed as Array<string> but the only valid values are 'true' and 'false'. Could use a stricter type like Array<'true' | 'false'> to catch misuse at compile time — similar to how serviceTier uses a specific union.
| const reachableArray = filterValue as FilterState['reachable'] | ||
| if (reachableArray.length === 0) return true | ||
|
|
||
| const isAccessible = Boolean(row.original.softwareVersion) |
There was a problem hiding this comment.
Using softwareVersion truthiness as a proxy for reachability is indirect. If a provider has an empty string version or any other falsy-but-valid value, it'd be incorrectly marked as unreachable. Might be worth a comment explaining this proxy, or better yet, a dedicated field if the API supports it.
There was a problem hiding this comment.
Yes, pdp has a dedicated endpoint /pdp/ping, and I'm being lazy or changing as little as possible, so I did.
src/components/ProviderOverview.tsx
Outdated
| description: string | ||
| address: string | ||
| serviceUrl: string | ||
| isApproved?: boolean |
There was a problem hiding this comment.
Since column-definition.tsx always passes row.isApproved, this could be required instead of optional with a default. Makes the data contract more explicit.
|
@CharlyMartin Please take a look again |
|

📝 Description
ps:
📸 Screenshots