fix(ui): wire the /surfaces public_safe/auth/rate_limited filter shortcuts (#3975)#4950
Conversation
…tcuts (JSONbored#3975) The nav mega-menu links to `/surfaces?public_safe=1`, `?auth=required`, and `?rate_limited=1`, but `surfaces.tsx` validated against the shared `tableSearchSchema` (which has none of those params) and its filter predicate never read them — so all three shortcuts silently rendered the unfiltered list. Add a surfaces-local `surfacesSearchSchema` that extends the shared schema with the three params (kept off `tableSearchSchema` so the sibling /subnets route stays lean), and move the row predicate into a pure, unit-tested `matchesSurfaceFilters`: `public_safe` → `s.public_safe`, `auth` → `s.auth_required` (required/none), `rate_limited` → the per-row `rate_limit_notes`. The reset action and active-filter indicator now account for the three params too. Closes JSONbored#3975
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4950 +/- ##
=======================================
Coverage 97.93% 97.93%
=======================================
Files 163 163
Lines 19389 19389
Branches 7364 7364
=======================================
Hits 18989 18989
Misses 53 53
Partials 347 347 🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-13 00:34:02 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 6 non-blocking
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|


Summary
Closes #3975
The nav mega-menu links to
/surfaces?public_safe=1,?auth=required, and?rate_limited=1, butsurfaces.tsxvalidated against the sharedtableSearchSchema(no such params) and its predicate never read them — so all three shortcuts silently rendered the unfiltered list.This adds a surfaces-local
surfacesSearchSchema(extends the shared schema, so the sibling /subnets schema stays lean) and moves the row predicate into a pure, unit-testedmatchesSurfaceFilters:public_safe→s.public_safe,auth→s.auth_required(required/none),rate_limited→ the per-rowrate_limit_notes. Reset + active-filter indicator now cover them too.Gates
typecheck ✓ · unit tests ✓ (8 new: every filter branch) · prettier ✓ · build ✓ · responsive-overflow e2e ✓
Screenshots
Shown on
?auth=required(the demonstrable case: 188 → 2 rows). All 3 filters are covered by the 8 unit tests.filter ignored — full list
2 auth-gated surfaces
filter ignored — full list
2 auth-gated surfaces
filter ignored — full list
2 auth-gated surfaces
filter ignored — full list
2 auth-gated surfaces
filter ignored — full list
2 of 1598
filter ignored — full list
2 of 1598