Skip to content

ref(insights): remove useHasPlatformizedInsights and dead widgets#114252

Draft
gggritso wants to merge 30 commits intomasterfrom
georgegritsouk/dain-1568-pr6-foundation
Draft

ref(insights): remove useHasPlatformizedInsights and dead widgets#114252
gggritso wants to merge 30 commits intomasterfrom
georgegritsouk/dain-1568-pr6-foundation

Conversation

@gggritso
Copy link
Copy Markdown
Member

Sixth and final PR in the DAIN-1568 split. Lands on top of #114189, #114200, #114233, #114246, and #114248. The diff against `master` will look big until those merge — once they do, this PR shrinks to the foundation cleanup described below.

What this PR actually adds (once stacked PRs merge)

  • Delete `useHasPlatformizedInsights` and its `usePlatformizedView` query-param dev override. Every caller is now gone.
  • Simplify `usePrebuiltDashboardUrl` to call `useGetPrebuiltDashboard` unconditionally; `spanSummaryLink` loses its dead `undefined`-fallback branch.
  • Trim `chartWidgetLoader` CHART_MAP down to the entries that actually back `rdChart` deep-links from prebuilt dashboards. Spec mocks for the deleted queries are removed from `chartWidgetLoader-unmocked-imports.spec.tsx`.
  • Delete the orphaned chart-loader widgets held in place by earlier PRs in the series:
    • `overview*ChartWidget` (slow assets, time-consuming queries/requests, transaction duration/throughput, agents runs/duration, LLM calls)
    • `httpChartWidget`, `cacheChartWidget`, `databaseChartWidget`, `queuesChartWidget`, `resource*ChartWidget`, `mcpTrafficWidget`
    • session widgets: `crashFreeSessions`, `releaseSession{Count,Percentage}`, `sessionHealth{Count,Rate}`, `userHealth{Count,Rate}`, `unhealthySessions`, `releaseNewIssues`, `newAndResolvedIssue`
  • Delete the chain of helpers those widgets imported: session queries (`useCrashFreeSessions`, `useReleaseSession*`, `useSessionHealthBreakdown`, `useUserHealthBreakdown`, etc.), `sessions/charts/chartWithIssues`, `sessions/components/{chartMap,chartPlacement,chartSelectionTitle}`, the `sessions/utils/sessions` util, `useDatabase*` / `useHttp*` / `useResource*` chart-filter hooks.
  • Drop now-unused settings exports: `pages/{backend,frontend}/referrers`, `useFrontendQuery`, `PAGE_SPAN_OPS` / `SPAN_OP_QUERY_PARAM`, `FIELD_ALIASES` exports for http/resources.

Verification

  • `pnpm run typecheck` clean
  • `pnpm exec knip` — no new entries beyond pre-existing residue

Refs DAIN-1568

gggritso added 11 commits April 28, 2026 12:07
Now that organizations:insights-prebuilt-dashboards is fully rolled out
on AM2/AM3 (and AM1 doesn't have Insights), the EAP-eligibility check
inside the backend, frontend, and mobile overview pages can use the
existing useInsightsEap() signal instead of the soon-to-be-removed
useHasPlatformizedInsights().

- Backend overview collapses to: Laravel/NextJS branch when applicable,
  PlatformizedBackendOverviewPage when EAP, Am1BackendOverviewPage
  otherwise. Same shape for frontend (NextJS / Platformized / Am1).
- Mobile overview drops the useHasPlatformizedInsights branch; AM1 path
  preserved.
- Remove EAPBackendOverviewPage / EAPFrontendOverviewPage and their
  dedicated tables, query helpers, and span-op utilities (backendTable,
  frontendOverviewTable, useFrontendTableData, useFrontendQuery,
  pageSpanOp). overviewIssuesWidget had no remaining callers.
- Settings: drop unused DEFAULT_SORT export from frontend/settings.

CHART_MAP-referenced overview widgets stay in place; their CHART_MAP
entries (and the widgets themselves) get cleaned up in a later PR
together with the useHasPlatformizedInsights hook removal.

Refs DAIN-1568
Collapse the cache, database, http, and queues landing + summary pages
to render their Platformized equivalents directly. The
useHasPlatformizedInsights() conditional inside each PageWithProviders
is replaced with a thin wrapper around the corresponding Platformized
component.

- cache: cacheLandingPage
- database: databaseLandingPage, databaseSpanSummaryPage
- http: httpLandingPage, httpDomainSummaryPage (legacy DESTINATION_TITLE,
  FIELD_ALIASES exports retained where shared widgets still depend on
  them)
- queues: queuesLandingPage, destinationSummaryPage

Removes legacy tables, query helpers, page filters, and co-located
specs that only the legacy implementations used (queriesTable,
queryTransactionsTable, domainsTable, domainTransactionsTable,
queuesTable, transactionCell variants, useQueuesByDestinationQuery,
databasePageFilters, etc.). Also drops the now-orphaned
common/components/issues.tsx and spans/selectors/actionSelector.tsx.

CHART_MAP-referenced widgets and their hooks stay in place; cleaned
up in the final PR of the series along with the
useHasPlatformizedInsights hook removal.

Refs DAIN-1568
Collapse the resources and web vitals landing + detail pages to render
their Platformized equivalents directly. The useHasPlatformizedInsights
branch and the legacy module implementations are removed.

- resources: resourcesLandingPage, resourceSummaryPage
- web vitals: webVitalsLandingPage, pageOverview

Removes legacy components, tables, queries, and co-located specs that
only the legacy implementations used: resourceLandingPageCharts,
resourceSummaryCharts, renderBlockingSelector, resourceInfo,
resourceView, resourceSummaryTable, resourceTable, useResourcePageQuery,
useResourcePagesQuery, useResourceSummarySort, useResourceSort,
browserTypeSelector, performanceScoreChart,
pageSamplePerformanceTable, useTransactionSamplesWebVitalsScoresQuery,
mapWebVitalToOrderBy. Also drops the now-orphaned
common/views/spans/selectors/transactionSelector,
common/components/tableCells/throughputCell, and
common/utils/useWebVitalsDrawer.

Loosen the ValidSort constraint in useResourcesQuery to plain Sort so
the surviving overview widgets can keep using it after useResourceSort
is gone. Drop the now-unused RESOURCE_THROUGHPUT_UNIT export.

CHART_MAP-referenced widgets and their hooks stay in place; cleaned up
in the final PR of the series alongside useHasPlatformizedInsights
removal.

Refs DAIN-1568
Collapse the screens landing and detail pages to render their
Platformized equivalents directly. The useHasPlatformizedInsights
branch and the legacy module implementations are removed.

Removes legacy components and queries only the legacy implementations
used: screenload affectSelector, screenBarChart, screenCharts,
setupContent, referrers, screenLoadSpansPage, mobile/ui screenSummaryPage,
and screensLandingPage spec. Also drops the now-orphaned
common/utils/useMobileVitalsDrawer.

Refs DAIN-1568
Collapse the agents and MCP overview pages, the sessions overview, and
the MCP/agent landing pages (toolsLandingPage, modelsLandingPage,
mcpToolsLandingPage, mcpResourcesLandingPage, mcpPromptsLandingPage)
to render their Platformized equivalents directly.

Removes legacy components, tables, and widgets only the legacy
implementations used:

- pages/agents/components/* (issuesWidget, llmCallsWidget,
  modelCostWidget, modelsTable, tokenTypesWidget, tokenUsageWidget,
  toolCallsWidget, toolErrorsWidget, toolsTable, common, styles)
- pages/agents/hooks/* (useAgentMonitoringTrackPageView,
  useAgentSpanSearchProps, useShowAgentOnboarding)
- pages/mcp/components/* (groupedDurationWidget, groupedErrorRateWidget,
  groupedTrafficWidget, mcpOverviewTable, mcpPrompt/Resource/Tool
  Duration/ErrorRate/Traffic widgets, mcpToolsTable,
  mcpTrafficByClientWidget, mcpTransportWidget, styles)
- pages/mcp/hooks/useMcpSpanSearchProps
- sessions/components/{filterReleaseDropdown,releaseTableSearch,
  releaseHealth,releaseHealthTable} and useOrganizationReleases

CHART_MAP-referenced session widgets, charts, and queries
(crashFreeSessionsChartWidget, releaseSessionCount/Percentage,
sessionHealth*, userHealth*, unhealthySessions, releaseNewIssues,
newAndResolvedIssue) and their dependencies (chartWithIssues,
chartMap, chartPlacement, chartSelectionTitle, useReleaseSession*,
useSessionHealthBreakdown, useUserHealthBreakdown, useErroredSessions,
useCrashFreeSessions, useNewAndResolvedIssues, useSessionProjectTotal,
useProjectHasSessions, useRecentIssues, useReleaseNewIssues,
sessions util) stay in place. They get cleaned up in the final PR
of the series alongside useHasPlatformizedInsights removal.

Refs DAIN-1568
Final PR in the DAIN-1568 split. Now that PRs #114189, #114200, #114233,
#114246, and #114248 have removed every caller of
useHasPlatformizedInsights and every legacy module page, the hook and
the chart-loader widgets that only existed to back the legacy
implementations can go.

- Delete useHasPlatformizedInsights.tsx and its usePlatformizedView
  query-param dev override.
- Simplify usePrebuiltDashboardUrl to call useGetPrebuiltDashboard
  unconditionally; spanSummaryLink loses its dead undefined-fallback
  branch.
- Trim chartWidgetLoader CHART_MAP to the entries that actually back
  rdChart deep-links from prebuilt dashboards. Remove the spec mocks
  for the queries the deleted widgets depended on.
- Delete the now-orphaned overview*ChartWidget, http*ChartWidget,
  cache*ChartWidget, database*ChartWidget, queues*ChartWidget,
  resource*ChartWidget, mcpTrafficWidget, and session widgets
  (crashFreeSessions, releaseSession*, sessionHealth*, userHealth*,
  unhealthySessions, releaseNewIssues, newAndResolvedIssue).
- Delete the chain of chart-helper hooks, queries, components, and
  settings exports those widgets imported (sessions/queries/use*,
  sessions/charts/chartWithIssues, sessions/components/chartMap,
  chartPlacement, chartSelectionTitle, sessions util, useDatabase*,
  useHttp*, useResource* hooks, FIELD_ALIASES exports, etc.).
- Drop pages/{backend,frontend}/referrers and useFrontendQuery + the
  PAGE_SPAN_OPS / SPAN_OP_QUERY_PARAM exports that only the deleted
  widgets referenced.

Refs DAIN-1568
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 28, 2026

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 28, 2026
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.

1 participant