Skip to content

Commit 2cc384f

Browse files
feat(studio): draw icons that say what the feature does (#4262)
1 parent 3e63de4 commit 2cc384f

6 files changed

Lines changed: 68 additions & 23 deletions

File tree

‎packages/studio/src/components/StudioHeader.tsx‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { usePanelLayoutContext } from "../contexts/PanelLayoutContext";
55
import { trackStudioEvent } from "../utils/studioTelemetry";
66
import { Button, buttonBase, buttonSizes, buttonVariants, cn, Tooltip } from "./ui";
77
import { Dock } from "./dock/Dock";
8+
import { InspectorIcon } from "./icons/InspectorIcon";
89

910
export interface StudioHeaderProps {
1011
captureFrameHref: string;
@@ -247,19 +248,7 @@ export function StudioHeader({
247248
"h-full rounded-none",
248249
inspectorButtonActive && "bg-hover text-accent enabled:hover:text-accent",
249250
)}
250-
icon={
251-
<svg
252-
width="12"
253-
height="12"
254-
viewBox="0 0 24 24"
255-
fill="none"
256-
stroke="currentColor"
257-
strokeWidth="2"
258-
>
259-
<circle cx="12" cy="12" r="10" />
260-
<polygon points="10 8 16 12 10 16" fill="currentColor" stroke="none" />
261-
</svg>
262-
}
251+
icon={<InspectorIcon size={16} />}
263252
onClick={() => {
264253
if (shouldOpenInspector(rightCollapsed, inspectorPanelActive)) {
265254
trackStudioEvent("panel_toggle", { panel: "inspector", collapsed: false });

‎packages/studio/src/components/TimelineToolbar.tsx‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
import { useEffect, useRef } from "react";
2-
import {
3-
Image,
4-
Magnet,
5-
MagnifyingGlassMinus,
6-
MagnifyingGlassPlus,
7-
Waves,
8-
} from "@phosphor-icons/react";
2+
import { Image, Magnet, MagnifyingGlassMinus, MagnifyingGlassPlus } from "@phosphor-icons/react";
93
import {
104
useEnableKeyframes,
115
isPlayheadWithinTween,
@@ -23,6 +17,7 @@ import { useTimelineZoom } from "../player/components/useTimelineZoom";
2317
import { usePlayerStore, type TimelineElement } from "../player";
2418
import { Tooltip } from "./ui";
2519
import { AudioMetersIcon } from "./icons/AudioMetersIcon";
20+
import { RippleEditIcon } from "./icons/RippleEditIcon";
2621
import { flatActive, flatBtn, flatDisabled, flatIdle } from "./timelineToolbarStyles";
2722
import { TimelineHistoryButtons } from "./TimelineHistoryButtons";
2823
import { Scissors } from "../icons/SystemIcons";
@@ -252,7 +247,7 @@ export function TimelineToolbar({ domEditSession, onSplitElement }: TimelineTool
252247
aria-pressed={rippleEditEnabled}
253248
className={rippleEditEnabled ? flatActive : flatIdle}
254249
>
255-
<Waves size={16} weight="bold" aria-hidden="true" />
250+
<RippleEditIcon size={16} />
256251
</button>
257252
</Tooltip>
258253
{projectHasAudio && (

‎packages/studio/src/components/editor/propertyPanelFill.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { buildProjectApiPath } from "../../utils/projectRouting";
22
import { useMemo, useRef, useState } from "react";
3-
import { Plus, RotateCcw, X } from "../../icons/SystemIcons";
3+
import { Plus, X } from "../../icons/SystemIcons";
44
import {
55
buildDefaultGradientModel,
66
insertGradientStop,
77
parseGradient,
88
serializeGradient,
99
type GradientModel,
1010
} from "./gradientValue";
11+
import { ReverseGradientIcon } from "../icons/ReverseGradientIcon";
1112
import { IMAGE_EXT } from "../../utils/mediaTypes";
1213
import { FIELD, LABEL, RESPONSIVE_GRID } from "./propertyPanelHelpers";
1314
import {
@@ -358,7 +359,7 @@ export function GradientField({
358359
}}
359360
className="inline-flex h-7 items-center gap-1.5 rounded-lg border border-neutral-700 bg-neutral-950 px-2.5 text-[11px] font-medium text-neutral-300 transition-colors hover:border-neutral-600 hover:text-white disabled:cursor-not-allowed disabled:text-neutral-600"
360361
>
361-
<RotateCcw size={12} />
362+
<ReverseGradientIcon size={16} />
362363
Reverse
363364
</button>
364365
</div>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export function InspectorIcon({ size = 16 }: { size?: number | string }) {
2+
return (
3+
<svg
4+
width={size}
5+
height={size}
6+
viewBox="0 0 16 16"
7+
fill="none"
8+
stroke="currentColor"
9+
strokeWidth={1.5}
10+
strokeLinecap="round"
11+
strokeLinejoin="round"
12+
aria-hidden="true"
13+
>
14+
<rect x="1.5" y="2" width="13" height="12" rx="1.5" />
15+
<path d="M4 6h8M6 4.5v3M4 10h8m-2-1.5v3" />
16+
</svg>
17+
);
18+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
export function ReverseGradientIcon({ size = 16 }: { size?: number | string }) {
2+
return (
3+
<svg
4+
width={size}
5+
height={size}
6+
viewBox="0 0 16 16"
7+
fill="none"
8+
stroke="currentColor"
9+
strokeWidth={1.5}
10+
strokeLinecap="round"
11+
strokeLinejoin="round"
12+
aria-hidden="true"
13+
>
14+
<path d="M2 3h12m-2-2 2 2-2 2M14 8H2m2-2L2 8l2 2" />
15+
<g fill="currentColor" stroke="none">
16+
<path d="M2 12h3v2H2z" opacity="0.25" />
17+
<path d="M5 12h3v2H5z" opacity="0.5" />
18+
<path d="M8 12h3v2H8z" opacity="0.75" />
19+
<path d="M11 12h3v2h-3z" />
20+
</g>
21+
</svg>
22+
);
23+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export function RippleEditIcon({ size = 16 }: { size?: number | string }) {
2+
return (
3+
<svg
4+
width={size}
5+
height={size}
6+
viewBox="0 0 16 16"
7+
fill="none"
8+
stroke="currentColor"
9+
strokeWidth={1.5}
10+
strokeLinecap="round"
11+
strokeLinejoin="round"
12+
aria-hidden="true"
13+
>
14+
<rect x="1.5" y="8" width="4" height="5" rx="0.5" />
15+
<rect x="10.5" y="8" width="4" height="5" rx="0.5" />
16+
<path d="M13 4H6m2-2L6 4l2 2" />
17+
</svg>
18+
);
19+
}

0 commit comments

Comments
 (0)