Conversation
…dgets Categorical bar widgets previously hard-coded their limit to 20 with no UI to change it. Add a NumberInput to the widget builder sort-by section that lets users configure the limit (1–25), which flows through to the per_page parameter on the /events/ API request. Extract DEFAULT_CATEGORICAL_BAR_LIMIT and MAX_CATEGORICAL_BAR_LIMIT constants to replace magic numbers. Use Flex gap for spacing instead of margin-bottom on styled components. Refs DAIN-1191 Co-Authored-By: Claude <noreply@anthropic.com>
Remove empty ResultsLimitSelector styled component and inline Select directly. Make maxLimit fallback explicit for non-timeseries, non-categorical-bar display types. Add disabled prop to NumberInput so the limit input is properly disabled when sort options are unavailable (e.g. Releases dataset with session.status column). Refs DAIN-1191 Co-Authored-By: Claude <noreply@anthropic.com>
Replace the bare NumberInput with the same "Limit to N results" Select dropdown used by timeseries charts. This makes the control self-describing and consistent across display types, instead of showing an unlabeled number field under the "Sort by" heading. Combines the timeseries and categorical bar limit into a single conditional block since they now render the same component. Refs DAIN-1191 Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
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.
static/app/views/dashboards/widgetBuilder/hooks/useWidgetBuilderState.tsx
Show resolved
Hide resolved
sortableWidget.tsx always passed TABLE_ITEM_LIMIT (20) as tableItemLimit, ignoring the widget's configured limit. The user's chosen limit only worked in the widget builder preview. Fall back to the constant when widget.limit is not set, preserving behavior for existing widgets. Refs DAIN-1191 Co-Authored-By: Claude <noreply@anthropic.com>
DominikB2014
approved these changes
Feb 11, 2026
Comment on lines
+377
to
+378
| expect(await screen.findByText('Sort by')).toBeInTheDocument(); | ||
| expect(screen.queryByText('Limit to 5 results')).not.toBeInTheDocument(); |
Contributor
There was a problem hiding this comment.
I'm kinda surprised there's no testId, or role we can use to find the sort selector
Member
Author
There was a problem hiding this comment.
Yeah, Select components are notoriously a bit hard to test, I don't know what the state-of-the-art is for that 🤔
static/app/views/dashboards/widgetBuilder/components/sortBySelector.tsx
Outdated
Show resolved
Hide resolved
Replace nested ternary for maxLimit with a switch on displayType for better readability. Simplify conditional checks to use maxLimit > 0 instead of separate boolean flags. Refs DAIN-1191 Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Aci
Admin
Agent
Agents
Ai Conversations
Ai Insights
Autofix
Autopilot
Billing
Cells
Code Review
Conversations
Copilot
Core
Crons Detector Schedule Preview
Dashboards
Dynamic Grouping
Dynamic Sampling
Eco
Explore
Grouping
Infra
Integrations
Issue Details
Issues
Js Loader
Lint
Llm Detection
Notifications
Oauth
Objectstore
Occurrences On Eap
Onboarding
Preprod
Replay
Replays
Search Agent
Seer
Seer Explorer
Sentry Apps
Settings
Spans
Spans Buffer
Toolbar
Trace
Tracemetrics
Ui
Uptime
Uptime Assertion Failure Data
Webhook
Other
Bug Fixes 🐛Aci
Agent Insights
Agents
Ai Conversations
Ai Insights
Alerts
Auth
Autofix
Autopilot
Billing
Cells
Code Mappings
Code Review
Codeowners
Cursor
Dashboards
Data Forwarding
Eap
Explore
Explorer
Forms
Github Copilot
Grouping
Infra
Insights
Issue Details
Issues
Lint
Logs
Notifications
Onboarding
Preprod
Releases
Replay
Seer
Settings
Span Buffer
Spans Migration
Stories
Tests
Top Issues
Trace Waterfall
Tracemetrics
Typing
Ui
Uptime
Users
Other
Documentation 📚
Internal Changes 🔧Aci
Agent
Agents
Alerts
Api
Autofix
Autopilot
Billing
Cells
Code Review
Code Review
Codeowners
Conversations
Cross Event
Dashboards
Deps
Dynamic Sampling
Eslint
Explorer
Forms
Grouping
Infra
Insights
Integrations
Issues
Llm Detection
Open Periods
Ownership
Preprod
Promotions
Relay
Replay
Routes
Scraps
Seer
Sentry Apps
Slack
Span Buffer
Spans
Stories
Tests
Theme
Tracemetrics
Ui
Uptime
Workflow Engine
Other
Other
Plus 102 more 🤖 This preview updates automatically when you update the PR. |
jaydgoss
pushed a commit
that referenced
this pull request
Feb 12, 2026
…107954) Categorical bar widgets previously hard-coded their result limit to 20 with no way for users to change it. This PR re-uses the current dropdown input (1–25) in the widget builder's sort-by section so users can configure how many categories are displayed. The chosen value flows through to the `per_page` parameter on the outgoing `/events/` API request. Closes DAIN-1191 **e.g.,** <img width="660" height="134" alt="Screenshot 2026-02-10 at 3 11 02 PM" src="https://github.com/user-attachments/assets/4f62d72c-703e-430c-813c-8cdd316fbc5f" /> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 task
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.
Categorical bar widgets previously hard-coded their result limit to 20 with no way for users to change it. This PR re-uses the current dropdown input (1–25) in the widget builder's sort-by section so users can configure how many categories are displayed. The chosen value flows through to the
per_pageparameter on the outgoing/events/API request.Closes DAIN-1191
e.g.,
