feat(studio): add left sidebar with Compositions and Assets tabs#94
feat(studio): add left sidebar with Compositions and Assets tabs#94miguel-heygen merged 1 commit intomainfrom
Conversation
d872701 to
631d7be
Compare
c983e7e to
6bc905e
Compare
631d7be to
5261cbb
Compare
6bc905e to
27a5251
Compare
vanceingalls
left a comment
There was a problem hiding this comment.
Overall: Clean, well-scoped PR. The sidebar structure is solid and the component decomposition (LeftSidebar → CompositionsTab + AssetsTab) is the right approach. A few things to tighten up:
App.tsx — file content fetch on composition select
The fetch-on-click pattern has a race condition:
setEditingFile({ path: comp, content: null });
fetch(`/api/projects/${projectId}/files/${comp}`)
.then((r) => r.json())
.then((data) => setEditingFile({ path: comp, content: data.content }))
.catch(() => {});If the user clicks two compositions quickly, the second click sets content: null but the first fetch may resolve after the second one, overwriting the correct content. Consider aborting previous fetches with AbortController, or check that path still matches when the fetch resolves.
Also: .catch(() => {}) silently swallows errors. At minimum log to console so debugging is possible.
CompositionsTab.tsx — thumbnail error handling
onError={(e) => {
(e.target as HTMLImageElement).style.display = "none";
}}This hides the image on error but leaves an empty 16x9 box. Consider showing a fallback (composition name initials, or a file icon) instead of an invisible element.
AssetsTab.tsx — file size info mentioned in PR description but not implemented
The PR description says "Assets tab shows project images, fonts, and media files with file size info" but the component doesn't display file sizes anywhere. Either add it or update the PR description.
LeftSidebar.tsx — hardcoded width
style={{ width: 240 }}This works but consider making it a constant or CSS variable so it's easy to find if the design changes. Minor.
AssetsTab.tsx — inline SVG icons
The four icon variants (video, audio, image, file) are ~60 lines of inline SVG. These would be cleaner as a shared icon component or imported from @phosphor-icons/react which is already in the project deps. Not blocking but reduces duplication if more icons are needed.
LeftSidebar.tsx — keyboard shortcuts could conflict
Cmd+1 and Cmd+2 are commonly used by browsers (switch tabs). The e.preventDefault() will override browser behavior. Consider using a less conflicting shortcut or making it configurable.
27a5251 to
036fe70
Compare
Merge activity
|
5261cbb to
d92269c
Compare
787e40c to
41a804f
Compare
d92269c to
4f83790
Compare
3ebfd91 to
91e509a
Compare
4f83790 to
6a94e44
Compare
6a94e44 to
6feae67
Compare
91e509a to
15974c2
Compare
6feae67 to
d4b089e
Compare
0840b63 to
4252f7a
Compare
02e7dbc to
f6d18b0
Compare
4252f7a to
717d292
Compare
d6fe76f to
b372691
Compare
717d292 to
f553966
Compare
f553966 to
4567dad
Compare
b372691 to
0167e69
Compare
4567dad to
3ab9c2b
Compare

Summary
Test plan
🤖 Generated with Claude Code