Skip to content

Let rings and progress lines follow the minute, hour and second - #82

Open
freethinkel wants to merge 1 commit into
mainfrom
issue-63-time-fill
Open

freethinkel wants to merge 1 commit into
mainfrom
issue-63-time-fill

Conversation

@freethinkel

Copy link
Copy Markdown
Owner

Refs #63

What the firmware can draw

The .bin format has no expression language. A widget reads one data-source id, and the watch does the rest. So there is no way to write Facer's #Dm#-style formulas. What the stock faces do show is that time ids can drive a fill. I checked all 100 stock faces:

  • Progress rings on time. Digital__337__Time_Finder has three image-backed 0x80/0x5a rings: hour (0x0a, gauge 0..3600), minute (0x0b, 0..60) and second (0x0f, 0..60). Creative__332__Flux has a 0x81/0x5b ring on second (0x0f, 0..60). Digital__353__Dual_phase has one on hour 24h (0x04, 0..24). Every one of them has meta max 100000. The fill is (value - min) / (max - min) in the source's own units. progressFrac already computes exactly that.
  • Frame pickers on time. Creative__343__Progress_Day draws its dots with 24 minute pickers of 60 frames each (0x0b, meta max 60). The watch draws frames[minute % 60], so frame i is a dot i/60 full. Analog__341__Dual_View has a 24-frame picker on hour 24h (0x04, max 0).
  • Nothing on seconds. No stock picker reads a second id, so a frame-based line on seconds is unproven.

Change

  • Ring: switching a ring's source to hour (24h), hour (hand), minute or second now sets the gauge to that stock ring's range and sets meta max to 100000. Switching back to a metric resets the gauge to 0..100. A range the user typed for a metric is left alone (gaugeOnSource in arc.ts).
  • Progress line: the add menu has two new entries, "Minute progress line" (60 frames on 0x0b) and "Hour progress line" (24 frames on 0x04). They are built from the same frame generator as the battery line. Each node copies its stock picker's meta. LINE_SOURCES in factory.ts lists the battery, minute and hour rows.
  • Goal/activity sources for the line are not touched here. Feature request: Add a Progress Line component #61 covers those.

Limits (ponytail: comments)

  • No second line. No stock face pickers a second id, so it isn't known whether the watch redraws an image widget every second. For seconds, use the ring, which is backed by Flux and Time_Finder.
  • Time lines are horizontal only. A vertical variant would add two more menu entries.
  • None of this has been run on a watch. Both rings and pickers on these ids are stock shapes, but filling-bar art on a time picker has only been checked against Progress_Day's node bytes.
  • The editor's own ring is imageless. All stock time rings have art. The fill maths doesn't depend on the art, but an imageless time ring is untested on a watch.

Test

tests/doc-factory.test.ts:

  • A minute line goes through toLegacy -> buildBin -> parseBin. Its struct meta and refType must match one of Progress_Day's 60-frame pickers, and frames 0/30/59 must be 0/100/197 px filled.
  • For each of Time_Finder's rings, gaugeOnSource must produce that ring's own min/max, and meta max must be 100000. Moving the ring back to a metric must give a percent again.

Creative__343__Progress_Day and Digital__337__Time_Finder are added to tests/__fixtures__, so the corpus round-trip tests cover them as well.

pnpm format, pnpm lint (no new warnings), pnpm check and pnpm test pass.

Draft reply to the reporter

Thanks for the idea! The short answer is that FMC can't take a Facer expression like #Dm#. The CMF watch-face format has no expression language. Each widget reads one fixed value from the watch (battery, steps, minute, …), and the watch decides how to draw it. Anything Facer computes from a formula has no place in the file.

The specific thing in your screenshot, a fill that follows the minute, does work. The stock CMF faces do it themselves, so we've exposed it:

  • Progress ring: set its source to minute, second, hour (24h) or hour (hand), and the gauge range now switches to match (0–60, 0–24, …).
  • Progress line: Add → Minute progress line or Hour progress line creates a bar that fills over the hour or over the day.

We haven't been able to try these on a physical watch yet. If you flash one, a photo of how it looks would really help us.

Arbitrary maths (e.g. "fill = minutes × 2 % 60") isn't possible and won't be unless CMF adds it to the firmware.

🤖 Generated with Claude Code

https://claude.ai/code/session_0133XEoqqJ6bDBvzQTMXzFD4

The format has no expression language, but the stock faces bind both
widget kinds to time ids: Time_Finder, Flux and Dual_phase carry rings on
hour/minute/second with the gauge in the source's own units, and
Progress_Day draws its dots with 60-frame minute pickers. A ring switched
onto a time source now takes that stock range (and meta max 100000), and
the add menu offers minute and hour progress lines built like those
pickers. Seconds stay ring-only: no stock face pickers a second id.

Refs #63

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133XEoqqJ6bDBvzQTMXzFD4
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