Skip to content

Commit 0b0021a

Browse files
committed
feat(studio): improve Ask agent UX, add tooltips to tabs and buttons
- Ask agent button turns green with checkmark on copy - Add button shows tooltip "Add to composition at current time" - Ask agent shows tooltip "Copy a prompt to paste into your AI agent" - Tab tooltips: Code, Comps, Assets, Catalog each explain their purpose - Search placeholder updated to "Search by name, category, or tag…"
1 parent 76d2c6a commit 0b0021a

2 files changed

Lines changed: 45 additions & 15 deletions

File tree

packages/studio/src/components/sidebar/BlocksTab.tsx

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const BlocksTab = memo(function BlocksTab({ onAddBlock, onPreviewBlock }:
6363
type="text"
6464
value={search}
6565
onChange={(e) => setSearch(e.target.value)}
66-
placeholder="Search blocks…"
66+
placeholder="Search by name, category, or tag…"
6767
className="w-full bg-neutral-900 border border-neutral-800 rounded-md pl-7 pr-2 py-1.5 text-[11px] text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:border-neutral-700 transition-colors"
6868
/>
6969
</div>
@@ -400,6 +400,7 @@ function BlockCard({
400400
<button
401401
type="button"
402402
onClick={handleAdd}
403+
title="Add to composition at current time"
403404
className="flex items-center gap-1 px-3 py-1.5 rounded-md bg-white text-black text-[10px] font-semibold hover:bg-neutral-200 transition-colors"
404405
>
405406
<svg
@@ -412,26 +413,51 @@ function BlockCard({
412413
>
413414
<path d="M12 5v14M5 12h14" />
414415
</svg>
415-
{adding ? "Added" : "Add"}
416+
{adding ? "Added!" : "Add"}
416417
</button>
417418
)}
418419
<button
419420
type="button"
420421
onClick={handleCopyPrompt}
421-
className={`flex items-center gap-1 px-3 ${onAdd ? "py-1" : "py-1.5"} rounded-md ${onAdd ? "bg-white/15 text-white/90 text-[9px]" : "bg-white text-black text-[10px] font-semibold"} hover:bg-white/25 transition-colors`}
422+
title="Copy a prompt to paste into your AI agent"
423+
className={`flex items-center gap-1.5 px-3 ${onAdd ? "py-1" : "py-1.5"} rounded-md transition-colors ${
424+
copied
425+
? "bg-emerald-500 text-white"
426+
: onAdd
427+
? "bg-white/15 text-white/90 hover:bg-white/25"
428+
: "bg-white text-black hover:bg-neutral-200"
429+
} ${onAdd ? "text-[9px]" : "text-[10px] font-semibold"}`}
422430
>
423-
<svg
424-
width={onAdd ? 9 : 12}
425-
height={onAdd ? 9 : 12}
426-
viewBox="0 0 24 24"
427-
fill="none"
428-
stroke="currentColor"
429-
strokeWidth="2"
430-
>
431-
<rect x="9" y="9" width="13" height="13" rx="2" />
432-
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
433-
</svg>
434-
{copied ? "Copied!" : "Ask agent"}
431+
{copied ? (
432+
<>
433+
<svg
434+
width={onAdd ? 9 : 11}
435+
height={onAdd ? 9 : 11}
436+
viewBox="0 0 24 24"
437+
fill="none"
438+
stroke="currentColor"
439+
strokeWidth="2.5"
440+
>
441+
<path d="M20 6 9 17l-5-5" />
442+
</svg>
443+
Copied!
444+
</>
445+
) : (
446+
<>
447+
<svg
448+
width={onAdd ? 9 : 11}
449+
height={onAdd ? 9 : 11}
450+
viewBox="0 0 24 24"
451+
fill="none"
452+
stroke="currentColor"
453+
strokeWidth="2"
454+
>
455+
<rect x="9" y="9" width="13" height="13" rx="2" />
456+
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
457+
</svg>
458+
Ask agent
459+
</>
460+
)}
435461
</button>
436462
</div>
437463

packages/studio/src/components/sidebar/LeftSidebar.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export const LeftSidebar = memo(
127127
<button
128128
type="button"
129129
onClick={() => selectTab("code")}
130+
title="Source code editor"
130131
className={`rounded-[14px] px-1.5 py-2 text-[10px] font-semibold truncate transition-all ${
131132
tab === "code"
132133
? "bg-neutral-800 text-white"
@@ -138,6 +139,7 @@ export const LeftSidebar = memo(
138139
<button
139140
type="button"
140141
onClick={() => selectTab("compositions")}
142+
title="Composition layers and sub-compositions"
141143
className={`rounded-[14px] px-1.5 py-2 text-[10px] font-semibold truncate transition-all ${
142144
tab === "compositions"
143145
? "bg-neutral-800 text-white"
@@ -149,6 +151,7 @@ export const LeftSidebar = memo(
149151
<button
150152
type="button"
151153
onClick={() => selectTab("assets")}
154+
title="Media assets — videos, images, audio, fonts"
152155
className={`rounded-[14px] px-1.5 py-2 text-[10px] font-semibold truncate transition-all ${
153156
tab === "assets"
154157
? "bg-neutral-800 text-white"
@@ -161,6 +164,7 @@ export const LeftSidebar = memo(
161164
<button
162165
type="button"
163166
onClick={() => selectTab("blocks")}
167+
title="Browse blocks, components, and templates from the registry"
164168
className={`rounded-[14px] px-1.5 py-2 text-[10px] font-semibold truncate transition-all ${
165169
tab === "blocks"
166170
? "bg-neutral-800 text-white"

0 commit comments

Comments
 (0)