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(posthog-ai): keep the quill composer on one row in narrow panels (#114375)

Shy Alter938eda7af042
diff --git a/products/posthog_ai/frontend/components/composer/ComposerModelEffortPickers.tsx b/products/posthog_ai/frontend/components/composer/ComposerModelEffortPickers.tsx
index c5cee5f29d67..9158b6409a13 100644
--- a/products/posthog_ai/frontend/components/composer/ComposerModelEffortPickers.tsx
+++ b/products/posthog_ai/frontend/components/composer/ComposerModelEffortPickers.tsx
@@ -281,7 +281,9 @@ export function ComposerModelEffortPickers({
<Button variant={chrome.triggerVariant} size="sm">
{isDefaultSelection && chrome.defaultPrefix ? `Default · ${modelLabel}` : modelLabel}
{effortOptions.length > 0 && (
- <span className="text-muted">{getEffortLabel(selectedEffort)}</span>
+ <span className="text-muted @max-[400px]/composer:hidden">
+ {getEffortLabel(selectedEffort)}
+ </span>
)}
{billing?.value === ModelAccessEnumApi.OwnSubscription && (
<span className="text-muted">ChatGPT plan</span>
diff --git a/products/posthog_ai/frontend/components/quill/QuillAttachedContextPicker.tsx b/products/posthog_ai/frontend/components/quill/QuillAttachedContextPicker.tsx
index ca287944d622..2f89cf751a50 100644
--- a/products/posthog_ai/frontend/components/quill/QuillAttachedContextPicker.tsx
+++ b/products/posthog_ai/frontend/components/quill/QuillAttachedContextPicker.tsx
@@ -94,7 +94,7 @@ export function QuillAttachedContextPicker(): JSX.Element {
data-attr="posthog-ai-context-picker"
>
<IconAtSign />
- <span>Add context</span>
+ <span className="@max-[480px]/composer:hidden">Add context</span>
</Button>
}
/>
diff --git a/products/posthog_ai/frontend/components/quill/QuillComposerLayout.tsx b/products/posthog_ai/frontend/components/quill/QuillComposerLayout.tsx
index 4a501ec6bc2a..21c9fe15170a 100644
--- a/products/posthog_ai/frontend/components/quill/QuillComposerLayout.tsx
+++ b/products/posthog_ai/frontend/components/quill/QuillComposerLayout.tsx
@@ -34,9 +34,9 @@ export function QuillComposerLayout({
// The textarea is Lemon's, so quill's own focus rule, keyed to its input slot, never fires here.
'h-auto cursor-text bg-[var(--card)] focus-within:border-[color-mix(in_oklab,var(--ring)_50%,transparent)] focus-within:shadow-[0_0_0_3px_color-mix(in_oklab,var(--ring)_30%,transparent)] ' +
// LemonTextArea puts the composer's padding on both its wrapper and the textarea. The wrapper keeps it, so the textarea drops it. The textarea keeps 2px on the left because it clips the caret at x=0.
- '[&_[data-slot=composer-placeholder]]:top-2 [&_[data-slot=composer-placeholder]]:left-2.5 [&_textarea]:p-0 [&_textarea]:pl-0.5 ' +
+ '[&_[data-slot=composer-placeholder]]:top-2 [&_[data-slot=composer-placeholder]]:left-2.5 [&_[data-slot=composer-placeholder]]:right-0 [&_[data-slot=composer-placeholder]]:truncate [&_textarea]:p-0 [&_textarea]:pl-0.5 ' +
// One line tall at rest: the field is only as tall as the send button and its ledge need, then grows with the text.
- '[&_:has(>textarea)]:min-h-10 [&_textarea]:min-h-0'
+ '[&_:has(>textarea)]:min-h-10 [&_:has(>textarea)]:pr-1 [&_textarea]:min-h-0'
}
>
{chips && (
@@ -44,9 +44,9 @@ export function QuillComposerLayout({
{chips}
</InputGroupAddon>
)}
- <div className="relative w-full">
- {field}
- <span className="absolute right-1 bottom-1 flex items-center">{send}</span>
+ <div className="flex w-full items-end gap-1">
+ <div className="relative min-w-0 flex-1">{field}</div>
+ <span className="flex shrink-0 items-center pr-1 pb-1">{send}</span>
</div>
</InputGroup>
{(controls || meta) && (