Skip to content

refactor(studio): update layout, config, and remove agent activity tracking#64

Merged
miguel-heygen merged 1 commit intomainfrom
studio/4-layout-config
Mar 28, 2026
Merged

refactor(studio): update layout, config, and remove agent activity tracking#64
miguel-heygen merged 1 commit intomainfrom
studio/4-layout-config

Conversation

@miguel-heygen
Copy link
Copy Markdown
Collaborator

@miguel-heygen miguel-heygen commented Mar 26, 2026

Summary

  • NLELayout: Add toolbar slot, composition breadcrumb navigation, improved responsive layout
  • Vite config: Add full project API (preview, thumbnail, render, file CRUD) for standalone dev mode
  • Remove AgentActivityTrack component (replaced by timeline clips)
  • Add HTML editor utilities for composition source editing
  • Guard setInterval cleanup to dev-only to prevent vite build from hanging in CI

🤖 Generated with Claude Code

@miguel-heygen miguel-heygen force-pushed the studio/4-layout-config branch from 3814bd6 to b31f9b4 Compare March 26, 2026 18:29
@miguel-heygen miguel-heygen force-pushed the studio/3-timeline-player branch 2 times, most recently from 239c259 to 3f73516 Compare March 26, 2026 18:37
@miguel-heygen miguel-heygen force-pushed the studio/4-layout-config branch from b31f9b4 to 47085f8 Compare March 26, 2026 18:37
@miguel-heygen miguel-heygen force-pushed the studio/3-timeline-player branch from 3f73516 to fa1456d Compare March 26, 2026 18:44
@miguel-heygen miguel-heygen force-pushed the studio/4-layout-config branch 2 times, most recently from 42ea330 to 5736c89 Compare March 26, 2026 19:25
@miguel-heygen miguel-heygen force-pushed the studio/3-timeline-player branch 2 times, most recently from 38e3bb8 to 44f580d Compare March 26, 2026 19:47
@miguel-heygen miguel-heygen force-pushed the studio/4-layout-config branch from 5736c89 to 065bdb9 Compare March 26, 2026 19:47
@miguel-heygen miguel-heygen force-pushed the studio/3-timeline-player branch from 44f580d to 14e3a4d Compare March 26, 2026 19:54
@miguel-heygen miguel-heygen force-pushed the studio/4-layout-config branch from 065bdb9 to 7322b6b Compare March 26, 2026 19:54
@miguel-heygen miguel-heygen force-pushed the studio/3-timeline-player branch from 14e3a4d to 3a0d4bd Compare March 26, 2026 20:05
@miguel-heygen miguel-heygen force-pushed the studio/4-layout-config branch 2 times, most recently from cb136dd to 89b1ccc Compare March 26, 2026 20:11
@miguel-heygen miguel-heygen changed the title refactor(studio): update layout, build config, and clean up refactor(studio): update layout, config, and remove agent activity tracking Mar 26, 2026
@miguel-heygen miguel-heygen force-pushed the studio/4-layout-config branch 2 times, most recently from fe108bc to f92d4ad Compare March 26, 2026 20:25
@vanceingalls
Copy link
Copy Markdown
Collaborator

Review: PR #64 — Layout, Config, Agent Activity Removal

Good cleanup. htmlEditor.ts XSS issues from PR #56 resolved by removing splitElement/deleteElement entirely.

Issues

[Important] `NLELayout` performs side effects during render. The project-switch detection (`prevProjectIdRef`) and `activeCompositionPath` handling execute state updates during the render phase. These should be in `useEffect` hooks for concurrent-mode safety.

[Important] PUT endpoint still has no body size limit (carried from PR #56 review). Dev-only, but worth adding.

[Important] Puppeteer browser singleton still never closes on server shutdown. Add:
```ts
server.httpServer?.on('close', async () => {
if (_browser) await _browser.close().catch(() => {});
});
```

[Important] Render job TTL still parses timestamps from key strings. `parseInt(key.split("-").pop())` breaks if project ID contains hyphens. Store `createdAt` in the job object.

**[Suggestion] `htmlEditor.ts` `findElementBlock` only matches double-quoted `id` attributes. Single-quoted `id='foo'` returns null.

**[Suggestion] `htmlEditor.ts` still has no unit tests — functions are pure string→string, ideal for testing.

What's well done

  • XSS surface eliminated by removing `patchAttrInTag`, `splitElement`, `deleteElement`
  • `findElementBlock` uses proper quote-aware scanning and depth-counted tag matching
  • `isSafePath` consistently applied on all file endpoints
  • Clean AgentActivityTrack removal completing the cleanup from PR refactor(studio): improve player store with zoom and element updates #61
  • Exports are well-organized with proper type exports

@miguel-heygen miguel-heygen force-pushed the studio/4-layout-config branch from f92d4ad to c041eb5 Compare March 26, 2026 20:48
@miguel-heygen miguel-heygen force-pushed the studio/3-timeline-player branch from 3a0d4bd to 819ed22 Compare March 26, 2026 20:48
@miguel-heygen miguel-heygen force-pushed the studio/4-layout-config branch from c041eb5 to f006008 Compare March 26, 2026 20:55
@miguel-heygen
Copy link
Copy Markdown
Collaborator Author

Thanks for the thorough review!

Addressed:

  • findElementBlock now supports both single-quoted and double-quoted id attributes
  • ✅ Removed composition drill-down on file tree click (clicking a composition file no longer switches the preview)

Not addressed (tracked for follow-up):

  • NLELayout side effects during render — will move to useEffect hooks
  • PUT endpoint body size limit — dev-only but worth adding
  • Puppeteer browser singleton cleanup on server shutdown
  • Render job TTL timestamp parsing from key strings — will store createdAt in job object
  • htmlEditor.ts unit tests — functions are pure string→string, good candidate for testing

Copy link
Copy Markdown
Collaborator Author

miguel-heygen commented Mar 28, 2026

Merge activity

@miguel-heygen miguel-heygen force-pushed the studio/3-timeline-player branch from 304c7c7 to 44b0ac0 Compare March 28, 2026 17:39
@miguel-heygen miguel-heygen force-pushed the studio/4-layout-config branch from accaf1d to 35185cb Compare March 28, 2026 17:40
@miguel-heygen miguel-heygen force-pushed the studio/3-timeline-player branch from 44b0ac0 to a5f1a98 Compare March 28, 2026 18:00
@miguel-heygen miguel-heygen force-pushed the studio/4-layout-config branch 2 times, most recently from 59a4e18 to e4ca7c4 Compare March 28, 2026 18:05
@miguel-heygen miguel-heygen force-pushed the studio/3-timeline-player branch from 51cd554 to e6c4d1f Compare March 28, 2026 18:12
@miguel-heygen miguel-heygen force-pushed the studio/4-layout-config branch from e4ca7c4 to e8662d9 Compare March 28, 2026 18:12
@miguel-heygen miguel-heygen force-pushed the studio/3-timeline-player branch from e6c4d1f to a75cc6a Compare March 28, 2026 18:15
@miguel-heygen miguel-heygen force-pushed the studio/4-layout-config branch 2 times, most recently from a4b8c6f to d1ad101 Compare March 28, 2026 18:27
@miguel-heygen miguel-heygen force-pushed the studio/3-timeline-player branch from a75cc6a to b9274af Compare March 28, 2026 18:27
@miguel-heygen miguel-heygen changed the base branch from studio/3-timeline-player to graphite-base/64 March 28, 2026 19:39
@miguel-heygen miguel-heygen force-pushed the studio/4-layout-config branch from d1ad101 to b088b34 Compare March 28, 2026 19:39
@graphite-app graphite-app bot changed the base branch from graphite-base/64 to main March 28, 2026 19:40
- NLELayout: add toolbar slot, composition breadcrumb, improved resizing
- App: update toolbar wiring, remove split/delete, add edit modal
- Remove AgentActivityTrack (unused)
- Update vite config with improved dev server and build settings
- Update package.json dependencies
- Simplify htmlEditor.ts (keep parseStyleString, mergeStyleIntoTag, findElementBlock)
- Update exports in index.ts
@miguel-heygen miguel-heygen force-pushed the studio/4-layout-config branch from b088b34 to fa4b1e4 Compare March 28, 2026 19:40
@miguel-heygen miguel-heygen merged commit 8c1ae77 into main Mar 28, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants