Skip to content

Add an Animation tab for the Watch Pro 2's animated image (0x82, type 2) - #120

Closed
hassan-software-dev wants to merge 1 commit into
fmctools:mainfrom
hassan-software-dev:feat/pro2-anim-widget
Closed

hassan-software-dev wants to merge 1 commit into
fmctools:mainfrom
hassan-software-dev:feat/pro2-anim-widget

Conversation

@hassan-software-dev

@hassan-software-dev hassan-software-dev commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

What

The Watch Pro 2 (stock 1.0.0.73) already plays the animated image widget
(tag 0x82, type 2), but the editor treated types 0..3 as plain images and
only kept their bytes. This adds editing and preview for it.

  • Decode/encode the 25-byte 0x5c body (proc.ts): duration, start/end angle,
    and the fields whose meaning isn't known, kept raw and named by offset
    (raw4..raw18, flags, tail). encodeAnim reproduces the stock bytes.
  • New Animation tab (list of animated images, a timeline that plays or
    scrubs on its own clock, the effect fields). Selecting a layer no longer
    leaves this tab.
  • Preview (render/anim.ts): one function places the image by value and
    replays the wake sweep. The simulator can wake the screen; changing the
    time, sunrise or sunset replays it.
  • "Animated layer" in the add menu, seeded with Sun Circle's exact body.
  • Sun Circle AOD added as a Doc round-trip fixture.

compat.ts and assertWatchCompat are untouched: types 0..3 are already
allowed on a Pro 2.

What is and isn't known

Confirmed on a watch: the sun/moon sweep in on wake over about 2 s and their
stop position follows daylight % / night %, bottom to top. From the firmware
(parser at 0x100DB1B4): the s16s at body 12/14 are normalised into +-3600,
read here as tenths of a degree.

Not known: what body offsets 4..11, 16, 18 and 20 do. They are labelled raw
in the UI and kept as found. The preview geometry (angle clockwise from up,
raw16 as a pixel radius, art undisplaced at 270 degrees) is a model that
fits Sun Circle's art, not a verified one. Tests that change one field each
(duration, angles, offsets, radius) are planned on a real watch.

Testing

  • tests/doc-anim.test.ts: the stock body round-trips, edits change only the
    field named, the factory layer equals the stock layer, geometry checks.
  • Doc round trip over the corpus, including the new fixture: unchanged.
  • pnpm check and pnpm lint clean; unit tests pass apart from
    tests/typography.test.ts, which fails on Windows because its allowlist
    uses / paths (unrelated to this change).
  • Browser tests were not run locally (Playwright's Chromium wasn't installed);
    CI will run them.
  • Exercised by hand in the editor (load, scrub, play, edit, undo, night
    time, add layer); nothing was flashed to a watch.

🤖 Generated with Claude Code

The editor kept these layers byte for byte but treated them as plain images.
Decode the 0x5c body into a typed view (duration, start/end angle; the fields
whose meaning isn't known stay raw, named by offset) with an encoder that
reproduces the stock bytes, and edit it through a pure withAnim edit.

- Animation tab in the right panel: the layer list, a timeline that plays or
  scrubs on its own clock, and the effect fields.
- Preview: one geometry function (render/anim.ts) places the image by value
  and replays the wake sweep; the simulator can wake the screen, and a time,
  sunrise or sunset change replays it too.
- "Animated layer" in the add menu, seeded with Sun Circle's exact body.
- Selecting a layer no longer leaves the Animation tab.

compat.ts and assertWatchCompat are untouched; types 0..3 were already
allowed on a Pro 2. The geometry is a model that fits Sun Circle, to be
checked on a watch. Sun Circle AOD is added as a round-trip fixture.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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