Skip to content

Conversation

@DominikB2014
Copy link
Contributor

@DominikB2014 DominikB2014 commented Nov 18, 2025

  1. Add static link between query overview to query summary page
  2. Introduce PrebuiltDashboardRenderer which makes it easier to share logic for how prebuilt dashboards will render
  3. Other misc changes to support the link between query overview and query summary

Note: There is one more piece to this puzzle, we need to update the dashboards endpoint to allow us to fetch the actual dashboard id from the static id. See BROWSE-121

@linear
Copy link

linear bot commented Nov 18, 2025

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 18, 2025
@DominikB2014 DominikB2014 marked this pull request as ready for review November 18, 2025 18:53
@DominikB2014 DominikB2014 requested review from a team as code owners November 18, 2025 18:53
linkedDashboard => linkedDashboard.field === field
);
if (dashboardLink) {
if (dashboardLink && dashboardLink.dashboardId !== '-1') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Fix Dashboard Linking for Static IDs

The getDashboardUrl function excludes links with dashboardId === '-1' but doesn't handle the corresponding staticDashboardId property for prebuilt dashboard links. This breaks the feature to link from queries overview to summary dashboard, as the condition will return undefined without processing the prebuilt dashboard ID. The code needs to handle the case where staticDashboardId should be used instead of dashboardId.

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.

Commented about this below

Comment on lines 1424 to 1430
const dashboardLink = widget.queries[0]?.linkedDashboards?.find(
linkedDashboard => linkedDashboard.field === field
);
if (dashboardLink) {
if (dashboardLink && dashboardLink.dashboardId !== '-1') {
const newTemporaryFilters: GlobalFilter[] =
dashboardFilters[DashboardFilterKeys.GLOBAL_FILTER] ?? [];

Copy link

Choose a reason for hiding this comment

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

Bug: getDashboardUrl() does not handle staticDashboardId for prebuilt dashboards, causing drill-down links to fail when dashboardId is '-1'.
Severity: CRITICAL | Confidence: 0.95

🔍 Detailed Analysis

The getDashboardUrl() function in fieldRenderers.tsx fails to generate a URL for prebuilt dashboards. When a linkedDashboard entry has dashboardId: '-1' and a staticDashboardId, the condition dashboardLink.dashboardId !== '-1' evaluates to false. This prevents the URL generation logic for saved dashboards from executing, and no alternative handling for staticDashboardId is present. As a result, the function returns undefined, leading to a broken drill-down navigation feature for prebuilt dashboards.

💡 Suggested Fix

Implement logic within getDashboardUrl() to handle linkedDashboard entries where dashboardId is '-1' and staticDashboardId is present. This logic should use staticDashboardId to construct the appropriate URL for prebuilt dashboards, ensuring the drill-down feature functions correctly.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: static/app/utils/discover/fieldRenderers.tsx#L1424-L1430

Potential issue: The `getDashboardUrl()` function in `fieldRenderers.tsx` fails to
generate a URL for prebuilt dashboards. When a `linkedDashboard` entry has `dashboardId:
'-1'` and a `staticDashboardId`, the condition `dashboardLink.dashboardId !== '-1'`
evaluates to false. This prevents the URL generation logic for saved dashboards from
executing, and no alternative handling for `staticDashboardId` is present. As a result,
the function returns `undefined`, leading to a broken drill-down navigation feature for
prebuilt dashboards.

Did we get this right? 👍 / 👎 to inform future reviews.

Reference_id: 2780090

Copy link
Contributor Author

@DominikB2014 DominikB2014 Nov 18, 2025

Choose a reason for hiding this comment

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

This wrong, the plan is to automatically fetch and populate the dashboardId, links should never be based on prebuilt id

…n-query-summary-and-query-detail' of github.com:getsentry/sentry into dominikbuszowiecki/browse-102-add-dashboard-link-between-query-summary-and-query-detail
@DominikB2014 DominikB2014 merged commit bd37a79 into master Nov 19, 2025
48 checks passed
@DominikB2014 DominikB2014 deleted the dominikbuszowiecki/browse-102-add-dashboard-link-between-query-summary-and-query-detail branch November 19, 2025 17:28
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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