Skip to content

Conversation

@DominikB2014
Copy link
Contributor

@DominikB2014 DominikB2014 commented Nov 26, 2025

  1. Adds a detail widget. This widget accepts a query and will render the first example that matches the query based on the type of span it is.
image
  • For now, this only applies to spans and i'm just using the existingfullSpanDescription component to do this, but we can iterate on this later on.
  • This is conditionally added as an option in the widget type dropdown if the feature flag is on.
  • There's still some UI jank to sort out, i figured it's easier to split it up so the PR doesn't get too large.
  • I still need to register this on the backend, this will allow me to save a widget of type details and test it properly (feat(dashboards): register "details" widget as valid widget on the backend #104062)
  1. Adds a isChartDisplayType function. I noticed there's a TON of places that checks isChartWidget. Now that we have 3 non-chart displays i just consolidated the logic to one place.

@DominikB2014 DominikB2014 requested a review from a team as a code owner November 26, 2025 18:56
@linear
Copy link

linear bot commented Nov 26, 2025

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 26, 2025
options
);
setSort(decodeSorts(config.defaultWidgetQuery.orderby), options);
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: DETAILS display type not reset when switching datasets

When changing datasets via SET_DATASET action while DisplayType.DETAILS is selected, the display type isn't validated against the new dataset's supportedDisplayTypes. Since DETAILS is only supported by the SPANS dataset, switching from SPANS to another dataset leaves the widget in a broken state with DETAILS display type and incompatible fields. The code handles this for ISSUE dataset (forcing TABLE) but not for DETAILS. This causes the widget to use default dataset fields instead of required DETAIL_WIDGET_FIELDS, breaking the details visualization.

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried this locally

  1. Select dataset: spans
  2. Select type: details
  3. Select dataset: errors

After this the type was reset to line

state.displayType !== DisplayType.TABLE;
const isChartWidget = isChartDisplayType(state.displayType);

const showVisualizeSection = state.displayType !== DisplayType.DETAILS;
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Sort UI not shown for DETAILS widgets

The showSortByStep condition doesn't include DisplayType.DETAILS, preventing the sort UI from appearing for DETAILS widgets. However, the SortBySelectors component explicitly handles DETAILS widgets alongside TABLE widgets, and users need sorting to control which example span appears first in the details view.

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Intentional, we don't want sort UI for detail. we might want it in the future tho, so i made the sort component also work with details in this PR.

Comment on lines 703 to +713
return baseQuery;
}

export const isChartDisplayType = (displayType?: DisplayType) => {
if (!displayType) {
return true;
}
return ![DisplayType.BIG_NUMBER, DisplayType.TABLE, DisplayType.DETAILS].includes(
displayType
);
};

This comment was marked as outdated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pr already up for this

DominikB2014 added a commit that referenced this pull request Nov 27, 2025
…ckend (#104062)

Prevents the `"detail" is not a valid choice` error when trying to save
a details widget
complements #104059
? undefined
: state.limit;

const limit = isChartDisplayType(state.displayType) ? state.limit : undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Undefined displayType handling inconsistent for limit field

The new isChartDisplayType function returns true when displayType is undefined, treating it as a chart type. However, the previous code in convertBuilderStateToWidget.ts explicitly defaulted undefined to DisplayType.TABLE via state.displayType ?? DisplayType.TABLE. This causes inconsistent behavior: when displayType is undefined, the limit field is now set to state.limit (chart behavior), but the widget's displayType property defaults to TABLE on line 77. Previously, undefined would result in limit = undefined (table behavior), matching the displayType fallback.

Additional Locations (1)

Fix in Cursor Fix in Web

@DominikB2014 DominikB2014 merged commit 6f02c50 into master Nov 27, 2025
48 checks passed
@DominikB2014 DominikB2014 deleted the dominikbuszowiecki/browse-144-create-details-widget-on-frontend branch November 27, 2025 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants