SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
fix(dashboard-v2): templates header, long-title handling, variable icon & unified delete modal (#12256)
Ashwin Bhatkalcbde4dca4195
diff --git a/frontend/src/pages/DashboardPageV2/DashboardContainer/DashboardPageToolbar/DashboardInfo/DashboardInfo.module.scss b/frontend/src/pages/DashboardPageV2/DashboardContainer/DashboardPageToolbar/DashboardInfo/DashboardInfo.module.scssindex 7e52d4f412..513bceed1d 100644--- a/frontend/src/pages/DashboardPageV2/DashboardContainer/DashboardPageToolbar/DashboardInfo/DashboardInfo.module.scss+++ b/frontend/src/pages/DashboardPageV2/DashboardContainer/DashboardPageToolbar/DashboardInfo/DashboardInfo.module.scss@@ -100,13 +100,11 @@flex-shrink: 0;}-/* Flexes into the remaining space and clips so the ResizeObserver can measure- how many tags fit before collapsing the rest into a `+N` badge. */+/* Fixed footprint (2 tags + `+N`): never shrinks, so a long title ellipsizes+ around it rather than collapsing the tags. */.dashboardTags {display: flex;- flex: 1 1 0;+ flex: none;align-items: center;gap: 4px;- min-width: 0;- overflow: hidden;}diff --git a/frontend/src/pages/DashboardPageV2/DashboardContainer/DashboardPageToolbar/DashboardInfo/DashboardInfo.tsx b/frontend/src/pages/DashboardPageV2/DashboardContainer/DashboardPageToolbar/DashboardInfo/DashboardInfo.tsxindex dd6f2b4793..28df812cb1 100644--- a/frontend/src/pages/DashboardPageV2/DashboardContainer/DashboardPageToolbar/DashboardInfo/DashboardInfo.tsx+++ b/frontend/src/pages/DashboardPageV2/DashboardContainer/DashboardPageToolbar/DashboardInfo/DashboardInfo.tsx@@ -20,10 +20,13 @@ import { linkifyText } from 'utils/linkifyText';import { openInNewTab } from 'utils/navigation';import styles from './DashboardInfo.module.scss';-import { useVisibleTagCount } from './useVisibleTagCount';import { DASHBOARD_NAME_MAX_LENGTH } from '../../constants';import { useDashboardStore } from '../../store/useDashboardStore';+// The tag cluster keeps a fixed footprint so a long title ellipsizes around it+// instead of collapsing the tags: show up to two tags, then a `+N` overflow badge.+const MAX_VISIBLE_TAGS = 2;+interface DashboardInfoProps {title: string;image: string;@@ -68,10 +71,8 @@ function DashboardInfo({const hasTags = tags.length > 0;const hasDescription = !isEmpty(description);- const { containerRef, visibleCount } = useVisibleTagCount(tags);- const needsOverflow = tags.length > visibleCount;- const visibleTags = needsOverflow ? tags.slice(0, visibleCount) : tags;- const remainingTags = needsOverflow ? tags.slice(visibleCount) : [];+ const visibleTags = tags.slice(0, MAX_VISIBLE_TAGS);+ const remainingTags = tags.slice(MAX_VISIBLE_TAGS);let lockTooltip: string;if (onToggleLock) {@@ -225,11 +226,7 @@ function DashboardInfo({{hasTags && (<><span className={styles.divider} />- <div- ref={containerRef}- className={styles.dashboardTags}- data-testid="dashboard-tags"- >+ <div className={styles.dashboardTags} data-testid="dashboard-tags">{visibleTags.map((tag) => (<TagBadge key={tag}>{tag}</TagBadge>))}diff --git a/frontend/src/pages/DashboardPageV2/DashboardContainer/DashboardPageToolbar/DashboardInfo/useVisibleTagCount.ts b/frontend/src/pages/DashboardPageV2/DashboardContainer/DashboardPageToolbar/DashboardInfo/useVisibleTagCount.tsdeleted file mode 100644index 25458f0b31..0000000000--- a/frontend/src/pages/DashboardPageV2/DashboardContainer/DashboardPageToolbar/DashboardInfo/useVisibleTagCount.ts+++ /dev/null@@ -1,62 +0,0 @@-import { useCallback, useEffect, useRef, useState } from 'react';-import {- BADGE_GAP,- estimateBadgeWidth,- OVERFLOW_BADGE_WIDTH,-} from 'components/Alerts/LabelColumn/utils';--interface Result {- containerRef: React.RefObject<HTMLDivElement>;- visibleCount: number;-}--/**- * Measures how many tags fit in the container and returns the visible count,- * reserving room for the `+N` overflow badge. Reuses the badge-width estimation- * from the alerts LabelColumn so dashboards and alerts overflow identically.- */-export function useVisibleTagCount(tags: string[]): Result {- const containerRef = useRef<HTMLDivElement>(null);- const [visibleCount, setVisibleCount] = useState(tags.length);-- const calculateVisible = useCallback(- (width: number): number => {- if (width <= 0) {- return 1;- }- const availableWidth = width - OVERFLOW_BADGE_WIDTH - BADGE_GAP;- let usedWidth = 0;- let count = 0;- for (const tag of tags) {- const badgeWidth = estimateBadgeWidth(tag) + BADGE_GAP;- if (usedWidth + badgeWidth > availableWidth && count > 0) {- break;- }- usedWidth += badgeWidth;- count += 1;- }- return Math.max(1, count);- },- [tags],- );-- useEffect(() => {- const container = containerRef.current;- if (!container) {- return undefined;- }- const observer = new ResizeObserver((entries) => {- const entry = entries[0];- if (entry && entry.contentRect.width > 0) {- setVisibleCount(calculateVisible(entry.contentRect.width));- }- });- observer.observe(container);- if (container.clientWidth > 0) {- setVisibleCount(calculateVisible(container.clientWidth));- }- return (): void => observer.disconnect();- }, [calculateVisible]);-- return { containerRef, visibleCount };-}diff --git a/frontend/src/pages/DashboardPageV2/DashboardContainer/PanelsAndSectionsLayout/PanelsAndSectionsLayout.module.scss b/frontend/src/pages/DashboardPageV2/DashboardContainer/PanelsAndSectionsLayout/PanelsAndSectionsLayout.module.scssindex db6d48f8ac..9c89fc5d61 100644--- a/frontend/src/pages/DashboardPageV2/DashboardContainer/PanelsAndSectionsLayout/PanelsAndSectionsLayout.module.scss+++ b/frontend/src/pages/DashboardPageV2/DashboardContainer/PanelsAndSectionsLayout/PanelsAndSectionsLayout.module.scss@@ -1,6 +1,6 @@.body {flex: 1;- padding: 12px 24px;+ padding: 12px 16px;overflow: auto;}diff --git a/frontend/src/pages/DashboardPageV2/DashboardContainer/VariablesBar/components/VariableSelector/VariableSelector.tsx b/frontend/src/pages/DashboardPageV2/DashboardContainer/VariablesBar/components/VariableSelector/VariableSelector.tsxindex 6c7eba9d38..41aa031645 100644--- a/frontend/src/pages/DashboardPageV2/DashboardContainer/VariablesBar/components/VariableSelector/VariableSelector.tsx+++ b/frontend/src/pages/DashboardPageV2/DashboardContainer/VariablesBar/components/VariableSelector/VariableSelector.tsx@@ -1,5 +1,5 @@import { useMemo } from 'react';-import { SolidInfoCircle } from '@signozhq/icons';+import { Info } from '@signozhq/icons';import { Typography } from '@signozhq/ui/typography';// eslint-disable-next-line signoz/no-antd-components -- lightweight description tooltip, matches V1import { Tooltip } from 'antd';@@ -99,7 +99,7 @@ function VariableSelector({/>}>- <SolidInfoCircle className={styles.infoIcon} size={12} />+ <Info className={styles.infoIcon} size={12} /></Tooltip>) : null}</Typography.Text>diff --git a/frontend/src/pages/DashboardPageV2/DashboardContainer/components/DashboardPageHeader/DashboardPageBreadcrumbs.module.scss b/frontend/src/pages/DashboardPageV2/DashboardContainer/components/DashboardPageHeader/DashboardPageBreadcrumbs.module.scssnew file mode 100644index 0000000000..8c021dcf22--- /dev/null+++ b/frontend/src/pages/DashboardPageV2/DashboardContainer/components/DashboardPageHeader/DashboardPageBreadcrumbs.module.scss@@ -0,0 +1,10 @@+// Cap the dashboard-name segment so a long title ellipsizes on one line instead+// of stretching the breadcrumb row.+.title {+ display: inline-block;+ max-width: 480px;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ vertical-align: middle;+}diff --git a/frontend/src/pages/DashboardPageV2/DashboardContainer/components/DashboardPageHeader/DashboardPageBreadcrumbs.tsx b/frontend/src/pages/DashboardPageV2/DashboardContainer/components/DashboardPageHeader/DashboardPageBreadcrumbs.tsxindex f16f6b255e..5c8fcb52fe 100644--- a/frontend/src/pages/DashboardPageV2/DashboardContainer/components/DashboardPageHeader/DashboardPageBreadcrumbs.tsx+++ b/frontend/src/pages/DashboardPageV2/DashboardContainer/components/DashboardPageHeader/DashboardPageBreadcrumbs.tsx@@ -14,6 +14,8 @@ import {BreadcrumbSeparator,} from '@signozhq/ui/breadcrumb';+import styles from './DashboardPageBreadcrumbs.module.scss';+interface DashboardPageBreadcrumbsProps {title: string;image: string;@@ -60,7 +62,9 @@ function DashboardPageBreadcrumbs({<BreadcrumbSeparator>/</BreadcrumbSeparator><BreadcrumbItem><BreadcrumbLink icon={<img src={image} alt="dashboard-icon" />}>- {title}+ <span className={styles.title} title={title}>+ {title}+ </span></BreadcrumbLink></BreadcrumbItem></BreadcrumbList>diff --git a/frontend/src/pages/DashboardsListPageV2/components/ActionsPopover/ActionsPopover.module.scss b/frontend/src/pages/DashboardsListPageV2/components/ActionsPopover/ActionsPopover.module.scssindex 04afe860fb..21ab8d2644 100644--- a/frontend/src/pages/DashboardsListPageV2/components/ActionsPopover/ActionsPopover.module.scss+++ b/frontend/src/pages/DashboardsListPageV2/components/ActionsPopover/ActionsPopover.module.scss@@ -42,3 +42,8 @@.menuItemWrap button:disabled {pointer-events: none;}++.deleteName {+ color: var(--danger-background);+ font-weight: var(--font-weight-medium);+}diff --git a/frontend/src/pages/DashboardsListPageV2/components/ActionsPopover/DeleteActionItem.tsx b/frontend/src/pages/DashboardsListPageV2/components/ActionsPopover/DeleteActionItem.tsxindex 2e594c44f2..c3d7632408 100644--- a/frontend/src/pages/DashboardsListPageV2/components/ActionsPopover/DeleteActionItem.tsx+++ b/frontend/src/pages/DashboardsListPageV2/components/ActionsPopover/DeleteActionItem.tsx@@ -1,9 +1,9 @@import { useCallback } from 'react';import { useTranslation } from 'react-i18next';import { useMutation, useQueryClient } from 'react-query';-import { Modal, Tooltip } from 'antd';+import { Tooltip } from 'antd';import { Button } from '@signozhq/ui/button';-import { CircleAlert, Trash2 } from '@signozhq/icons';+import { Trash2 } from '@signozhq/icons';import { toast } from '@signozhq/ui/sonner';import { Divider } from '@signozhq/ui/divider';import { Typography } from '@signozhq/ui/typography';@@ -18,6 +18,7 @@ import { useErrorModal } from 'providers/ErrorModalProvider';import APIError from 'types/api/error';import { USER_ROLES } from 'types/roles';+import { useDeleteConfirm } from '../DeleteConfirmModal/useDeleteConfirm';import styles from './ActionsPopover.module.scss';interface Props {@@ -41,7 +42,7 @@ function DeleteActionItem({const { user } = useAppContext();const { showErrorModal } = useErrorModal();const queryClient = useQueryClient();- const [modal, contextHolder] = Modal.useModal();+ const { contextHolder, confirmDelete } = useDeleteConfirm();const isAuthor = user?.email === createdBy;const isDisabled = isLocked || (user.role === USER_ROLES.VIEWER && !isAuthor);@@ -49,14 +50,12 @@ function DeleteActionItem({const { mutate: runDelete } = useMutation({mutationFn: () => deleteDashboardV2({ id: dashboardId }),onSuccess: async () => {- toast.success(- t('dashboard:delete_dashboard_success', { name: dashboardName }),- );void logEvent(DashboardListEvents.RowAction, {action: 'delete',dashboardId,});await invalidateListDashboardsForUserV2(queryClient);+ toast.success('Dashboard deleted successfully');},onError: (error: APIError) => {showErrorModal(error);@@ -64,39 +63,24 @@ function DeleteActionItem({});const openConfirm = useCallback((): void => {- modal.confirm({+ confirmDelete({title: (<Typography.Title level={5}>Are you sure you want to delete the- <span style={{ color: 'var(--danger-background)', fontWeight: 500 }}>+ <Typography.Text className={styles.deleteName}>{' '}{dashboardName}{' '}- </span>+ </Typography.Text>dashboard?</Typography.Title>),- icon: (- <CircleAlert- style={{ color: 'var(--danger-background)', marginInlineEnd: '12px' }}- size="3xl"- />- ),- okText: 'Delete',- okButtonProps: { danger: true },- // Returning a promise keeps the Delete button in a loading state and blocks- // re-clicks until the mutation settles, then closes the confirm.- onOk: () =>+ // Keeps the Delete button loading until the mutation settles, then closes.+ onConfirm: () =>new Promise<void>((resolve) => {runDelete(undefined, { onSettled: () => resolve() });}),- cancelButtonProps: {- onClick: (e): void => {- e.stopPropagation();- },- },- centered: true,});- }, [modal, dashboardName, runDelete]);+ }, [confirmDelete, dashboardName, runDelete]);const tooltip = ((): string => {if (!isLocked) {diff --git a/frontend/src/pages/DashboardsListPageV2/components/DashboardsList/DashboardsList.tsx b/frontend/src/pages/DashboardsListPageV2/components/DashboardsList/DashboardsList.tsxindex 497688fa44..7f7a174073 100644--- a/frontend/src/pages/DashboardsListPageV2/components/DashboardsList/DashboardsList.tsx+++ b/frontend/src/pages/DashboardsListPageV2/components/DashboardsList/DashboardsList.tsx@@ -115,9 +115,9 @@ function DashboardsList(): JSX.Element {void setPage(1);}, [resetView, setPage]);const handleRemoveView = useCallback(- (id: string): void => {- removeView(id);+ (id: string): Promise<void> => {void setPage(1);+ return removeView(id);},[removeView, setPage],);diff --git a/frontend/src/pages/DashboardsListPageV2/components/DeleteConfirmModal/DeleteConfirmModal.module.scss b/frontend/src/pages/DashboardsListPageV2/components/DeleteConfirmModal/DeleteConfirmModal.module.scssnew file mode 100644index 0000000000..c144cafb98--- /dev/null+++ b/frontend/src/pages/DashboardsListPageV2/components/DeleteConfirmModal/DeleteConfirmModal.module.scss@@ -0,0 +1,11 @@+// Vertically centre the alert icon against the confirm body, matching the v1+// dashboard delete button.+.deleteModal :global(.ant-modal-confirm-body) {+ align-items: center;+}++.icon {+ color: var(--danger-background);+ margin-inline-end: 12px;+ flex-shrink: 0;+}diff --git a/frontend/src/pages/DashboardsListPageV2/components/DeleteConfirmModal/useDeleteConfirm.tsx b/frontend/src/pages/DashboardsListPageV2/components/DeleteConfirmModal/useDeleteConfirm.tsxnew file mode 100644index 0000000000..d1cd315c58--- /dev/null+++ b/frontend/src/pages/DashboardsListPageV2/components/DeleteConfirmModal/useDeleteConfirm.tsx@@ -0,0 +1,49 @@+import { type ReactNode } from 'react';+import { Modal } from 'antd';+import { CircleAlert } from '@signozhq/icons';++import styles from './DeleteConfirmModal.module.scss';++interface ConfirmDeleteOptions {+ title: ReactNode;+ content?: ReactNode;+ confirmText?: string;+ onConfirm: () => void | Promise<void>;+}++interface UseDeleteConfirm {+ /** Must be rendered in the calling component for the modal to appear. */+ contextHolder: ReactNode;+ confirmDelete: (options: ConfirmDeleteOptions) => void;+}++/**+ * Shared destructive confirmation for deleting dashboards and saved views, so+ * both get the same alert icon, aligned title, danger button, and a working+ * Cancel (antd closes on Cancel as long as we don't override its `onClick`).+ */+export function useDeleteConfirm(): UseDeleteConfirm {+ const [modal, contextHolder] = Modal.useModal();++ const confirmDelete = ({+ title,+ content,+ confirmText = 'Delete',+ onConfirm,+ }: ConfirmDeleteOptions): void => {+ modal.confirm({+ className: styles.deleteModal,+ title,+ content,+ icon: <CircleAlert className={styles.icon} size="3xl" />,+ okText: confirmText,+ okButtonProps: { danger: true },+ // Returning a promise keeps Delete in a loading state until the action+ // settles, then antd closes the modal.+ onOk: () => Promise.resolve(onConfirm()),+ centered: true,+ });+ };++ return { contextHolder, confirmDelete };+}diff --git a/frontend/src/pages/DashboardsListPageV2/components/NewDashboardModal/NewDashboardModal.module.scss b/frontend/src/pages/DashboardsListPageV2/components/NewDashboardModal/NewDashboardModal.module.scssindex 1b79c1bc89..1a53947956 100644--- a/frontend/src/pages/DashboardsListPageV2/components/NewDashboardModal/NewDashboardModal.module.scss+++ b/frontend/src/pages/DashboardsListPageV2/components/NewDashboardModal/NewDashboardModal.module.scss@@ -128,7 +128,8 @@.requestForm {display: flex;- gap: 8px;+ flex-direction: column;+ gap: 10px;width: 100%;max-width: 380px;margin-top: 16px;@@ -136,6 +137,15 @@border-top: 1px solid var(--l2-border);}+.requestHeader {+ color: var(--l1-foreground);+}++.requestRow {+ display: flex;+ gap: 8px;+}+.requestInput {flex: 1;}diff --git a/frontend/src/pages/DashboardsListPageV2/components/NewDashboardModal/TemplatesPanel.tsx b/frontend/src/pages/DashboardsListPageV2/components/NewDashboardModal/TemplatesPanel.tsxindex fa2db589a6..44ba9ba798 100644--- a/frontend/src/pages/DashboardsListPageV2/components/NewDashboardModal/TemplatesPanel.tsx+++ b/frontend/src/pages/DashboardsListPageV2/components/NewDashboardModal/TemplatesPanel.tsx@@ -80,39 +80,49 @@ function TemplatesPanel(): JSX.Element {{isCloudUser && (<div className={styles.requestForm}>- <Input- className={styles.requestInput}- placeholder="Enter dashboard name..."- value={name}- testId="request-dashboard-name"- onChange={(e: ChangeEvent<HTMLInputElement>): void =>- setName(e.target.value)- }- onKeyDown={(e: KeyboardEvent<HTMLInputElement>): void => {- if (e.key === 'Enter') {- void handleRequest();- }- }}- />- <Button- variant="solid"- color="primary"- size="md"- disabled={submitting || requestName.length === 0}- testId="request-dashboard-submit"- prefix={- submitting ? (- <LoaderCircle size={14} className={styles.spinner} />- ) : (- <Check size={14} />- )- }- onClick={(): void => {- void handleRequest();- }}+ <Typography+ variant="text"+ size="sm"+ weight="semibold"+ className={styles.requestHeader}>- Submit- </Button>+ Request a new template+ </Typography>+ <div className={styles.requestRow}>+ <Input+ className={styles.requestInput}+ placeholder="Enter dashboard name..."+ value={name}+ testId="request-dashboard-name"+ onChange={(e: ChangeEvent<HTMLInputElement>): void =>+ setName(e.target.value)+ }+ onKeyDown={(e: KeyboardEvent<HTMLInputElement>): void => {+ if (e.key === 'Enter') {+ void handleRequest();+ }+ }}+ />+ <Button+ variant="solid"+ color="primary"+ size="md"+ disabled={submitting || requestName.length === 0}+ testId="request-dashboard-submit"+ prefix={+ submitting ? (+ <LoaderCircle size={14} className={styles.spinner} />+ ) : (+ <Check size={14} />+ )+ }+ onClick={(): void => {+ void handleRequest();+ }}+ >+ Submit+ </Button>+ </div></div>)}</div>diff --git a/frontend/src/pages/DashboardsListPageV2/components/ViewsRail/ViewsRail.tsx b/frontend/src/pages/DashboardsListPageV2/components/ViewsRail/ViewsRail.tsxindex 70d68f070d..05e704082a 100644--- a/frontend/src/pages/DashboardsListPageV2/components/ViewsRail/ViewsRail.tsx+++ b/frontend/src/pages/DashboardsListPageV2/components/ViewsRail/ViewsRail.tsx@@ -1,23 +1,16 @@import { type ChangeEvent, useCallback, useState } from 'react';-import { Modal } from 'antd';import logEvent from 'api/common/logEvent';import { Button } from '@signozhq/ui/button';import { Input } from '@signozhq/ui/input';import { Typography } from '@signozhq/ui/typography';-import {- Bookmark,- CircleAlert,- PenLine,- Plus,- Search,- Trash2,-} from '@signozhq/icons';+import { Bookmark, PenLine, Plus, Search, Trash2 } from '@signozhq/icons';import cx from 'classnames';import { DashboardListEvents } from 'pages/DashboardsListPageV2/constants/events';import type { SavedView } from '../../types';import { type BuiltinView } from '../../utils/views';+import { useDeleteConfirm } from '../DeleteConfirmModal/useDeleteConfirm';import ViewNamePopover from './ViewNamePopover';import styles from './ViewsRail.module.scss';@@ -36,7 +29,7 @@ interface Props {onSave: (name: string) => void;onSaveChanges: () => void;onReset: () => void;- onDelete: (id: string) => void;+ onDelete: (id: string) => Promise<void>;onRename: (id: string, name: string) => void;}@@ -68,7 +61,7 @@ function ViewsRail({const [saveOpen, setSaveOpen] = useState(false);const [renamingId, setRenamingId] = useState<string | null>(null);const [query, setQuery] = useState('');- const [modal, contextHolder] = Modal.useModal();+ const { contextHolder, confirmDelete } = useDeleteConfirm();const q = query.trim().toLowerCase();const matchesQuery = (label: string): boolean =>@@ -84,9 +77,9 @@ function ViewsRail({const noMatches =!!q && personal.length === 0 && system.length === 0 && custom.length === 0;- const confirmDelete = useCallback(+ const onConfirmDelete = useCallback((id: string, label: string): void => {- const { destroy } = modal.confirm({+ confirmDelete({title: (<Typography.Title level={5}>Delete the{' '}@@ -95,27 +88,15 @@ function ViewsRail({</Typography.Title>),content: 'This removes the saved view. Your dashboards are not affected.',- icon: (- <CircleAlert- style={{ color: 'var(--danger-background)', marginInlineEnd: '12px' }}- size="3xl"- />- ),- okText: 'Delete',- okButtonProps: {- danger: true,- onClick: (e): void => {- e.preventDefault();- e.stopPropagation();- void logEvent(DashboardListEvents.ViewDeleted, {});- onDelete(id);- destroy();- },+ // Return the delete promise so the modal's Delete button stays loading+ // until the backend call settles, then closes — matching dashboard delete.+ onConfirm: (): Promise<void> => {+ void logEvent(DashboardListEvents.ViewDeleted, {});+ return onDelete(id);},- centered: true,});},- [modal, onDelete],+ [confirmDelete, onDelete],);const handleSaveAsView = (name: string): void => {@@ -182,7 +163,7 @@ function ViewsRail({title="Delete view"onClick={(e): void => {e.stopPropagation();- confirmDelete(row.id, row.label);+ onConfirmDelete(row.id, row.label);}}><Trash2 size={12} />diff --git a/frontend/src/pages/DashboardsListPageV2/hooks/useActiveView.ts b/frontend/src/pages/DashboardsListPageV2/hooks/useActiveView.tsindex 6d43ef88ec..46ca4725a1 100644--- a/frontend/src/pages/DashboardsListPageV2/hooks/useActiveView.ts+++ b/frontend/src/pages/DashboardsListPageV2/hooks/useActiveView.ts@@ -42,7 +42,7 @@ export interface UseActiveViewResult {saveView: (name: string) => void;saveActiveView: () => void;resetView: () => void;- removeView: (id: string) => void;+ removeView: (id: string) => Promise<void>;renameView: (id: string, name: string) => void;}@@ -152,8 +152,14 @@ export function useActiveView({}, [canonicalQuery, setQuery, activeCustom, setSortColumn, setSortOrder]);const removeView = useCallback(- (id: string): void => {- deleteView(id);+ async (id: string): Promise<void> => {+ try {+ await deleteView(id);+ } catch {+ // Failure is surfaced by the delete mutation's error toast; still+ // settle so the confirm modal stops loading and closes.+ return;+ }if (activeViewId === id) {void setActiveViewId(BuiltinViewId.All);setQuery('');diff --git a/frontend/src/pages/DashboardsListPageV2/hooks/useSavedViews.ts b/frontend/src/pages/DashboardsListPageV2/hooks/useSavedViews.tsindex 7052d27fb9..4b91b3ee94 100644--- a/frontend/src/pages/DashboardsListPageV2/hooks/useSavedViews.ts+++ b/frontend/src/pages/DashboardsListPageV2/hooks/useSavedViews.ts@@ -46,7 +46,7 @@ export interface UseSavedViewsResult {isLoading: boolean;createView: (input: SavedViewInput) => Promise<SavedView | null>;updateView: (id: string, input: SavedViewInput) => void;- deleteView: (id: string) => void;+ deleteView: (id: string) => Promise<void>;}// Org-shared saved views, backed by the Views API. Exposes the list plus@@ -127,9 +127,8 @@ export function useSavedViews(): UseSavedViewsResult {);const deleteView = useCallback(- (id: string): void => {- deleteMutation.mutate({ pathParams: { id } });- },+ (id: string): Promise<void> =>+ deleteMutation.mutateAsync({ pathParams: { id } }).then(() => undefined),[deleteMutation],);