From 9445a3333233565c64430f100859bf8eb1416331 Mon Sep 17 00:00:00 2001 From: Egor Kolesnikov Date: Mon, 23 Nov 2026 16:23:42 +0200 Subject: [PATCH] sdk: pin cccaf79 (stub 10, widget templates) Moves WP2_APPS_REV from 4a5b025 to cccaf79, SDK main with #23 merged. Columns widget card (api.widget_columns, widget-icons/), packed by scripts/store build; AGENTS.md, README and the watch-app skill say what needs stub 10 and that its loader is not released yet. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CQSU8MSnXCgDSkexp4s1hy --- .claude/skills/watch-app/SKILL.md | 2 ++ AGENTS.md | 14 ++++++++++---- Makefile | 2 +- README.md | 2 ++ apps/Cargo.lock | 8 ++++++++ scripts/store | 14 ++++++++++++-- 6 files changed, 35 insertions(+), 7 deletions(-) diff --git a/.claude/skills/watch-app/SKILL.md b/.claude/skills/watch-app/SKILL.md index a1b6398..719bb76 100644 --- a/.claude/skills/watch-app/SKILL.md +++ b/.claude/skills/watch-app/SKILL.md @@ -26,6 +26,8 @@ Ask, don't guess. A package can mix them (`app-guide.md` section 3, "Widget" and - **Widget card** (`WIDGET`): two lines of text on a stock card left of the face. Good for "next thing / count / last value". `api.widget(title, value)`: title ≤ 23 B, value ≤ 39 B with one `\n`. Writes NAND: call it when the value changes and at start, never per frame. The card shows the new text the next time the face is shown. + From stub 10 it can instead be up to four columns of caption, own icon and value (`api.widget_columns`, + `widget-icons/NN-name.svg`; `app-guide.md`, "Columns card"): always keep the text card as the `-22` fallback. - **Page** (`PAGE`): a full screen next to the face ("full-screen widget"). Branch on `api.on_page()` for a compact view. No `BUTTON` there, so the loop never returns on its own; `PAUSE` on swipe away, `RESUME` on return: draw nothing and run no motor in between, redraw time-dependent parts on `RESUME`. diff --git a/AGENTS.md b/AGENTS.md index 7ce44a9..caa02f9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -38,6 +38,7 @@ One package can offer several of these; ask which the owner wants before buildin |---|---|---| | Menu app | the default: a row in Apps, `main` runs until `BUTTON` | any | | Widget card | `app_features!(WIDGET)`; `api.widget(title, value)` stores text (23 B / 39 B, `\n` = 2nd line) the stub draws on a 344×166 card left of the face. A NAND write: on change, never per frame. A tap opens the app | 2026-11-15 | +| Columns card | the same tile in the layout of the stock weather-by-hour card: `api.widget_columns(&[Column])`, 1-4 columns of caption, icon, value (text ≤ 9 B). Icons: `widget-icons/NN-name.svg` (40×40, ≤ 16, index = file name order), packed by `make build`. `-22` = this watch can't: write `api.widget` instead and don't retry per tick. `app-guide.md`, "Columns card" | stub 10 and its loader (merged, not yet released) | | Page | `app_features!(PAGE)`: the app is a whole screen next to the face. `api.on_page()` is `true` there; no `BUTTON` (the app never exits itself), swipe away = `PAUSE`, back = `RESUME` | 2026-11-15 | | Phone or Mac link | `send`/`recv`, `MESSAGE`: section "Apps that talk to a phone" below | 2026-11-13 for K | | Phone services | calendar, reminders, location, weather, HTTP, notifications, media, a notification on the phone, storage, background jobs, from FMC Companion over `R1` messages (`crates/companion-rpc`): "FMC Companion" below | 2026-11-13 for K | @@ -55,7 +56,7 @@ make build APP=my-app # target/my-app.wp2app make check # store.toml / store.md ``` -- **The simulator has no LVGL** (`lv_submit` returns `-95`), no widget card and no page (`on_page()` is `false`). An +- **The simulator has no LVGL** (`lv_submit` returns `-95`), no widget card of either kind and no page (`on_page()` is `false`). An LVGL app is tested by host tests of its batch builder (each batch validates against the loader's checker) and in the emulator. Pick canvas (`cmf-wp2-ui`) when the simulator matters more than stock widgets: `app-guide.md`, "LVGL or `cmf-wp2-ui`?". @@ -177,6 +178,11 @@ How it works and what it can't do: **What needs a newer watch.** Patched firmware **stub 8** (published 2026-11-19 as `1.0.0.73-wp2.11`, by OTA) with the loader of 2026-11-19 brings 16 app slots instead of 8 and `PUSH`, which `job.set` needs to refresh a widget or start -blob in the background; on an older stub the phone runs the job and drops the result. The SDK pin here predates -both (`git -C .sdk/wp2-apps log HEAD..origin/main`). The order of apps in the Apps menu is the user's, set in FMC -Companion; an app can't change it. +blob in the background; on an older stub the phone runs the job and drops the result. The order of apps in the Apps +menu is the user's, set in FMC Companion; an app can't change it. + +**Stub 10** with its loader (cmf-watch-sdk #23, merged, no loader release yet) draws v2 widget records (the columns card), takes +them by `PUSH` too, and accepts a package with a widget icon trailer (`docs/app-icons.md` in the SDK). Stub 9, the one +watches run now, is the watch face bootloop guard and has none of it: it refuses a package with the trailer at `END` +and v2 records. A host installing on a stub below 10 must cut the trailer off; anything that checks a package for its +exact header length (a store, an installer) refuses one with a trailer until it learns it. diff --git a/Makefile b/Makefile index 88553a9..94c8b3d 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # The SDK and its tooling. To move to a newer one: change the commit here, `make sdk`, build and test every app, # open a PR. Packages built against it change, but a store update still needs each app's version raised. -WP2_APPS_REV := 884e9a693070c3dc587f814def3806889a3c4e49 +WP2_APPS_REV := cccaf794a372f98ec223ffa6f25db0960cb1c1c6 WP2_APPS_GIT := https://github.com/cmf-tech-community/cmf-watch-sdk SDK := .sdk/wp2-apps diff --git a/README.md b/README.md index d44d426..c906306 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,8 @@ channel, budgets. The apps here are worked examples of it. change later. - `icon.svg` (96×96 viewBox) is the watch menu's icon and, rendered at 288 px, the store's. Images it references are resolved next to it. Style: [docs/app-icons.md](https://github.com/cmf-tech-community/cmf-watch-sdk/blob/main/docs/app-icons.md). +- `widget-icons/NN-name.svg` (40×40 viewBox, optional, at most 16) are the icons of a columns widget card (patched + firmware stub 10); the build packs them behind the app, and their order in the file name is the index the app uses. - Use the system font and the stock look, not LVGL's defaults. ### In the emulator or on a watch diff --git a/apps/Cargo.lock b/apps/Cargo.lock index dded999..0cbab23 100644 --- a/apps/Cargo.lock +++ b/apps/Cargo.lock @@ -124,6 +124,14 @@ dependencies = [ "wp2-core", ] +[[package]] +name = "v-maps" +version = "0.1.0" +dependencies = [ + "cmf-wp2-app", + "cmf-wp2-ui", +] + [[package]] name = "vela-nav" version = "0.1.0" diff --git a/scripts/store b/scripts/store index d4852eb..4f94575 100755 --- a/scripts/store +++ b/scripts/store @@ -10,7 +10,8 @@ which fetches the pinned SDK first and puts llvm-objcopy on PATH. missed goes out with the next one scripts/store check [NAME...] validate the listings (all without NAME) scripts/store build NAME... check, then build target/.wp2app with the pinned wp2-apps tooling; - icon.svg -> target/-icon.png, the store's icon + icon.svg -> target/-icon.png, the store's icon; widget-icons/*.svg -> + the package's widget icons (40x40, index = file name order) scripts/store publish NAME... send target/.wp2app, -icon.png + the listing to the store (STORE_URL, STORE_PUBLISH_TOKEN; --dry-run: the store validates and answers what would change, saves nothing) @@ -19,6 +20,7 @@ import json import os from pathlib import Path import re +import shutil import subprocess import sys import tomllib @@ -178,8 +180,16 @@ def build(name): subprocess.run(["llvm-objcopy", "-O", "binary", "--set-section-flags", ".data=alloc,load,contents", elf, TARGET / f"{name}.bin"], check=True) (TARGET / f"{name}.wp2app").unlink(missing_ok=True) + pack_icons = [] + if widget_svgs := sorted((APPS / name / "widget-icons").glob("*.svg")): + out = TARGET / "widget-icons" / name + shutil.rmtree(out, ignore_errors=True) # pack takes every PNG there: none of an icon since removed + out.mkdir(parents=True) + for one in widget_svgs: + subprocess.run(["resvg", "-w", "40", "-h", "40", one, out / f"{one.stem}.png"], check=True) + pack_icons = ["--widget-icons", out] wp2apps("pack", TARGET / f"{name}.bin", "--elf", elf, "--name", name, "--version", build_number(meta["version"]), - "--output", TARGET / f"{name}.wp2app") + "--output", TARGET / f"{name}.wp2app", *pack_icons) wp2apps("info", TARGET / f"{name}.wp2app") if svg.exists(): # the store's icon; an icon.svg may pull in images by relative path subprocess.run(["resvg", "-w", "288", "-h", "288", svg, TARGET / f"{name}-icon.png"], check=True)