Three stores, three importers and three pickers that differ only in their type are one of each (#85)
Refactoring round one: HttpFontStore/HttpSoundStore/HttpTextureStore collapse into a generic HttpFileStore over a FileStore contract; fontImport/soundImport/textureImport share assetImport with an ImportKind per sort; ImagePicker/FontPicker/SoundPicker sit on FilePicker and describe only their row. The group/comment drag logic leaves GraphCanvas for annotationDrag.ts (with its own unit test), declaredRows.ts replaces the duplicated row build in particles.ts and shaders.ts, and dead code in font/sound/compile/emission/transform/actions is gone. README: asset list, check count 958, the two-job CI, the Scenes wiki page. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
15bdfdf07a
commit
cc6db5f350
42 files changed
+1375
-1650
No files matched your search
@@ -15,7 +15,7 @@ import type { Project } from '../model/Project';
|
||||
import { coerceValue, defaultsOf } from '../properties/PropertySchema';
|
||||
import { type Removed, removeById, removeFirst, removeWhere, restoreAt } from '../util/list';
|
||||
import { type Command, CommandError } from './Command';
|
||||
import { requireGraph, requireNode, requireNodeDef } from './require';
|
||||
import { requireEdge, requireGraph, requireNode, requireNodeDef } from './require';
|
||||
import { SetBagValueCommand } from './SetBagValueCommand';
|
||||
|
||||
export class AddNodeCommand implements Command {
|
||||
@@ -221,19 +221,13 @@ export class FoldEdgeCommand implements Command {
|
||||
}
|
||||
|
||||
execute(project: Project): void {
|
||||
const edge = this.edge(project);
|
||||
const edge = requireEdge(project, this.assetId, this.edgeId);
|
||||
this.previous = edge.folded === true;
|
||||
this.apply(edge, this.folded);
|
||||
}
|
||||
|
||||
undo(project: Project): void {
|
||||
this.apply(this.edge(project), this.previous);
|
||||
}
|
||||
|
||||
private edge(project: Project): GraphEdge {
|
||||
const edge = requireGraph(project, this.assetId).edges.find((e) => e.id === this.edgeId);
|
||||
if (!edge) throw new CommandError(`Edge ${this.edgeId} not found`);
|
||||
return edge;
|
||||
this.apply(requireEdge(project, this.assetId, this.edgeId), this.previous);
|
||||
}
|
||||
|
||||
private apply(edge: GraphEdge, folded: boolean): void {
|
||||
@@ -254,19 +248,13 @@ export class NameTransitionCommand implements Command {
|
||||
) {}
|
||||
|
||||
execute(project: Project): void {
|
||||
const edge = this.edge(project);
|
||||
const edge = requireEdge(project, this.assetId, this.edgeId);
|
||||
this.previous = edge.label ?? '';
|
||||
this.apply(edge, this.name.trim());
|
||||
}
|
||||
|
||||
undo(project: Project): void {
|
||||
this.apply(this.edge(project), this.previous);
|
||||
}
|
||||
|
||||
private edge(project: Project): GraphEdge {
|
||||
const edge = requireGraph(project, this.assetId).edges.find((e) => e.id === this.edgeId);
|
||||
if (!edge) throw new CommandError(`Edge ${this.edgeId} not found`);
|
||||
return edge;
|
||||
this.apply(requireEdge(project, this.assetId, this.edgeId), this.previous);
|
||||
}
|
||||
|
||||
private apply(edge: GraphEdge, name: string): void {
|
||||
|
||||
Reference in new issue
Block a user