feat(04-04): add UpdateParamsCommand + BlockInspector module

- UpdateParamsCommand with execute/undo for color/speed/direction/length
- Uses module-level currentShowId (not this._showId) matching existing pattern
- BlockInspector renders compact strip with animation label, color swatch,
  speed input, direction select, length input, and remove button
- Color change committed on 'change' event (not 'input') to avoid command flood
- _onDelete callback wired to remove button for app.js to handle
This commit is contained in:
Claude
2026-04-06 23:51:48 +00:00
parent d1965dcefc
commit e82fc4a775
2 changed files with 139 additions and 0 deletions

View File

@@ -88,6 +88,27 @@ export class ResizeBlockCommand {
}
}
// ── UpdateParamsCommand ──────────────────────────────────────────────────────
export class UpdateParamsCommand {
constructor(tracks, block, oldParams, newParams) {
this.tracks = tracks;
this.block = block;
this.oldParams = { ...oldParams }; // shallow copy
this.newParams = { ...newParams }; // shallow copy
}
execute() {
Object.assign(this.block.params, this.newParams);
syncBlock(currentShowId, this.block.device_id, this.block, 'PATCH');
}
undo() {
Object.assign(this.block.params, this.oldParams);
syncBlock(currentShowId, this.block.device_id, this.block, 'PATCH');
}
}
// ── DeleteBlockCommand ───────────────────────────────────────────────────────
export class DeleteBlockCommand {