Commit Graph

16 Commits

Author SHA1 Message Date
kevinguevara b7656cf8eb feat(ui): apply brand identity colors, typography, and contextual toolbar 2026-06-02 15:27:01 -05:00
kevinguevara f998e454fe Refactor: remove AGPL imgly dependency and migrate background removal to python backend 2026-06-02 14:50:25 -05:00
kevinguevara 560a413c1e fix: dynamic video duration across ProductionForm + LivePreviewCanvas
- Expanded useVideoDurations to detect both form-sourced segments AND
  editable-slot video fields inside content scenes
- Wired videoDurations into ProductionForm (getTemplateDuration,
  compileExpressToTimeline, LivePreviewCanvas, ExportModal)
- LivePreviewCanvas now accepts videoDurations prop
- Simplified getTemplateDuration/compiler: any scene with a known
  video duration uses it, regardless of segmentSource type
- A 33s uploaded video now creates a 33s timeline, not 5s
2026-06-02 09:58:37 -05:00
kevinguevara a21675e5fc fix: 3 critical bugs — audio corruption, blob URLs, static duration
1. Audio/Video sync: During playback, let the browser handle media naturally
   and only force-seek when drift > 250ms. Prevents audio glitching caused
   by setting currentTime 30x/sec. When paused/scrubbing, sync precisely.

2. Blob URLs → Server uploads: All media uploads (BrandTabMedia, SceneFieldEditor,
   TemplateFieldInput) now POST to /api/upload and use persistent server URLs
   instead of blob: URLs that vanish on refresh.

3. Dynamic duration: Added useVideoDurations hook that probes actual video
   durations from uploaded form videos. getTemplateDuration and
   compileExpressToTimeline now accept videoDurations to override static
   durationSeconds for form-sourced scenes.
2026-06-02 09:48:28 -05:00
kevinguevara 32505f95ce chore: remove all Remotion references from Electron main + UI
- Cleaned Electron main.ts: removed Remotion bundle path, compositor path, and predownloadBrowser()
- Set BRADLY_SERVE_URL from Express port for headless rendering
- Cleaned GlobalSettingsPanel: removed Remotion-specific frame capture code
- Removed stale remotion:bundle script from package.json
- Zero Remotion dependencies, imports, or functional code remain
2026-06-02 05:35:03 -05:00
kevinguevara 551bff56a2 feat: Phase 4 — replace @remotion/bundler + @remotion/renderer with Puppeteer + FFmpeg
- Created src/engine/renderer/puppeteerRenderer.ts (frame capture via headless Chrome)
- Created src/engine/renderer/videoEncoder.ts (FFmpeg CLI wrapper for MP4/WebM)
- Created src/pages/RenderPage.tsx (headless render page with __BRADLY_RENDER__ API)
- Rewrote src/server/renderQueue.ts — zero Remotion imports
- Deleted scripts/bundle-remotion.js
- Replaced @remotion/bundler + @remotion/renderer with puppeteer-core
- Added renderMode detection in main.tsx entry point

Zero Remotion dependencies remain. Fully independent.
2026-06-02 05:33:17 -05:00
kevinguevara 3e3e23b6b7 chore: remove remotion and @remotion/player from dependencies
- Removed 'remotion' and '@remotion/player' from package.json
- Deleted Root.tsx (SSR composition registry, no longer needed for frontend)
- Updated build scripts to skip remotion:bundle step
- Kept @remotion/bundler and @remotion/renderer for server-side (Phase 4)
- Verified: electron-vite build passes cleanly
2026-06-02 05:23:56 -05:00
kevinguevara ff07d8c492 feat: replace Remotion with custom Bradly Engine (Phases 1-3)
- Phase 1: Custom animation engine (interpolate, spring, Easing)
- Phase 2: Custom composition components (AbsoluteFill, Sequence, Img, Video, Audio)
- Phase 3: BradlyPlayer with rAF frame loop, imperative API, controls

Migrated 24 files from remotion/@remotion/player imports to src/engine/.
All type errors from migration resolved. Pre-existing errors remain unchanged.
2026-06-02 05:20:43 -05:00
kevinguevara 0aa44afa43 fix: resolve blob URLs in designMD before Remotion render
- introVideoUrl, outroVideoUrl, logoUrl, brandAudioUrl can contain
  blob: URLs from the brand editor that Remotion can't access
- Now uploads these to Express and replaces with persistent URLs
- Uses correct Express origin for Electron compatibility
2026-06-02 04:49:21 -05:00
kevinguevara 7c4196475c fix: 3 bugs in Electron export pipeline
Bug 1: RENDERS_DIR mismatch (root cause)
- server.ts had hardcoded renders dir, now reads BRADLY_RENDERS_DIR env
- renderQueue.ts saves to ~/Library/.../Bradly/renders/
- server.ts now serves from the same directory

Bug 2: Upload origin pointing to wrong port
- uploadBlobContent.ts used window.location.origin (Vite 5173)
- Remotion bundler needs Express origin (3000) to access media
- Added getExpressOrigin() helper that detects Electron

Bug 3: Batch ZIP export using file-saver (doesn't work in Electron)
- Added saveBlobFile IPC method (preload + main)
- batchExporter.ts now uses native save dialog in Electron
- Web mode falls back to file-saver
2026-06-02 04:44:25 -05:00
kevinguevara 25587ab07f fix: Electron download via native save dialog
- Add file:saveRendered IPC handler in main process
- Copies rendered file from internal renders dir to user-chosen path
- Update preload with saveRenderedFile bridge method
- Update useExportQueue downloadJob: detect Electron → native save dialog
- Web mode fallback preserved (<a> tag download)
2026-06-02 04:33:57 -05:00
kevinguevara fbdbd7e05c fix: port conflicts and API proxy for Electron dev mode
- Add Vite proxy: /api/* requests from renderer (5173) → Express (3000)
- Add dynamic port finding: if 3000 is taken, auto-pick next available
- Import net module for port checking
- Use dynamic expressPort in production URL loading
2026-06-02 04:18:34 -05:00
kevinguevara e7520b28f9 feat: add Windows .exe support
- Add @electron-forge/maker-squirrel for Windows installer
- Create .ico icon from existing PNG
- Fix compositor platform detection for win32
- Forge config now builds both .dmg (macOS) and .exe (Windows)
2026-06-02 04:10:11 -05:00
kevinguevara e42a484ab0 fix: production renderer, app icon, dev:web script
- Add Bradly app icon (.icns + .png) for macOS
- Fix Electron production mode: Express serves built renderer files
- Add extraResource for renderer + remotion-bundle in forge.config.ts
- Fix dev:web script to use npx tsx
2026-06-02 04:06:00 -05:00
kevinguevara 92a8cf78a9 feat: integrate Electron for desktop app
- Add electron-vite + Electron Forge tooling
- Create Electron main process with embedded Express server
- Create preload script with native dialog IPC bridge
- Refactor server.ts to export createExpressApp() (dual web/electron)
- Adapt renderQueue.ts for packaged binaries + pre-built bundle
- Add ensureBrowser() for Chrome Headless Shell pre-download
- Add scripts/bundle-remotion.js for packaging
- Data persists in ~/Library/Application Support/Bradly/
- Web mode preserved via npm run dev:web
2026-06-02 03:57:17 -05:00
kevinguevara b135a70cc7 Initial commit — Bradly branding editor platform 2026-06-02 03:27:03 -05:00