# Smaage Frontend Prototype
## Install Requirements
```bash
uv sync
```
## Run
```bash
uv run -m frontend
```
## Navigation
```mermaid
stateDiagram-v2
[*] --> Main
state "Main View
(timer + weight)" as Main
state "Menu
(carousel)" as Menu
state "Bluetooth Pairing
(waiting for connection)" as BTPairing
state "Recipe Selection
(carousel)" as RecipeSelection
state "Do Recipe
(step-by-step)" as DoRecipe
state "Edit Recipe
(step list)" as EditRecipe
state "Edit Recipe – Move Mode
(reorder steps)" as MoveMode
state "Edit Step – Type Selection
(list view)" as TypeSelect
state "Edit Step – Value Entry
(morse input)" as ValueEntry
state "Edit Step – Goal Time Entry
(morse input)" as GoalTime
Main --> Menu : both long press
Main --> RecipeSelection : right long press
Menu --> Main : left long press [back]
Menu --> BTPairing : right long press [BT Pair]
BTPairing --> Menu : left long press [cancel]
RecipeSelection --> Main : left long press
RecipeSelection --> DoRecipe : right long press [on recipe → run]
RecipeSelection --> EditRecipe : both long press [on recipe → edit]
or right long press [on + → add]
DoRecipe --> Main : left long press [back]
or right press [last step → done]
EditRecipe --> RecipeSelection : left long press [back]
or right long press [on save]
EditRecipe --> TypeSelect : right long press [on step]
or right long press [on + → add step]
EditRecipe --> ValueEntry : right long press [on name]
EditRecipe --> MoveMode : both long press [on step]
MoveMode --> EditRecipe : both long press [confirm]
or left long press [cancel]
TypeSelect --> ValueEntry : right long press [type with value]
TypeSelect --> EditRecipe : right long press [type w/o value → saved]
or right long press [delete → deleted]
or left long press [back]
ValueEntry --> EditRecipe : left long press [save]
or left press [cancel]
ValueEntry --> GoalTime : left long press [WEIGH_WITH_TIMER]
GoalTime --> EditRecipe : left long press [save]
or left press [cancel]
```
## Tools
### `export_loading_frames.py`
Renders the loading screen animation and exports every unique frame as both PNG files and a NumPy array.
**Usage**
```bash
uv run export_loading_frames.py [--out-dir ]
```
| Argument | Default | Description |
|---|---|---|
| `--out-dir` | `frames/` | Directory to write output files into |
**Outputs**
| File | Description |
|---|---|
| `frames/frame_XXXX.png` | One PNG per unique frame, zero-padded index |
| `frames/frames.npy` | NumPy array of shape `(N, H, W)`, dtype `bool` |
Consecutive duplicate frames are collapsed so only visually distinct frames are exported. The script prints the total number of frames rendered and the number of unique frames kept.