Skip to content

Commit 1de2de4

Browse files
committed
feat(studio): redesign Asset tab + fix beat analysis auto-trigger
Asset tab: categorized sections, filter chips, text search, audio spectrum visualizer, "in use" badge, manifest metadata, panel tokens. Beat fix: only run analysis when a beats file exists on disk.
1 parent b624709 commit 1de2de4

4 files changed

Lines changed: 691 additions & 275 deletions

File tree

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
export function ContextMenu({
2+
x,
3+
y,
4+
asset,
5+
onClose,
6+
onCopy,
7+
onDelete,
8+
onRename,
9+
}: {
10+
x: number;
11+
y: number;
12+
asset: string;
13+
onClose: () => void;
14+
onCopy: (path: string) => void;
15+
onDelete?: (path: string) => void;
16+
onRename?: (oldPath: string, newPath: string) => void;
17+
}) {
18+
return (
19+
<div
20+
className="fixed inset-0 z-[200]"
21+
onClick={onClose}
22+
onContextMenu={(e) => {
23+
e.preventDefault();
24+
onClose();
25+
}}
26+
>
27+
<div
28+
className="absolute bg-neutral-900 border border-neutral-700 rounded-lg shadow-xl py-1 min-w-[140px] text-xs"
29+
style={{ left: x, top: y }}
30+
>
31+
<button
32+
onClick={(e) => {
33+
e.stopPropagation();
34+
onCopy(asset);
35+
onClose();
36+
}}
37+
className="w-full text-left px-3 py-1.5 text-neutral-300 hover:bg-neutral-800 transition-colors"
38+
>
39+
Copy path
40+
</button>
41+
{onRename && (
42+
<button
43+
onClick={(e) => {
44+
e.stopPropagation();
45+
onClose();
46+
}}
47+
className="w-full text-left px-3 py-1.5 text-neutral-300 hover:bg-neutral-800 transition-colors"
48+
>
49+
Rename
50+
</button>
51+
)}
52+
{onDelete && (
53+
<button
54+
onClick={(e) => {
55+
e.stopPropagation();
56+
onDelete(asset);
57+
onClose();
58+
}}
59+
className="w-full text-left px-3 py-1.5 text-red-400 hover:bg-neutral-800 transition-colors"
60+
>
61+
Delete
62+
</button>
63+
)}
64+
</div>
65+
</div>
66+
);
67+
}
68+
69+
export function DeleteConfirm({
70+
name,
71+
onConfirm,
72+
onCancel,
73+
}: {
74+
name: string;
75+
onConfirm: () => void;
76+
onCancel: () => void;
77+
}) {
78+
return (
79+
<div className="px-2 py-1.5 bg-red-950/30 border-l-2 border-red-500 flex items-center justify-between gap-2">
80+
<span className="text-[10px] text-red-400 truncate">Delete {name}?</span>
81+
<div className="flex items-center gap-1 flex-shrink-0">
82+
<button
83+
onClick={onConfirm}
84+
className="px-2 py-0.5 text-[10px] rounded bg-red-600 text-white hover:bg-red-500 transition-colors"
85+
>
86+
Delete
87+
</button>
88+
<button
89+
onClick={onCancel}
90+
className="px-2 py-0.5 text-[10px] rounded text-neutral-400 hover:text-neutral-200 transition-colors"
91+
>
92+
Cancel
93+
</button>
94+
</div>
95+
</div>
96+
);
97+
}

0 commit comments

Comments
 (0)