fix(dashboards): Reject new widgets with deprecated display types#113294
Merged
DominikB2014 merged 2 commits intoApr 17, 2026
Conversation
The widget builder dropdown and widget library no longer expose stacked_area, and TOP_N is converted to AREA at every UI entry point (getTopNConvertedDefaultWidgets, deserializeDisplayType, typeSelector). The backend, however, still accepts both via the dashboards POST and PUT endpoints, so an API-direct client can persist widgets the UI cannot subsequently render or edit. Reject new widgets (no id) whose display_type is in the new DashboardWidgetDisplayTypes.DEPRECATED_TYPES set. Existing widgets remain editable so dashboards persisted before this change continue to work. Refs DAIN-1548 Co-Authored-By: Claude <noreply@anthropic.com>
DominikB2014
marked this pull request as ready for review
April 17, 2026 14:40
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.
Reviewed by Cursor Bugbot for commit 8f8a32a. Configure here.
edwardgou-sentry
approved these changes
Apr 17, 2026
Contributor
Backend Test FailuresFailures on
|
CamelSnakeSerializer runs snake_to_camel_case on all error keys; passing "displayType" lowercases it to "displaytype" because the converter only splits on underscores. Use "display_type" so the response surfaces "displayType" as intended.
DominikB2014
deleted the
dominikbuszowiecki/dain-1548-prevent-saving-widgets-with-deprecated-display-types
branch
April 17, 2026 15:24
3 tasks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

The widget builder dropdown and widget library no longer expose
stacked_area, andtop_nis converted toareaat every UI entry point (getTopNConvertedDefaultWidgets,deserializeDisplayType, the typeSelector dropdown). The backend still accepts both via the dashboards POST and PUT endpoints, so an API-direct client can persist widgets the UI cannot subsequently render or edit.This PR rejects new widgets (no
id) whosedisplay_typeis in the newDashboardWidgetDisplayTypes.DEPRECATED_TYPESset. The check is gated onnot data.get("id")so existing widgets persisted before this change remain editable through the dashboard PUT endpoint.Today the deprecated set is
{STACKED_AREA_CHART, TOP_N}. Other backend-only types not surfaced by the frontend builder (WHEEL,RAGE_AND_DEAD_CLICKS,SERVER_TREE,AGENTS_TRACES_TABLE) are excluded because they're still emitted by the prebuilt widget library configs.Refs DAIN-1548