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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user