refactor(ai-toolbar): cluster example prompts in masonry layout

This commit is contained in:
2026-04-22 17:42:29 -04:00
parent 8b17d75193
commit e1a12d0c71
2 changed files with 26 additions and 14 deletions

View File

@@ -332,26 +332,29 @@ export const AIToolbar = ({
}} }}
/> />
<div className="border-t border-border px-3 py-3"> <div className="border-t border-border px-3 py-3">
<div className="flex flex-wrap items-center gap-2"> <div className="space-y-2">
<span className="text-[11px] font-medium uppercase tracking-[0.18em] text-muted-foreground"> <span className="text-[11px] font-medium uppercase tracking-[0.18em] text-muted-foreground">
Try: Try:
</span> </span>
<div className="columns-2 gap-2">
{examplePrompts.map((prompt) => ( {examplePrompts.map((prompt) => (
<div key={prompt} className="mb-2 break-inside-avoid">
<Button <Button
key={prompt}
type="button" type="button"
variant="secondary" variant="secondary"
size="sm" size="sm"
className="h-7 max-w-full rounded-full px-2.5 text-[11px]" className="h-auto w-full text-left justify-start rounded-2xl px-3 py-2 text-[11px] leading-relaxed"
onClick={() => onAiTemplateSelect(prompt)} onClick={() => onAiTemplateSelect(prompt)}
disabled={aiLoading || !canUseAi} disabled={aiLoading || !canUseAi}
> >
<span className="truncate">{prompt}</span> {prompt}
</Button> </Button>
</div>
))} ))}
</div> </div>
</div> </div>
</div> </div>
</div>
<div className="flex flex-wrap items-center justify-between gap-2"> <div className="flex flex-wrap items-center justify-between gap-2">
<div className="flex items-center gap-1.5"> <div className="flex items-center gap-1.5">

View File

@@ -166,6 +166,15 @@ describe("AI capture redesign", () => {
expect(source).not.toContain("lg:grid-cols-"); expect(source).not.toContain("lg:grid-cols-");
}); });
test("example prompts use a masonry-style cluster inside the composer footer", () => {
const source = readToolbarSource();
expect(source).toContain("Try:");
expect(source).toContain("columns-2");
expect(source).toContain("break-inside-avoid");
expect(source).toContain("w-full text-left");
});
test("desktop composer uses a two-column row when the page gives it full-width space", () => { test("desktop composer uses a two-column row when the page gives it full-width space", () => {
const source = readToolbarSource(); const source = readToolbarSource();