Skip to content

feat(service-providers): default to reachable nodes and add endorsed provider badge#269

Open
beck-8 wants to merge 7 commits intoFilOzone:mainfrom
beck-8:feat/service-providers-reachable-endorsed
Open

feat(service-providers): default to reachable nodes and add endorsed provider badge#269
beck-8 wants to merge 7 commits intoFilOzone:mainfrom
beck-8:feat/service-providers-reachable-endorsed

Conversation

@beck-8
Copy link
Copy Markdown
Contributor

@beck-8 beck-8 commented Mar 19, 2026

📝 Description

  1. Adds a default accessibility filter so only reachable providers are shown by default.
  2. Marks approved providers with an 🏅 badge and adds a footnote explaining the badge.

ps:

  1. Use the version field to determine whether it is reachable. This is the interface of curio. Unreachable means that the service is unavailable or the network is unreachable. The field level may cause the reviewer to raise a question, so I will clarify it here.
  2. The filter count will display 1 by default, which is also my intention. Let incoming users know that reachable SP nodes are filtered by default.

📸 Screenshots

image image image

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 19, 2026

@beck-8 is attempting to deploy a commit to the FilOz Team on Vercel.

A member of the Team first needs to authorize it.

@beck-8
Copy link
Copy Markdown
Contributor Author

beck-8 commented Mar 19, 2026

@mirhamasala If you have time, please take a look at this, thank you

cc @jennijuju

@mirhamasala mirhamasala requested a review from Copilot March 19, 2026 09:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 softwareVersion column.

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.

Comment on lines 27 to 31
const DEFAULT_REACHABLE_FILTER = ['true']

const filterParsers = {
status: parseAsArrayOf(parseAsString).withDefault([]),
location: parseAsArrayOf(parseAsString).withDefault([]),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is intentional

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@CharlyMartin CharlyMartin self-requested a review March 23, 2026 11:43
Copy link
Copy Markdown
Collaborator

@CharlyMartin CharlyMartin left a comment

Choose a reason for hiding this comment

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

Left a few inline comments.

},
sortingFn: sortSoftwareVersion,
sortUndefined: 'last',
filterFn: reachableFilterFn,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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']
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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>
Copy link
Copy Markdown
Collaborator

@CharlyMartin CharlyMartin Mar 25, 2026

Choose a reason for hiding this comment

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

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)
Copy link
Copy Markdown
Collaborator

@CharlyMartin CharlyMartin Mar 25, 2026

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, pdp has a dedicated endpoint /pdp/ping, and I'm being lazy or changing as little as possible, so I did.

description: string
address: string
serviceUrl: string
isApproved?: boolean
Copy link
Copy Markdown
Collaborator

@CharlyMartin CharlyMartin Mar 25, 2026

Choose a reason for hiding this comment

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

Since column-definition.tsx always passes row.isApproved, this could be required instead of optional with a default. Makes the data contract more explicit.

@beck-8
Copy link
Copy Markdown
Contributor Author

beck-8 commented Mar 26, 2026

@CharlyMartin Please take a look again

@beck-8
Copy link
Copy Markdown
Contributor Author

beck-8 commented Mar 26, 2026

Endorsed Provider (approved list)

here is the approved list, but I wrote Endorsed , I'm not sure if there is any controversy here.

@beck-8
Copy link
Copy Markdown
Contributor Author

beck-8 commented Mar 26, 2026

image

@CharlyMartin CharlyMartin self-requested a review March 26, 2026 15:46
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