Trim needless comments and fix the picker width
Remove comments that only restate the code, keeping the section banners and the notes that carry a reason, a measured fact or an external contract. ButtonOptions.width claimed to be a fixed width but only set minWidth, so the Graph and Texture pickers grew with the name they showed. It is now what it promises, with a separate minWidth for the buttons that have two forms. Narrow buttons shrink their padding, otherwise a 24px icon button had 8px left for its glyph and truncate dropped it entirely. __gm.labelsDropped() guards that class: the overflow guard only saw text that was too wide, never a label truncated to nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f16801aef3
commit
4d84231b9f
115 files changed
+707
-1564
No files matched your search
@@ -16,7 +16,6 @@ import { type Command, CommandError } from './Command';
|
||||
import { requireBehavior, requireNode, requireNodeDef } from './require';
|
||||
import { SetBagValueCommand } from './SetBagValueCommand';
|
||||
|
||||
/** Adds a node of the given type at graph coordinates. Params start at their defaults. */
|
||||
export class AddNodeCommand implements Command {
|
||||
readonly label: string;
|
||||
readonly node: GraphNode;
|
||||
@@ -28,8 +27,8 @@ export class AddNodeCommand implements Command {
|
||||
y: number,
|
||||
params: PropertyBag = {},
|
||||
) {
|
||||
// An unknown type is rejected in `execute`, not here: constructors run outside the
|
||||
// editor's error handling, so throwing here would crash instead of showing a notice.
|
||||
// An unknown type is rejected in `execute`: constructors run outside the editor's error
|
||||
// handling, so throwing here would crash instead of showing a notice.
|
||||
const def = nodeDef(type);
|
||||
this.node = {
|
||||
id: newId(),
|
||||
@@ -80,8 +79,8 @@ export class RemoveNodeCommand implements Command {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a node's graph position. A caller that previewed the drag must restore the node
|
||||
* before executing: the previous position is read at execution time.
|
||||
* The previous position is read at execution time, so a caller that previewed the drag must restore
|
||||
* the node before executing.
|
||||
*/
|
||||
export class MoveNodeCommand implements Command {
|
||||
readonly label = 'Move node';
|
||||
@@ -134,10 +133,7 @@ export class SetNodeParamCommand extends SetBagValueCommand<GraphNode> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Connects an output to an input. Validates port existence and type compatibility; a data
|
||||
* input holds at most one edge, so an existing one is replaced (and restored on undo).
|
||||
*/
|
||||
/** A data input holds at most one edge, so an existing one is replaced (and restored on undo). */
|
||||
export class ConnectCommand implements Command {
|
||||
readonly label = 'Connect';
|
||||
readonly edge: GraphEdge;
|
||||
@@ -175,7 +171,6 @@ export class ConnectCommand implements Command {
|
||||
}
|
||||
}
|
||||
|
||||
/** Removes one edge. */
|
||||
export class DisconnectCommand implements Command {
|
||||
readonly label = 'Disconnect';
|
||||
private removed: Removed<GraphEdge>[] = [];
|
||||
|
||||
Reference in new issue
Block a user