Skip to content

fix(dashboard): source logs filter options from full value universe#3093

Merged
chase-crumbaugh merged 1 commit into
mainfrom
sagar/age-2594-bug-filters-on-logs-page-get-stuck-if-there-are-no-results
May 28, 2026
Merged

fix(dashboard): source logs filter options from full value universe#3093
chase-crumbaugh merged 1 commit into
mainfrom
sagar/age-2594-bug-filters-on-logs-page-get-stuck-if-there-are-no-results

Conversation

@simplesagar
Copy link
Copy Markdown
Member

@simplesagar simplesagar commented May 28, 2026

What

Fixes AGE-2594. The server/user filter dropdowns on the Tool Logs and Insights → Tools pages got stuck whenever a filter returned no results, and only ever offered values that happened to be in the already-loaded rows.

Why

Both pages share useObserveFilters, which built serverOptions / userEmailOptions from knownServers / knownUserEmails — sets accumulated only from loaded result rows and reset on every date-range change. When a filter matched nothing, no new values were added, so the dropdown collapsed to just the currently-selected value. You could clear a filter but couldn't pivot to a different one.

How

  • Added a single getHooksSummary query keyed only on the time range (no server/email/type filters), so it returns the full universe of servers and users for the window regardless of the filtered result set.
  • Derive serverOptions from servers[].serverName and userEmailOptions from users[].userEmail, unioned with any currently-selected URL values.
  • Excluded the 'local' / 'Unknown' display sentinels — they never round-trip as real filter values (also removes a silently-broken 'local' option Insights used to show).
  • Removed the now-dead knownServers / knownUserEmails state, the addKnown* callbacks, the reset effect, and four accumulation useEffects. Net −24 lines.

The query is keyed on [from, to] only, so it's shared across both pages and across filter changes (one cache entry per time window), and the universe is now derived during render instead of synced via effects.

Scope

Frontend-only — no backend, migration, or SDK changes.

Testing

  • tsc -p tsconfig.app.json --noEmit — clean on all changed files.
  • eslint — clean on all changed files.
  • Not yet click-tested against a live dashboard with real telemetry.

Summary by cubic

Fixes AGE-2594: server and user filters on Tool Logs and Insights → Tools no longer get stuck when a filter returns no results. Dropdowns now show the full set of servers and users for the selected time range so you can pivot filters even with empty results.

  • Bug Fixes
    • Added a [from, to]-keyed useQuery using @gram/client/funcs/telemetryGetHooksSummary (via @tanstack/react-query) to fetch the full universe of servers/users for the window, independent of active filters.
    • Build serverOptions from servers[].serverName and userEmailOptions from users[].userEmail, unioned with currently selected values; exclude the display-only sentinels "local" and "Unknown".
    • Removed knownServers/knownUserEmails state and related effects/callbacks, simplifying the hook and preventing option collapse on no-result filters.

Written for commit cbfaab7. Summary will update on new commits.

Review in cubic

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@simplesagar simplesagar requested a review from a team as a code owner May 28, 2026 22:26
@simplesagar simplesagar added the bug Something isn't working label May 28, 2026
@simplesagar simplesagar requested a review from a team as a code owner May 28, 2026 22:26
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 28, 2026

AGE-2594

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 28, 2026

⚠️ No Changeset found

Latest commit: cbfaab7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment May 28, 2026 10:26pm

Request Review

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Re-trigger cubic

@simplesagar simplesagar added the preview Spawn a preview environment label May 28, 2026
@speakeasybot
Copy link
Copy Markdown
Collaborator

speakeasybot commented May 28, 2026

🚀 Preview Environment (PR #3093)

Preview URL: https://pr-3093.dev.getgram.ai

Component Status Details Updated (UTC)
✅ Database Ready Created and validated 2026-05-28 22:34:39.
✅ Images Available Container images ready 2026-05-28 22:34:23.

Gram Preview Bot

@chase-crumbaugh chase-crumbaugh added this pull request to the merge queue May 28, 2026
Merged via the queue into main with commit a20cd4f May 28, 2026
92 checks passed
@chase-crumbaugh chase-crumbaugh deleted the sagar/age-2594-bug-filters-on-logs-page-get-stuck-if-there-are-no-results branch May 28, 2026 22:52
@github-actions github-actions Bot locked and limited conversation to collaborators May 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working preview Spawn a preview environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants