Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ firmware/include/version.generated.h

app/public/firmware/*.bin
app/public/firmware/manifest.json
*.tsbuildinfo
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Full field reference and step-by-step for adding a plugin: `docs/plugins.md`.
- `app/src/lib/layoutStorage.ts`, `deviceSetupStorage.ts`, `globalVarsStorage.ts` — browser-persisted state (layout drafts, device setup, `$var:KEY` global variables referenced by `text`/`color` config fields).
- `app/src/lib/serial.ts` — reads device config over USB serial (uses `esp-web-tools` for flashing).
- `app/src/models/` — `LayoutCell`, `LayoutDraft`, `BudpyConfigInput`, `DeviceSetupInput` types.
- `app/src/components/layout/` — drag/drop layout editor (`layoutCells.ts`, `layoutDrag.ts`) and the plugin palette/customization panels.
- `app/src/components/layout/` — drag/drop layout editor (`layoutCells.ts`, `layoutDrag.ts`), the preview grid and the customization panel (plugin picker + settings form).
- Config field type `image`: file picker resizes to cell pixel size, re-encodes JPEG, stores base64 (no `data:` prefix, 48 KB cap) in cell config; firmware base64-decodes and renders (see `plugins/image`).

## Firmware structure
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@budpy/app",
"version": "1.2.0",
"version": "1.4.0",
"private": true,
"type": "module",
"scripts": {
Expand Down
24 changes: 8 additions & 16 deletions app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import { EspSidebar } from "./components/EspSidebar";
import { Layout } from "./components/Layout";
import {
createBudpyConfigInputFromConfig,
defaultBackgroundColor,
defaultBrightness,
defaultBrightnessMode,
fitCellsToOrientation,
getLayoutPageCount,
listPluginManifests,
Expand Down Expand Up @@ -108,25 +105,20 @@ export function App() {
config,
pluginManifests,
);
const nextCells = fitCellsToOrientation(
importedInput.cells,
importedInput.orientation,
);
const nextSetupInput = {
ssid: importedInput.ssid,
password: importedInput.password,
backgroundColor: importedInput.backgroundColor ?? defaultBackgroundColor,
brightness: importedInput.brightness ?? defaultBrightness,
brightnessMode: importedInput.brightnessMode ?? defaultBrightnessMode,
} satisfies DeviceSetupInput;
const {
orientation: importedOrientation,
cells: importedCells,
...nextSetupInput
} = importedInput;
const nextCells = fitCellsToOrientation(importedCells, importedOrientation);

setSetupInput(nextSetupInput);
saveStoredDeviceSetupInput(nextSetupInput);
setOrientation(importedInput.orientation);
setOrientation(importedOrientation);
setActivePage(0);
setCells(nextCells);
saveStoredLayoutDraft({
orientation: importedInput.orientation,
orientation: importedOrientation,
activePage: 0,
cells: nextCells,
});
Expand Down
9 changes: 9 additions & 0 deletions app/src/components/EspSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
} from "../lib/config";
import { saveStoredDeviceSetupInput } from "../lib/deviceSetupStorage";
import {
findUnresolvedVarRefs,
readGlobalVars,
resolveGlobalVarsInConfig,
} from "../lib/globalVarsStorage";
Expand Down Expand Up @@ -154,6 +155,14 @@ export function EspSidebar({

try {
const globalVars = readGlobalVars();
const missingVars = new Set(
cells.flatMap((cell) => findUnresolvedVarRefs(cell.config, globalVars)),
);
if (missingVars.size > 0) {
throw new Error(
`Undefined variable(s): ${[...missingVars].join(", ")}. Define them in Variables or pick another value.`,
);
}
const resolvedCells = cells.map((cell) => ({
...cell,
config: resolveGlobalVarsInConfig(cell.config, globalVars),
Expand Down
55 changes: 0 additions & 55 deletions app/src/components/Flash.tsx

This file was deleted.

1 change: 1 addition & 0 deletions app/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ export function Layout({
ref={aboutDialogRef}
className={`modal-dialog ${styles["about-dialog"]}`}
aria-labelledby="about-dialog-title"
onClose={() => setIsAboutOpen(false)}
onClick={(e) => {
if (e.target === aboutDialogRef.current) setIsAboutOpen(false);
}}
Expand Down
9 changes: 0 additions & 9 deletions app/src/components/Setup.module.css

This file was deleted.

192 changes: 0 additions & 192 deletions app/src/components/Setup.tsx

This file was deleted.

Loading
Loading