Skip to content

feat(app): export code animations as GIF - #781

Merged
riccardoperra merged 17 commits into
mainfrom
feat/animate-gif-export
Nov 16, 2026
Merged

riccardoperra merged 17 commits into
mainfrom
feat/animate-gif-export

Conversation

@riccardoperra

@riccardoperra riccardoperra commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

What changed

Add GIF animation export beside MP4 through the shared scene capture, worker, and dialog. GIF uses an opaque global palette, stable indexing, and merged holds. It offers 25/50 fps and explains the 60-to-50 mapping. Strings cover en/it/de/es.

The third fix round estimates solid colours and hidden frames with the small background term, charges natural padding once, and calibrates the fixed-target surcharge. Explicit GIF 50/60 choices now return to MP4 with the same displayed and saved rate. Automatic conversions preserve saved settings. nearestAnimationFps is pure again, and compiler ranges use the earlier plain form.

Verification

Frozen install, library build, 400 app tests, 77 API unit tests, 35 secrets tests, 5 config tests, workspace typecheck, lint, production build, and oxfmt pass. All eight requested Chrome GIF/MP4 audit cases pass. Twenty-one decoded UI exports separate 13 calibration fixtures from 8 held-out fixtures. Estimate error is −7.0% to +24.9%. Every file at least 8 MB shows the hint; every file below 6 MB omits it, including a 5.10 MB long solid clip. Static PNG is byte-identical to fresh origin/main. The lockfile is unchanged.

Four unchanged library test failures remain: two font-family tests and two accent tests. Those packages match origin/main. Browser checks use MSW/mock auth; live authentication/database persistence, native sharing, other browsers, and photographic-background size accuracy remain unverified. The PR remains a draft.

The verification record records all five findings, the estimate formula, the full size table, commands, evidence, and limits. The second-round full editor audit remains linked there.

🤖 Generated with Claude Code

riccardoperra and others added 8 commits November 15, 2026 18:59
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4663afc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@codeimage/app Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

riccardoperra and others added 2 commits November 16, 2026 10:21
Cover every visible scene in the palette and calibrate content-based estimates.
Yield for cancellation, preserve valid rates and correct frame progress totals.
Harden export audits and add real download measurements.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record ten Chrome exports, threshold behavior and all GIF and MP4 audit results.
Document the estimate error band and remaining platform verification limits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restore format-specific rates without persisting automatic conversions.
Budget exposed gradients and verify calibration and held-out social exports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
riccardoperra and others added 2 commits November 16, 2026 12:21
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
riccardoperra and others added 2 commits November 16, 2026 12:39
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's sidebar keeps the option list open after a choice, so the next click hit it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@riccardoperra
riccardoperra marked this pull request as ready for review November 16, 2026 12:03
@riccardoperra
riccardoperra merged commit 8fbbf85 into main Nov 16, 2026
12 checks passed
riccardoperra added a commit that referenced this pull request Nov 16, 2026
Brings in main's Animate work in the unified editor (#736, #766 MP4 web
export, #774/#776/#782 Animate panel, #781 GIF web export) on top of P10,
P11, the CLI watermark, the cross-OS Takumi job, A1 (#707) and A2 (#726).

Conflicts and resolutions:

- apps/codeimage/package.json: both sides added a dependency at the end of
  `dependencies`. Kept both: `@codeimage/render` (branch) and `gifenc`
  (main, A5).
- apps/codeimage/src/i18n/index.ts: both sides added imports. Kept
  `cliConfig` (branch) and `localAi` and `agentActivity` (main); the
  spreads were already merged.
- apps/codeimage/src/state/editor/model.ts: main imports the API's
  `AnimationSettings` type for the new `animation` field; the branch reads
  `PersistedFrameState` through a relative path so the render package can
  load the file. Kept main's import list with the branch's relative path.
- apps/codeimage/src/components/Terminal/terminal.css.ts: main added
  `pointerEvents: 'none'` to the watermark; the branch takes its opacity
  from `WATERMARK` in @codeimage/render/watermark. Kept both.
- apps/codeimage/src/components/Frame/FittedWindow.tsx: main exported
  `fitScale` and `FITTED_WINDOW_MIN_WIDTH`, which the branch already
  exports next to the pure `fittedPlacement`. Kept the branch's
  FittedWindow (top-left origin, optional Node placement, watermark scope
  hook); main's callers only use `FITTED_WINDOW_MIN_WIDTH`.
- apps/codeimage/src/components/Frame/PreviewFrame.tsx: main grew its own
  `FrameView` inside PreviewFrame for the Animate preview and export. The
  branch keeps FrameView as the single frame body in FrameView.tsx, so
  main's additions moved there: `header` (static tabs, header mode, title,
  show only the active tab), `targetSize`, `activeTabId`, `animated`
  (`data-animation-frame`, the window outside FittedWindow in
  `data-animation-window`, no min height) and `natural` (ignore the
  editor frame's width and height). `theme` and `language` are optional
  when `code` is given. PreviewFrame keeps the branch body and takes
  main's `useFrameCodeStyle` export and `isKeyOwnedByFocus` hotkey filter.

Follow-ups inside the merge, so main's code builds against the shared
FrameView: AnimationPreview, planPreview and export-animation import
FrameView from FrameView.tsx and pass `media` from `createFrameMedia`,
since FrameView does no I/O.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 4663afce Deployed Nov 16, 2026 by riccardoperra via Deploy preview #2217
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.

1 participant