feat(dashboard): add pagination and glob filtering to dashboard list#560
Merged
feat(dashboard): add pagination and glob filtering to dashboard list#560
Conversation
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Dashboard
Other
Bug Fixes 🐛Dashboard
Other
Internal Changes 🔧Coverage
Other
🤖 This preview updates automatically when you update the PR. |
e2e4e14 to
6aeebbd
Compare
Contributor
Codecov Results 📊✅ 126 passed | Total: 126 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 97.68%. Project has 1271 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 95.37% 95.40% +0.03%
==========================================
Files 194 194 —
Lines 27448 27655 +207
Branches 0 0 —
==========================================
+ Hits 26178 26384 +206
- Misses 1270 1271 +1
- Partials 0 0 —Generated by Codecov Action |
- Replace listDashboards() with listDashboardsPaginated() returning
PaginatedResponse with cursor support via Link header parsing
- Rewrite dashboard list command using buildListCommand with auto-injected
--cursor/-c and --fresh/-f flags
- Add positional name argument with glob filtering (case-insensitive via
Bun.Glob). Supports: 'Error*', '*API*', 'My Dashboard' (space = filter)
- Add extended cursor encoding (serverCursor|dashboardId) for mid-page
resume when client-side filtering fills --limit partway through a page
- Auto-paginate when --limit exceeds API_MAX_PER_PAGE (100)
- Support bare org slug as first arg: 'sentry dashboard list my-org Error*'
normalizes to org/ format for parseOrgProjectArg
- Fix parseDashboardPositionalArgs bare-org normalization (affects view,
widget add/edit/delete commands too)
- Update resolveDashboardId to paginate through all dashboards and use
fuzzyMatch() for error suggestions instead of listing all titles
- JSON output uses { data, hasMore, nextCursor? } paginated envelope
- Add AGENTS.md rules: auto-pagination for large limits, fuzzy suggestions
in resolution errors
- Update dashboard view examples to show bare org and org/project patterns
…arch A bare word like 'CLI' or 'Performance' was being routed through project-search, which resolveOrgFromTarget silently ignores for dashboards (they're org-scoped). Now any single arg without '/' is always a title filter. To specify an org, use 'org/' or two args.
'sentry dashboard list sentry/cli/CLI' now correctly splits into target='sentry/cli' and filter='CLI'. Previously all slash-containing single args were treated as targets, so the name portion was ignored. Split logic: 1 slash = target only (org/ or org/project), 2+ slashes = org/project/name where name becomes the title filter.
'sentry dashboard list sentry/cli CLI Health' arrives as 4 args. The filter now joins args[1:] with spaces so unquoted multi-word titles work: ['sentry/cli', 'CLI', 'Health'] → filter='CLI Health'.
When a title filter produces zero results, show up to 5 fuzzy-matched similar dashboard titles in the hint instead of a bare 'No dashboards found.' message. Uses the same fuzzyMatch() utility as resolveDashboardId. Example: 'sentry dashboard list my-org/ clil' might suggest 'CLI'.
The fuzzy suggestions for no-match filters were in the hint (footer) while the formatter independently showed 'No dashboards found.' — producing duplicate messaging. Now the formatter receives titleFilter and allTitles in the result, and shows the appropriate message: - With filter, has suggestions: 'No dashboards matching X. Did you mean:' - With filter, no suggestions: 'No dashboards matching X.' - Without filter: 'No dashboards found.'
1. processPage: if bookmarked dashboard ID was deleted between requests, use findIndex + fallback to process entire page (no silent skip). 2. parseDashboardListArgs: filter out undefined/empty args that buildListCommand's interceptSubcommand injects. 3. Include titleFilter in pagination context key so different filter queries don't share cursors.
64d6c9f to
38767e1
Compare
The -c last hint now includes the filter arg so the suggested command matches the stored cursor's context key. Without it, following the hint after a filtered query would fail with 'No saved cursor for this query'.
BYK
commented
Mar 25, 2026
- Add descriptive placeholder 'org/title-filter' for array positional (SKILL.md now shows '<org/title-filter...>' instead of '<args...>') - Remove all ASCII art separator dividers (// --------) per style rules - Regenerate SKILL.md
The glob matching lowercases the filter but the context key stored it in original case, so 'Error*' and 'error*' stored separate cursors despite producing identical results.
…views Strip glob metacharacters (*?[]) from the filter before passing to fuzzyMatch so they don't inflate Levenshtein distances. 'Error*' now correctly suggests 'Error Rate' etc.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Add cursor-based pagination and client-side glob filtering to
dashboard list, plus bare-org slug support across all dashboard commands.Changes
API Layer
listDashboards()withlistDashboardsPaginated()returningPaginatedResponsewith cursor support via Link header parsingDashboard List Command
buildListCommandwith auto-injected--cursor/-cand--fresh/-fflags'Error*','*API*'), and multi-word unquoted titles all workBun.Globorg/project/nameas single arg (splits on second/)serverCursor|dashboardId) for mid-page resume when filtering fills--limitpartway through a server page--limitexceedsAPI_MAX_PER_PAGE(100)fuzzyMatch()) when filter matches nothing{ data, hasMore, nextCursor? }paginated envelopeDashboard Resolve
sentry dashboard list my-org 'Error*'andsentry dashboard view my-org 12345now work (auto-appends/when first arg has no/)resolveDashboardId()paginates through all dashboards and usesfuzzyMatch()for error suggestions instead of overwhelming full listingsAGENTS.md
--limit > API_MAX_PER_PAGEExamples
Test Plan
list.test.tsandresolve.test.tscovering pagination, glob filtering, cursor encoding/decoding, bare-org normalization, multi-word args, fuzzy suggestions, andorg/project/namesplitting