Skip to content

Fix OAuth provider search ordering#3062

Merged
HarshMN2345 merged 1 commit into
mainfrom
fix-oauth-provider-search-order
May 26, 2026
Merged

Fix OAuth provider search ordering#3062
HarshMN2345 merged 1 commit into
mainfrom
fix-oauth-provider-search-order

Conversation

@HarshMN2345
Copy link
Copy Markdown
Member

@HarshMN2345 HarshMN2345 commented May 26, 2026

What does this PR do?

image

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 26, 2026

Greptile Summary

This PR adds a live search box to the OAuth2 Providers section of the auth settings page, filtering providers by name or key, and also fixes the secondary sort order so providers with the same enabled-state are now sorted alphabetically rather than by original array order.

  • Introduces filteredOAuthProviders as a $derived.by that filters by oauthProviderSearch and sorts by enabled-first then localeCompare; the old template loop with inline .filter().sort() is replaced entirely.
  • Adds InputSearch to the providers header, a responsive CSS layout for the new header row, and an empty-state message when no providers match the query.

Confidence Score: 4/5

Safe to merge — the change is self-contained to a single settings page, and the core filtering and sorting logic is correct.

The filtering and sorting logic works correctly for all normal cases. The only issue is that the empty-state copy always says 'match your search' regardless of whether a search term is present, which could appear confusing in the edge case where all providers are filtered as internal/mock.

src/routes/(console)/project-[region]-[project]/auth/settings/+page.svelte — empty-state message wording when no search term is active.

Important Files Changed

Filename Overview
src/routes/(console)/project-[region]-[project]/auth/settings/+page.svelte Adds OAuth2 provider search with InputSearch, a filteredOAuthProviders derived state, empty-state UI, and responsive CSS. Logic is sound; minor issue with the empty-state message copy when no search term is active.

Reviews (1): Last reviewed commit: "Fix OAuth provider search ordering" | Re-trigger Greptile

Comment on lines +274 to +276
<div class="oauth-providers-empty">
<Typography.Text>No OAuth2 providers match your search.</Typography.Text>
</div>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 The empty-state message always says "No OAuth2 providers match your search." even when oauthProviderSearch is empty (''). In that case the if (!search) return true branch makes the filter pass every valid provider, so the empty state would only be reached when all providers have been filtered by the !oAuthProvider || oAuthProvider.internal / mock checks — not because of a search. A conditional message keeps the copy accurate.

Suggested change
<div class="oauth-providers-empty">
<Typography.Text>No OAuth2 providers match your search.</Typography.Text>
</div>
<div class="oauth-providers-empty">
<Typography.Text>
{oauthProviderSearch.trim()
? 'No OAuth2 providers match your search.'
: 'No OAuth2 providers available.'}
</Typography.Text>
</div>

@HarshMN2345 HarshMN2345 requested a review from Meldiron May 26, 2026 07:19
@HarshMN2345 HarshMN2345 merged commit 6d4b05f into main May 26, 2026
4 checks passed
@HarshMN2345 HarshMN2345 deleted the fix-oauth-provider-search-order branch May 26, 2026 07:36
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.

2 participants