Skip to content

fix(dashboards): Remove dashboard redirects to old pre-built dashboard#113758

Merged
gggritso merged 5 commits intomasterfrom
georgegritsouk/fix-dashboards-remove-default-overview-redirect
Apr 28, 2026
Merged

fix(dashboards): Remove dashboard redirects to old pre-built dashboard#113758
gggritso merged 5 commits intomasterfrom
georgegritsouk/fix-dashboards-remove-default-overview-redirect

Conversation

@gggritso
Copy link
Copy Markdown
Member

@gggritso gggritso commented Apr 22, 2026

Dashboards have a new shiny pre-built dashboard system, where dashboards are stub objects in the database, supported by frontend JSON blobs. There's also an old prebuilt dashboard system, in which there's one pre-built "General" dashboard that's stored as JSON blob in the code, and manually injected into responses.

I am deleting the old one. Step 1 was hiding the pre-built dashboard selector from the UI (already done).

This is Step 2, which is removing a redirect to the "General" dashboards when none are found. The changes are a bit confusing, but the summary is:

  • the OrgDashboards component is used to render a single dashboard! This happens on the URL /dashboards/:dashboardId/ or on the /dashbords/ URL if the user doesn't have Dashboard edit permissions. HOWEVER, the dashboards-basic and dashboards-edit flags have the same cohort, so it's not possible to get into a case where you are looking at a single dashboard on the /dashboards/ route. So, that UI code is gone
  • since that code is gone, it's no longer possible to render OrgDashboards without a dashboardId, the dashboard ID is always available from the URL, it's only rendered on routes with that URL structure. So, no need to redirect back to /dashboards/ or anything like that, that case is now impossible
  • since dashboards-basic and dashboards-edit have the same rollout cohort, there's no need to redirect back to the overview from the details page

Next steps will be to actually remove that dashboard from the backend, and then I can clean up the FE references to it, and replace the two flags with a single plan flag.

References DAIN-1210

The old fallback navigated to `/dashboard/default-overview/`, which
relied on the legacy prebuilt General dashboard that no longer exists —
it 404s now. Redirect to the manage page instead so the user lands on
a valid route and can pick or create a dashboard.
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 22, 2026

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 22, 2026
@gggritso gggritso changed the title fix(dashboards): Redirect to manage page when no dashboard is selected fix(dashboards): Redirect to Dashboards page when no dashboard is selected Apr 23, 2026
@gggritso gggritso marked this pull request as ready for review April 23, 2026 15:12
@gggritso gggritso requested a review from a team as a code owner April 23, 2026 15:12
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e9a70fc. Configure here.

Comment thread static/app/views/dashboards/orgDashboards.tsx Outdated
Copy link
Copy Markdown
Contributor

@edwardgou-sentry edwardgou-sentry left a comment

Choose a reason for hiding this comment

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

I think the cursor review might be true? Without dashboards-edit it does look like the user would end up in a looping redirect. I think we'd either have to send the user to the first available prebuilt dashboard, or update the dashboard manage pages to not short circuit on missing dashboards-edit permission

Copy link
Copy Markdown
Member Author

Sort of! As of a few months ago dashboards-edit and dashboards-basic have the same rollout cohort! There's actually no way to even land on this page without having both dashboard-edit and dashboards-basic so there's no risk of a loop in that case. That's part of the reason why I'm even able to do this stuff and delete the final pre-built dashboard: everyone can make a new one if they want to!

Copy link
Copy Markdown
Member Author

As an aside, I also have a task to consolidate those flags and turn them back into plan flags from Flagpole

@gggritso gggritso changed the title fix(dashboards): Redirect to Dashboards page when no dashboard is selected fix(dashboards): Remove dashboard redirects to old pre-built dashboard Apr 28, 2026
@gggritso gggritso merged commit 9a81d9d into master Apr 28, 2026
87 of 92 checks passed
@gggritso gggritso deleted the georgegritsouk/fix-dashboards-remove-default-overview-redirect branch April 28, 2026 17:22
gggritso added a commit that referenced this pull request Apr 28, 2026
Follow-up to #113758, see more
context there!

tl;dr we have a new pre-built dashboard system, where pre-built
dashboards are stored as database stubs, with the full dashboard config
living in JSON. Therefore, I am getting rid of the last vestiges of the
_previous_ prebuilt dashboard system. Right now there is just one single
old pre-built dashboard called "General". This PR removes it, so it
never comes back in the UI. According to the access logs, single digits
users per months are looking at it, and I think they might be _us_.

Here, I remove `get_prebuilt_dashboards()` and the surrounding
`default-overview` prebuilt dashboard system, which returned a hardcoded
widget configuration as a plain Python dict injected into API responses.

Notable changes:

- types that used `Dashboard | dict...` are gone now, because only
_real_ `Dashboard` objects are passed around
- specs that counted dashboards are all decremented by one, since the
"General" dashboard is gone
- there are bits of odd code where one dashboard must be left remaining,
due to the "General" dashboard. I left it for now, and I'll remove it
(and the front-end counterparts) in the next PR
- The `DashboardTombstone` model is kept for now and will be removed in
a follow-up PR along with the DB table drop.

Refs DAIN-1562

---------

Co-authored-by: Claude <noreply@anthropic.com>
cleptric pushed a commit that referenced this pull request May 5, 2026
#113758)

Dashboards have a new shiny pre-built dashboard system, where dashboards
are stub objects in the database, supported by frontend JSON blobs.
There's also an _old_ prebuilt dashboard system, in which there's one
pre-built "General" dashboard that's stored as JSON blob in the code,
and manually injected into responses.

I am deleting the old one. Step 1 was hiding the pre-built dashboard
selector from the UI (already done).

This is Step 2, which is removing a redirect to the "General" dashboards
when none are found. The changes are a bit confusing, but the summary
is:

- the `OrgDashboards` component is used to render a single dashboard!
This happens on the URL `/dashboards/:dashboardId/` _or_ on the
`/dashbords/` URL if the user doesn't have Dashboard edit permissions.
HOWEVER, the `dashboards-basic` and `dashboards-edit` flags have _the
same cohort_, so it's not possible to get into a case where you are
looking at a single dashboard on the `/dashboards/` route. So, that UI
code is gone
- since that code is gone, it's no longer possible to render
`OrgDashboards` without a `dashboardId`, the dashboard ID is always
available from the URL, it's only rendered on routes with that URL
structure. So, no need to redirect back to `/dashboards/` or anything
like that, that case is now impossible
- since `dashboards-basic` and `dashboards-edit` have the same rollout
cohort, there's no need to redirect back to the overview from the
details page

Next steps will be to actually remove that dashboard from the backend,
and then I can clean up the FE references to it, and replace the two
flags with a single plan flag.

References DAIN-1210
cleptric pushed a commit that referenced this pull request May 5, 2026
Follow-up to #113758, see more
context there!

tl;dr we have a new pre-built dashboard system, where pre-built
dashboards are stored as database stubs, with the full dashboard config
living in JSON. Therefore, I am getting rid of the last vestiges of the
_previous_ prebuilt dashboard system. Right now there is just one single
old pre-built dashboard called "General". This PR removes it, so it
never comes back in the UI. According to the access logs, single digits
users per months are looking at it, and I think they might be _us_.

Here, I remove `get_prebuilt_dashboards()` and the surrounding
`default-overview` prebuilt dashboard system, which returned a hardcoded
widget configuration as a plain Python dict injected into API responses.

Notable changes:

- types that used `Dashboard | dict...` are gone now, because only
_real_ `Dashboard` objects are passed around
- specs that counted dashboards are all decremented by one, since the
"General" dashboard is gone
- there are bits of odd code where one dashboard must be left remaining,
due to the "General" dashboard. I left it for now, and I'll remove it
(and the front-end counterparts) in the next PR
- The `DashboardTombstone` model is kept for now and will be removed in
a follow-up PR along with the DB table drop.

Refs DAIN-1562

---------

Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants