Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ba7e590
Add empty vue project for proto manager
BadgerCode Nov 21, 2026
3f35cff
Add state example
BadgerCode Nov 21, 2026
1b2dbfc
Add example config and protogen faces to web app
BadgerCode Nov 21, 2026
a502474
Add example face editor to web app
BadgerCode Nov 21, 2026
09997b4
Add tailwind. Basic page layout
BadgerCode Nov 21, 2026
ed1d099
Add project overview to home page
BadgerCode Nov 21, 2026
9d3a5d5
Add prettier
BadgerCode Nov 21, 2026
a8c1426
Add config editor and panel layout editor
BadgerCode Nov 21, 2026
0908a76
Add config file generator
BadgerCode Nov 21, 2026
3268039
Add annoying warning to download your config when it has changed
BadgerCode Nov 21, 2026
5fca94c
Improve styling to look more protogen like. Visor preview
BadgerCode Nov 21, 2026
0f3298f
Expression editor
BadgerCode Nov 21, 2026
ed11907
Agent file
BadgerCode Nov 21, 2026
0a27cfb
Add timestamps to generated files. Remove unused file
BadgerCode Nov 21, 2026
5f5889c
Change some defaults
BadgerCode Nov 22, 2026
76c2ba8
Add face layout presets for common starting points
BadgerCode Nov 22, 2026
4255008
Add start script
BadgerCode Nov 23, 2026
39a676b
Rename ProtoManager web app to Toaster Oven
BadgerCode Nov 24, 2026
194fd79
Change home page copy text
BadgerCode Nov 24, 2026
32ec656
Replace logo and favicon with a toaster
BadgerCode Nov 24, 2026
e63817c
ci: add Azure Static Web Apps workflow file
BadgerCode Nov 24, 2026
00d1123
Target main branch for deploys
BadgerCode Nov 24, 2026
fccbf85
Default the website to the 14 panel, one connection layout
BadgerCode Nov 24, 2026
fe47f66
Make the download reminder smaller and dismissible
BadgerCode Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/azure-static-web-apps-witty-wave-097b67903.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Azure Static Web Apps CI/CD

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main

jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v3
with:
submodules: true
lfs: false
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_WITTY_WAVE_097B67903 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "/toaster-oven/" # App source code path
api_location: "" # Api source code path - optional
output_location: "dist" # Built app content directory - optional
###### End of Repository/Build Configurations ######

close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_WITTY_WAVE_097B67903 }}
action: "close"
8 changes: 8 additions & 0 deletions toaster-oven/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,css,scss,sass,less,styl}]
charset = utf-8
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
max_line_length = 100
39 changes: 39 additions & 0 deletions toaster-oven/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

*.tsbuildinfo

.eslintcache

# Cypress
/cypress/videos/
/cypress/screenshots/

# Vitest
__screenshots__/

# Vite
*.timestamp-*-*.mjs
6 changes: 6 additions & 0 deletions toaster-oven/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"singleQuote": true,
"printWidth": 100
}
3 changes: 3 additions & 0 deletions toaster-oven/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar", "esbenp.prettier-vscode", "EditorConfig.EditorConfig"]
}
117 changes: 117 additions & 0 deletions toaster-oven/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Toaster Oven

A Vue web app for building the configuration and face data files for **Protosoft Toaster OS**, the Arduino firmware for protogen fursuit heads that use MAX7219 8x8 LED panels. Users edit settings in the browser, then download C++ header files and copy them into the firmware folder.

- This app lives in `toaster-oven/`. The firmware is a sibling folder, `../ToasterOS/`, in the same git repo. `../README.md` explains the hardware and config, with panel diagrams in `../Docs/Images/`.
- `../face-demo.html` is the original standalone expression editor. The Expressions tab replaces it.
- The app outputs two files:
- `Config.h`: pins, panel layout and optional features.
- `Protogen_Faces.h`: the expressions.

## Commands

```sh
npm run dev # dev server
npm run build # type-check (vue-tsc) + production build. Run before saying a change is done
npm run format # prettier --write src/
npm run preview # serve dist/
```

There's no test framework or linter. Prettier handles formatting only (`.prettierrc.json`: no semicolons, single quotes, 100 columns). Run `npx prettier --write src/` after editing.

## Stack

- Vue 3 (`<script setup lang="ts">`), vue-router, Vite, TypeScript.
- Tailwind CSS v4 through `@tailwindcss/vite`. There's no `tailwind.config.js`; the theme lives in `src/assets/main.css` under `@theme`.
- Fonts come from npm packages so the app works offline: `@fontsource-variable/doto` (dot-matrix display face) and `@fontsource-variable/atkinson-hyperlegible-next` (body text). They're imported in `src/main.ts`.
- No state library. State is a single `reactive()` store.

## Layout

```
src/
main.ts, App.vue App shell (nav + <main>). App.vue warns before leaving with undownloaded changes
router/index.ts / and /configure/{panels,expressions,features}
assets/
main.css Theme tokens + small component classes (.btn, .form-input, .kbd, .display-title)
Protogen_Faces.h COPY of ../ToasterOS/Protogen_Faces.h, parsed at build time for the preset expressions
state/
app-state.ts appStore: faceConfig, featureConfig, expressions. findExpression(name)
config-types.ts TS mirror of ../ToasterOS/ConfigTypes.h (panel type ids, structs)
config-defaults.ts Feature defaults matching ../ToasterOS/Config.h, plus the panel layout presets
generate-config.ts appStore -> Config.h text. Also downloadBlob()
generate-faces.ts expressions -> Protogen_Faces.h text
config-download.ts Per-file "changed since last download" tracking + downloadFile(kind)
expressions.ts Expression type, defaults, naming/validation helpers
expression-editor.ts Selected expression + undo/redo stacks (module state, survives tab switches)
pin-usage.ts Detects digital pins assigned twice
faces/
faces.ts Parses the presets from assets/Protogen_Faces.h. mirror(), expressionToPanels()
parse-faces.ts Regex parser for `struct FaceExpression Face_X = {...}` blocks
required-expressions.ts Expressions the firmware references by name (see below)
components/
VisorDisplay.vue SVG visor that draws panels as LED dots. Used on Home (hero), the panel map and the preview
expressions/ ExpressionCanvas (paint LEDs), ExpressionThumbnail, expression-layout.ts
form/ SettingsCard, FormField, ToggleSwitch
DownloadConfigButton.vue One button per file (kind="config" | "expressions")
views/
HomeView.vue Hero visor (blinks; click to boop: Surprised -> Angry -> X_X, like the firmware)
ConfigureView.vue Heading, both download buttons, tabs, sticky "changed" reminder
configure/ PanelLayoutView, ExpressionsView, FeaturesView
```

## How the firmware is modelled

- **Panels:** there are 15 panel types (`PanelType` in `config-types.ts`, matching the `#define PANEL_*` values). Each **connection** is a chain of panels on 3 pins (DIN, CS, CLK), listed in wiring order. `-1` means an empty slot. Up to 16 panels per chain.
- **Left and right:** these are as seen from the front of the head, not from the wearer's point of view.
- **Expressions:** every expression is drawn for the **right side** only. The left side is mirrored horizontally, as in `ExpressionManager::Render()`.
- Each expression has 1 nose panel, 2 eye panels (front, back), an optional 2-panel blink frame, and 4 mouth panels (front → back).
- A bitmap is 8 numbers, one per row. The most significant bit is the leftmost LED.
- **Visor geometry:** units are LEDs. Panel positions are in `VisorDisplay.vue` and `expression-layout.ts`, laid out like `../Docs/Images/panels_diagram_twocon.png`.
- **Required expressions:** `required-expressions.ts` lists the 20 expressions that `ExpressionManager.h`, `Protogen_Face_Collections.h` and `RemoteControl.h` refer to by name.
- The editor lets users change their LEDs, but blocks renaming and removing them, because either would break the firmware build.
- Only OWO, Binary, UWU and user-created expressions can be renamed or removed.
- The owner plans to make this configurable.
- **Generated files:**
- `Protogen_Faces.h` copies `Face_Nose_Single` and `Numbers_ASCII` from the parsed header as-is.
- Expression names are C++ identifiers, saved as `Face_<name>`. The UI shows them with spaces instead of underscores.

**Keep in sync with the firmware.** If `../ToasterOS/ConfigTypes.h`, `Config.h`, `Protogen_Faces.h` or the files that reference expressions change, update:

- `config-types.ts`
- `config-defaults.ts`
- the generators
- `required-expressions.ts`
- the copy at `src/assets/Protogen_Faces.h`

**Default panel layout differs on purpose.** The app starts with the first preset in `FACE_LAYOUT_PRESETS` (14 panels, one connection). `../ToasterOS/Config.h` keeps the two-connection layout, which is the `14-two` preset. Don't change either to match the other.

To check a generator, render the defaults and diff the output against the firmware file. Expect the panel layout to differ unless you pick the `14-two` preset first. `vite`'s `createServer` + `ssrLoadModule` can load the TS modules from a Node script.

## State and downloads

- All state is in memory. **Nothing persists across a refresh yet.** Saving is planned as "projects" (multiple saved configurations to switch between). Keep state serialisable: plain objects, number bitmaps, and numeric ids on expressions.
- `config-download.ts` regenerates both files reactively and compares each with its text at the last download, starting from the defaults. The download buttons, nav dot and sticky reminder all use `changedDownloads` / `hasChanged(kind)`.
- Undo/redo covers LED edits and adding or removing a blink, not renames or removals.

## Design conventions

The theme comes from the owner's actual head: smoked plum visor, blue LEDs, white shell and gold horns. The tokens are in `main.css`:

- `page`, `surface`, `border` and `visor-glass` are the dark plum surfaces.
- `led` / `accent` is the blue highlight. `white` is the shell white used for text.
- Tailwind's **`slate` scale is overridden** with plum-tinted greys, so `text-slate-400` etc. match the theme.
- **`gold-*` means "needs attention"**: unsaved changes, pin conflicts, duplicate panels, over 16 panels and invalid names. Use red only for destructive actions.

Rules:

- The Doto dot-matrix font is for page titles and the logo only (`.display-title`). Everything else uses Atkinson Hyperlegible Next.
- No all-caps labels and no decorative motion. The only automatic animation is the visor powering on row by row in `VisorDisplay`; respect `prefers-reduced-motion`.
- Buttons are `class="btn btn-primary"` / `btn btn-secondary` / `btn btn-icon`. Always include the base `btn` class.
- The layout must work at 390px wide. To check screens, use headless Chrome: `chrome --headless=new --screenshot=... --window-size=...` against `npm run preview`. Chrome on Windows has a minimum window width, so for phone widths load the page inside a 390px `<iframe>`.
- Copy is short, plain and in sentence case. The owner edits copy themselves, so keep their wording when changing nearby code.

## Working with the owner

- Run `npm run build` before saying a change is done. Use screenshots to check UI changes.
- Don't commit unless asked. The owner reviews and commits themselves.
1 change: 1 addition & 0 deletions toaster-oven/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
42 changes: 42 additions & 0 deletions toaster-oven/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# toaster-oven

This template should help get you started developing with Vue 3 in Vite.

## Recommended IDE Setup

[VS Code](https://code.visualstudio.com/) + [Vue (Official)](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).

## Recommended Browser Setup

- Chromium-based browsers (Chrome, Edge, Brave, etc.):
- [Vue.js devtools](https://chromewebstore.google.com/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd)
- [Turn on Custom Object Formatter in Chrome DevTools](http://bit.ly/object-formatters)
- Firefox:
- [Vue.js devtools](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/)
- [Turn on Custom Object Formatter in Firefox DevTools](https://fxdx.dev/firefox-devtools-custom-object-formatters/)

## Type Support for `.vue` Imports in TS

TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.

## Customize configuration

See [Vite Configuration Reference](https://vite.dev/config/).

## Project Setup

```sh
npm install
```

### Compile and Hot-Reload for Development

```sh
npm run dev
```

### Type-Check, Compile and Minify for Production

```sh
npm run build
```
1 change: 1 addition & 0 deletions toaster-oven/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
13 changes: 13 additions & 0 deletions toaster-oven/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Toaster Oven</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Loading
Loading