Bug fix and UX improve #3

Merged
manbo merged 7 commits from dev-tauri into master 2026-02-15 18:18:14 +08:00
2 changed files with 29 additions and 3 deletions
Showing only changes of commit e5417b6799 - Show all commits

View File

@@ -18,6 +18,13 @@ Supporting checks:
- `GET /v1/health`
- `GET /v1/state` (periodic sampling)
Animation traffic now targets row-based sprite names plus compatibility aliases:
- semantic names: `idle`, `happy`, `love`, `excited`, `celebrate`, `sleepy`, `snoring`,
`working`, `angry`, `surprised`, `shy`, `dragging`
- compatibility aliases: `active`, `success`, `error`
- one intentional unknown name is still included to keep invalid animation-path coverage
## Prerequisites
- Frontend runtime is already running (`sprimo-app` or `sprimo-tauri`).

View File

@@ -18,6 +18,27 @@ from typing import Any
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
ANIMATION_NAMES = (
"idle",
"happy",
"love",
"excited",
"celebrate",
"sleepy",
"snoring",
"working",
"angry",
"surprised",
"shy",
"dragging",
# Backward-compatible aliases mapped in runtime/manifests.
"active",
"success",
"error",
# Intentionally invalid to keep unknown-animation traffic coverage.
"unknown_anim",
)
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
@@ -205,9 +226,7 @@ def random_valid_command(rng: random.Random) -> dict[str, Any]:
if pick == "play_animation":
payload = {
"name": rng.choice(
["idle", "dance", "typing", "celebrate", "error", "unknown_anim"]
),
"name": rng.choice(ANIMATION_NAMES),
"priority": rng.randint(0, 10),
"duration_ms": rng.choice([None, 250, 500, 1000, 3000]),
"interrupt": rng.choice([None, True, False]),