Skip to content

Add provider filter and expiry sorting to quota dashboard - #769

Merged
decolua merged 1 commit into
decolua:masterfrom
DEYLNN:feature-provider-quota-filter-sort
Apr 28, 2026
Merged

decolua merged 1 commit into
decolua:masterfrom
DEYLNN:feature-provider-quota-filter-sort

Conversation

@DEYLNN

@DEYLNN DEYLNN commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds lightweight controls to the quota dashboard so users can focus on a specific provider and optionally surface accounts whose quota reset/expiry time is soonest.

Changes

  • Add an All providers dropdown filter for quota providers.
  • Add an Expiring first toggle that sorts accounts by the earliest quota resetAt value.
  • Keep the existing provider order and alphabetical fallback when expiry sorting is disabled or dates are equal.

Why

For users with many provider accounts, it is easier to inspect quota status by provider and prioritize accounts with quotas that reset or expire soon.

Testing

  • npm run build

@decolua
decolua merged commit 296e21c into decolua:master Apr 28, 2026
luckystart79-lang pushed a commit to luckystart79-lang/minirouter that referenced this pull request May 2, 2026
Co-authored-by: Delynn Assistant <zhen@dkzhen.org>
caothu159 pushed a commit to diepxuan/9router that referenced this pull request May 14, 2026
Co-authored-by: Delynn Assistant <zhen@dkzhen.org>
diegosouzapw pushed a commit to diegosouzapw/OmniRoute that referenced this pull request Jun 21, 2026
Adds a single-select Provider dropdown alongside the existing
Status/Type/Tier/Env filters on the Quota dashboard. Selecting a
provider narrows visible accounts to that provider only; the choice
persists in localStorage (`omniroute:limits:providerFilter`) and
auto-falls back to "All providers" when the persisted key no longer
matches a connection in view. The dropdown only renders when there
are >=2 distinct providers so single-provider setups stay clean.

The provider key set is derived from `sortedConnections` (already
USAGE_SUPPORTED_PROVIDERS-filtered and OAuth/api-key-filtered upstream)
and the dropdown labels reuse the local `PROVIDER_LABEL` map, so the
list never includes providers the user can't actually inspect.

The upstream PR also added an "Expiring first" sort toggle. Skipped on
purpose: `visibleConnections` already always sorts by status group
(critical -> alert -> ok -> empty) and tie-breaks by soonest
`getSoonestResetMs` within each group, so the toggle would either be
redundant or weaker than the existing always-on behavior.

Filter + dropdown-options logic extracted to pure helpers in
`utils.tsx` (`matchesProviderFilter`, `buildProviderOptions`) so the
predicates are exercised by a Node native-runner unit test instead of
living inline in a React-only `useMemo`.

Inspired-by: decolua/9router#769
Co-authored-by: Zhen <zhen@dkzhen.org>
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