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.
TypeScript aeoai-agentai-searchanswer-engine-optimizationbrand-monitoringchatgptclaudecopilotdockergeminigeogoogle-ai-overviewsgrokmcpnextjsopen-sourceperplexityseosupabasetypescript
fix(content): keep a long title or pick inside the New content dialog (#1318)
Cihan725f0da83288
diff --git a/web/src/components/content/new-content-dialog.test.tsx b/web/src/components/content/new-content-dialog.test.tsxindex c0de2d074..c74cda756 100644--- a/web/src/components/content/new-content-dialog.test.tsx+++ b/web/src/components/content/new-content-dialog.test.tsx@@ -164,6 +164,28 @@ describe('New content', () => {expect(push).toHaveBeenCalledWith('/dashboard/content/editor/d9');});+ it('keeps a long pick and a long title inside the dialog', async () => {+ await render();+ // A single column no wider than the dialog: content can't widen it. No+ // taller than the window either: it scrolls, its buttons kept in view.+ const dialog = document.querySelector('[data-slot="dialog-content"]')!;+ expect(dialog.className).toContain('grid-cols-[minmax(0,1fr)]');+ expect(dialog.className).toContain('max-h-[calc(100dvh-2rem)]');+ expect(dialog.className).toContain('overflow-y-auto');+ expect(document.querySelector('[data-slot="dialog-footer"]')!.className).toContain('sticky');++ await click(button('Pick an opportunity'));+ const option = [...document.querySelectorAll<HTMLElement>('[role="option"]')].find(+ (o) => o.textContent === 'Northwind vs HubSpot',+ );+ await click(option);+ // The pick truncates inside the trigger, beside its chevron.+ const value = [...document.querySelectorAll('span.truncate')].find(+ (s) => s.textContent === 'Northwind vs HubSpot',+ );+ expect(value?.closest('[data-slot="combobox-trigger"]')).not.toBeNull();+ });+it('names the page by the opportunity’s brief title when it has one', async () => {await render();await click(button('Pick an opportunity'));diff --git a/web/src/components/content/new-content-dialog.tsx b/web/src/components/content/new-content-dialog.tsxindex 03a77f779..44cc74e04 100644--- a/web/src/components/content/new-content-dialog.tsx+++ b/web/src/components/content/new-content-dialog.tsx@@ -552,7 +552,12 @@ export function NewContentDialog({return (<Dialog open={open} onOpenChange={changeOpen}>- <DialogContent className="sm:max-w-xl">+ {/*+ One column no wider than the dialog: a long title or pick truncates+ instead of widening it. No taller than the window: Start scrolls,+ its buttons kept in view.+ */}+ <DialogContent className="max-h-[calc(100dvh-2rem)] grid-cols-[minmax(0,1fr)] overflow-y-auto sm:max-w-2xl">{start ? (<><DialogHeader>@@ -648,7 +653,7 @@ export function NewContentDialog({))}</div></div>- <DialogFooter>+ <DialogFooter className="sticky -bottom-4 z-10 bg-muted"><Button variant="ghost" onClick={() => setStart(null)} disabled={opening}><ArrowLeft className="h-4 w-4" />{t('back')}@@ -735,7 +740,9 @@ export function NewContentDialog({title={picked?.label}>{options ? (- <ComboboxValue placeholder={t(`sources.${kind}.placeholder`)} />+ <span className="min-w-0 flex-1 truncate text-left">+ <ComboboxValue placeholder={t(`sources.${kind}.placeholder`)} />+ </span>) : (<span className="flex items-center gap-2 text-muted-foreground"><Loader2 className="h-3.5 w-3.5 animate-spin" />@@ -897,7 +904,7 @@ export function NewContentDialog({</div>)}- <DialogFooter>+ <DialogFooter className="sticky -bottom-4 z-10 bg-muted"><Button variant="ghost" onClick={() => changeOpen(false)}>{t('cancel')}</Button>