Skip to content

Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.

fix: gate content dismiss actions behind confirmation and undo (#653)

Adarsh Mishra59ea796e38d1
diff --git a/web/messages/en.json b/web/messages/en.json
index 9a7bdb0f8..5c1b57179 100644
--- a/web/messages/en.json
+++ b/web/messages/en.json
@@ -232,6 +232,10 @@
"sendToWorkflow": "Send to Workflow",
"sending": "Sending...",
"dismiss": "Dismiss",
+ "dismissedToast": "Opportunity dismissed",
+ "undo": "Undo",
+ "undoFailed": "Failed to undo",
+ "cancel": "Cancel",
"viewDetails": "View Details",
"configureWebhook": "Configure Webhook",
"noOpportunities": "No content opportunities yet",
@@ -268,7 +272,9 @@
"bulk": {
"selected": "{count} selected",
"sendAll": "Send All",
- "dismissAll": "Dismiss All"
+ "dismissAll": "Dismiss All",
+ "dismissAllTitle": "Dismiss opportunities?",
+ "dismissAllConfirm": "{count, plural, one {This will dismiss # opportunity.} other {This will dismiss # opportunities.}} This can't be undone."
},
"table": {
"action": "Action",
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/[id]/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/[id]/page.tsx
index 7dc5325bb..0f3e3a39b 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/[id]/page.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/[id]/page.tsx
@@ -143,9 +143,22 @@ export default function ContentDetailPage() {
const handleDismiss = async () => {
try {
await updateOpportunityStatus(id, 'dismissed');
- toast.success('Opportunity dismissed');
const updated = await getOpportunity(id);
setOpportunity(updated);
+ toast.success(t('dismissedToast'), {
+ action: {
+ label: t('undo'),
+ onClick: async () => {
+ try {
+ await updateOpportunityStatus(id, 'new');
+ const restored = await getOpportunity(id);
+ setOpportunity(restored);
+ } catch {
+ toast.error(t('undoFailed'));
+ }
+ },
+ },
+ });
} catch {
toast.error('Failed to dismiss');
}
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/page.tsx
index 48652e902..d22437695 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/page.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/page.tsx
@@ -14,6 +14,16 @@ import {
SelectTrigger,
SelectValue,
} from '@/components/ui/select';
+import {
+ Dialog,
+ DialogClose,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+ DialogTrigger,
+} from '@/components/ui/dialog';
import {
Table,
TableBody,
@@ -292,8 +302,20 @@ export default function ContentPage() {
const handleDismiss = async (id: string) => {
try {
await updateOpportunityStatus(id, 'dismissed');
- toast.success('Opportunity dismissed');
await loadData(true);
+ toast.success(t('dismissedToast'), {
+ action: {
+ label: t('undo'),
+ onClick: async () => {
+ try {
+ await updateOpportunityStatus(id, 'new');
+ await loadData(true);
+ } catch {
+ toast.error(t('undoFailed'));
+ }
+ },
+ },
+ });
} catch (err) {
console.error('Dismiss failed:', err);
toast.error('Failed to dismiss');
@@ -566,16 +588,39 @@ export default function ContentPage() {
Done
</Button>
- <Button
- variant="outline"
- size="sm"
- className="h-7 text-xs gap-1.5 text-muted-foreground"
- onClick={handleBulkDismiss}
- disabled={bulkSending}
- >
- <X className="h-3 w-3" />
- {t('bulk.dismissAll')}
- </Button>
+ <Dialog>
+ <DialogTrigger
+ render={
+ <Button
+ variant="outline"
+ size="sm"
+ className="h-7 text-xs gap-1.5 text-muted-foreground"
+ disabled={bulkSending}
+ />
+ }
+ >
+ <X className="h-3 w-3" />
+ {t('bulk.dismissAll')}
+ </DialogTrigger>
+ <DialogContent className="sm:max-w-sm">
+ <DialogHeader>
+ <DialogTitle>{t('bulk.dismissAllTitle')}</DialogTitle>
+ <DialogDescription>
+ {t('bulk.dismissAllConfirm', { count: selectedIds.size })}
+ </DialogDescription>
+ </DialogHeader>
+ <DialogFooter>
+ <DialogClose render={<Button variant="outline" />}>
+ {t('cancel')}
+ </DialogClose>
+ <DialogClose
+ render={<Button variant="destructive" onClick={handleBulkDismiss} />}
+ >
+ {t('bulk.dismissAll')}
+ </DialogClose>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
</div>
</div>
)}