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(content): size the small loading dots to an icon, and let a loader name itself to screen readers (#1446)

Cihan94d7cc2c1bed
diff --git a/web/messages/en.json b/web/messages/en.json
index 3475912ae..27746689d 100644
--- a/web/messages/en.json
+++ b/web/messages/en.json
@@ -3472,6 +3472,7 @@
"file": "Upload file",
"pastePlaceholder": "Paste from Word, Google Docs or a web page. Headings, lists, links and tables are kept.",
"choose": "Choose a file or drop it here",
+ "reading": "Reading the file",
"fileHint": "Word, Markdown, HTML or text · up to 10 MB",
"summary": "{headings, plural, =0 {No headings} one {# heading} other {# headings}} · {characters} characters",
"imagesLeftOut": "{count, plural, one {# image} other {# images}} left out",
@@ -5047,6 +5048,7 @@
},
"webhook": {
"title": "Webhook Settings",
+ "loading": "Loading the webhook settings",
"description": "Connect your workflow automation tool (n8n, Make, Zapier) and choose which events it receives.",
"eventsTitle": "Events to send",
"eventsDescription": "Only selected events are sent. Test Webhook always sends a test event, regardless of these selections.",
@@ -5076,6 +5078,8 @@
"loadError": "Failed to load content opportunities",
"exportError": "Failed to export opportunities",
"loadOpportunityError": "Failed to load opportunity",
+ "loadingOpportunities": "Loading the opportunities",
+ "loadingOpportunity": "Loading the opportunity",
"generationFailed": "Generation failed — please try again",
"generationTimedOut": "Generation timed out — please try again",
"generateError": "Failed to generate opportunities",
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/_webhook-settings.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/_webhook-settings.tsx
index f5324e8d6..41fc90446 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/_webhook-settings.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/_webhook-settings.tsx
@@ -130,7 +130,7 @@ export function WebhookSettingsDialog({ open, onOpenChange, brandId }: WebhookSe
{loading ? (
<div className="flex justify-center py-8">
- <LoadingDots size="md" className="text-muted-foreground" />
+ <LoadingDots size="md" label={t('loading')} className="text-muted-foreground" />
</div>
) : (
<div className="space-y-4">
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/page.tsx
index f871085a9..e39f7000b 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/page.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/page.tsx
@@ -1083,7 +1083,11 @@ export default function ContentPage() {
{loading && opportunities.length === 0 ? (
<div className="flex items-center justify-center min-h-[300px]">
- <LoadingDots size="md" className="text-muted-foreground" />
+ <LoadingDots
+ size="md"
+ label={t('loadingOpportunities')}
+ className="text-muted-foreground"
+ />
</div>
) : opportunities.length === 0 && !hasActiveFilters ? (
<Card>
diff --git a/web/src/components/content/new-content-dialog.tsx b/web/src/components/content/new-content-dialog.tsx
index 5123e8578..cbf1a60b8 100644
--- a/web/src/components/content/new-content-dialog.tsx
+++ b/web/src/components/content/new-content-dialog.tsx
@@ -993,7 +993,10 @@ export function NewContentDialog({
className="flex w-full flex-col items-center gap-1 rounded-lg border border-dashed px-3 py-6 text-center text-sm transition-colors hover:bg-muted/50"
>
{reading ? (
- <LoadingDots className="text-muted-foreground" />
+ <LoadingDots
+ label={t('content.reading')}
+ className="text-muted-foreground"
+ />
) : (
<span className="font-medium">{t('content.choose')}</span>
)}
diff --git a/web/src/components/content/opportunity-basket.tsx b/web/src/components/content/opportunity-basket.tsx
index 79f10fb83..2491f39cc 100644
--- a/web/src/components/content/opportunity-basket.tsx
+++ b/web/src/components/content/opportunity-basket.tsx
@@ -299,7 +299,7 @@ export function AssetsCard({
disabled={sendingKey !== null && sendingKey !== undefined}
onClick={() => onSend(a.key)}
>
- {sendingKey === a.key ? <LoadingDots /> : t('sendAsset')}
+ {sendingKey === a.key ? <LoadingDots label={t('sending')} /> : t('sendAsset')}
</Button>
)
)}
diff --git a/web/src/components/content/opportunity-detail.tsx b/web/src/components/content/opportunity-detail.tsx
index 4a05cd6e4..11adfa965 100644
--- a/web/src/components/content/opportunity-detail.tsx
+++ b/web/src/components/content/opportunity-detail.tsx
@@ -420,7 +420,7 @@ export function OpportunityDetail({
if (loading) {
return (
<div className="flex items-center justify-center min-h-[400px]">
- <LoadingDots size="md" className="text-muted-foreground" />
+ <LoadingDots size="md" label={t('loadingOpportunity')} className="text-muted-foreground" />
</div>
);
}
diff --git a/web/src/components/ui/loading-dots.test.tsx b/web/src/components/ui/loading-dots.test.tsx
index 0706d4041..547276e90 100644
--- a/web/src/components/ui/loading-dots.test.tsx
+++ b/web/src/components/ui/loading-dots.test.tsx
@@ -2,7 +2,10 @@ import { renderToStaticMarkup } from 'react-dom/server';
import { describe, expect, it } from 'vitest';
import { LoadingDots } from './loading-dots';
-/** The dots say nothing to a screen reader, and stay visible with reduced motion. */
+/**
+ * The dots say nothing to a screen reader unless they have a label, stay
+ * visible with reduced motion, and take a 16 px icon's place.
+ */
describe('LoadingDots', () => {
it('is hidden from screen readers and stays visible without motion', () => {
@@ -16,4 +19,21 @@ describe('LoadingDots', () => {
expect(dot.className).toContain('motion-reduce:opacity-60');
}
});
+
+ it('is as wide as the icon it stands in for beside a label', () => {
+ const html = renderToStaticMarkup(<LoadingDots />);
+ const root = new DOMParser().parseFromString(html, 'text/html').body.firstElementChild!;
+ expect(root.className).toContain('w-4');
+ expect(root.className).toContain('justify-center');
+ });
+
+ it('says its label as a status, the dots still hidden', () => {
+ const html = renderToStaticMarkup(<LoadingDots label="Sending..." className="mr-1" />);
+ const root = new DOMParser().parseFromString(html, 'text/html').body.firstElementChild!;
+ expect(root.getAttribute('role')).toBe('status');
+ expect(root.className).toContain('mr-1');
+ expect(root.querySelector('[aria-hidden="true"]')!.children).toHaveLength(3);
+ expect(root.querySelector('.sr-only')!.textContent).toBe('Sending...');
+ expect(root.textContent).toBe('Sending...');
+ });
});
diff --git a/web/src/components/ui/loading-dots.tsx b/web/src/components/ui/loading-dots.tsx
index a3b18cf33..2505bbd2a 100644
--- a/web/src/components/ui/loading-dots.tsx
+++ b/web/src/components/ui/loading-dots.tsx
@@ -4,22 +4,29 @@ import { cn } from '@/lib/utils';
* Something loading or at work, without a spinning ring (Content Editor
* brief: "no spinning ring anywhere"): three dots that bounce in turn, in the
* text's color. Still with reduced motion. `md` for a page or a panel
- * loading, `sm` (the default) beside a button's label.
+ * loading, `sm` (the default) beside a button's label, as wide as the 16 px
+ * icon it often stands in for, so the label beside it doesn't move.
+ *
+ * The dots say nothing to a screen reader. `label` is for a loader nothing
+ * else names (a page or a dialog loading, a button whose label they
+ * replace): it is said as a status.
*/
export function LoadingDots({
size = 'sm',
+ label,
className,
}: {
size?: 'sm' | 'md';
+ label?: string;
className?: string;
}) {
- return (
+ const dots = (
<span
aria-hidden
className={cn(
'inline-flex shrink-0 items-center align-middle',
- size === 'md' ? 'gap-1' : 'gap-[3px]',
- className,
+ size === 'md' ? 'gap-1' : 'w-4 justify-center gap-0.5',
+ !label && className,
)}
>
{[0, 1, 2].map((i) => (
@@ -35,4 +42,11 @@ export function LoadingDots({
))}
</span>
);
+ if (!label) return dots;
+ return (
+ <span role="status" className={cn('inline-flex shrink-0 items-center align-middle', className)}>
+ {dots}
+ <span className="sr-only">{label}</span>
+ </span>
+ );
}