Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(dashboard): remove redundant tile removal confirmation dialog (#63107)

Matt Puaf1d3e36af362
diff --git a/frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx b/frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx
index 4f73684e3a01..30dd19906561 100644
--- a/frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx
+++ b/frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx
@@ -16,7 +16,6 @@ import { TZLabel } from 'lib/components/TZLabel'
import { FEATURE_FLAGS } from 'lib/constants'
import { dayjs } from 'lib/dayjs'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
-import { LemonDialog } from 'lib/lemon-ui/LemonDialog'
import { LemonDivider } from 'lib/lemon-ui/LemonDivider'
import { LemonMarkdown } from 'lib/lemon-ui/LemonMarkdown'
import { LemonMenu } from 'lib/lemon-ui/LemonMenu'
@@ -508,25 +507,7 @@ export function InsightMeta({
onCopyToDashboard={canShowCopyToDashboardTile ? copyToDashboard : undefined}
/>
{removeFromDashboard && (
- <LemonButton
- status="danger"
- onClick={() =>
- LemonDialog.open({
- title: 'Remove from dashboard',
- description:
- 'Are you sure you want to remove this insight from the dashboard?',
- primaryButton: {
- children: 'Remove from dashboard',
- status: 'danger',
- onClick: removeFromDashboard,
- },
- secondaryButton: {
- children: 'Cancel',
- },
- })
- }
- fullWidth
- >
+ <LemonButton status="danger" onClick={removeFromDashboard} fullWidth>
Remove from dashboard
</LemonButton>
)}
diff --git a/frontend/src/scenes/dashboard/items/DashboardButtonTileItem.tsx b/frontend/src/scenes/dashboard/items/DashboardButtonTileItem.tsx
index 3164ffc53576..3bd97214134b 100644
--- a/frontend/src/scenes/dashboard/items/DashboardButtonTileItem.tsx
+++ b/frontend/src/scenes/dashboard/items/DashboardButtonTileItem.tsx
@@ -5,7 +5,6 @@ import { ButtonTileCard } from 'lib/components/Cards/ButtonTileCard/ButtonTileCa
import { dashboardWidgetMenusLogic } from 'lib/components/Cards/InsightCard/dashboardWidgetMenusLogic'
import { DashboardWidgetPlacementMenus } from 'lib/components/Cards/InsightCard/DashboardWidgetPlacementMenus'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
-import { LemonDialog } from 'lib/lemon-ui/LemonDialog'
import { LemonDivider } from 'lib/lemon-ui/LemonDivider'
import type { DashboardPlacement, DashboardTile, DashboardType, QueryBasedInsightModel } from '~/types'
@@ -71,20 +70,7 @@ function DashboardButtonTileItemInternal(
{onRemove && (
<LemonButton
status="danger"
- onClick={() =>
- LemonDialog.open({
- title: 'Remove button from dashboard',
- description: 'Are you sure you want to remove this button from the dashboard?',
- primaryButton: {
- children: 'Remove from dashboard',
- status: 'danger',
- onClick: () => onRemove(),
- },
- secondaryButton: {
- children: 'Cancel',
- },
- })
- }
+ onClick={() => onRemove()}
fullWidth
data-attr="remove-button-tile-from-dashboard"
>
diff --git a/frontend/src/scenes/dashboard/items/DashboardTextItem.tsx b/frontend/src/scenes/dashboard/items/DashboardTextItem.tsx
index 579ff703172e..13fbd72adea9 100644
--- a/frontend/src/scenes/dashboard/items/DashboardTextItem.tsx
+++ b/frontend/src/scenes/dashboard/items/DashboardTextItem.tsx
@@ -5,7 +5,6 @@ import { dashboardWidgetMenusLogic } from 'lib/components/Cards/InsightCard/dash
import { DashboardWidgetPlacementMenus } from 'lib/components/Cards/InsightCard/DashboardWidgetPlacementMenus'
import { TextCard } from 'lib/components/Cards/TextCard/TextCard'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
-import { LemonDialog } from 'lib/lemon-ui/LemonDialog'
import { LemonDivider } from 'lib/lemon-ui/LemonDivider'
import { DashboardPlacement, DashboardTile, DashboardType, QueryBasedInsightModel } from '~/types'
@@ -71,20 +70,7 @@ function DashboardTextItemInternal(
{onRemove && (
<LemonButton
status="danger"
- onClick={() =>
- LemonDialog.open({
- title: 'Remove text from dashboard',
- description: 'Are you sure you want to remove this text card from the dashboard?',
- primaryButton: {
- children: 'Remove from dashboard',
- status: 'danger',
- onClick: () => onRemove(),
- },
- secondaryButton: {
- children: 'Cancel',
- },
- })
- }
+ onClick={() => onRemove()}
fullWidth
data-attr="remove-text-tile-from-dashboard"
>
diff --git a/playwright/e2e/product-analytics/dashboards.spec.ts b/playwright/e2e/product-analytics/dashboards.spec.ts
index bc6d15c60179..2cc27868f542 100644
--- a/playwright/e2e/product-analytics/dashboards.spec.ts
+++ b/playwright/e2e/product-analytics/dashboards.spec.ts
@@ -152,8 +152,6 @@ test.describe('Dashboards', () => {
await dashboard.openFirstTileMenu()
await dashboard.selectTileMenuOption('Remove from dashboard')
- await page.getByRole('contentinfo').getByRole('button', { name: 'Remove from dashboard' }).click()
-
await expect(dashboard.insightCards.first().getByText(newTileName)).not.toBeVisible()
})
})