Leave hiding and deleting a link to its right-click menu
The inspector of a picked link carried the buttons Hide link and Delete link below its facts. Both actions are in the right-click menu of the line since #289, and Delete removes a picked link as well. The user asked for the buttons to go. - buildEdgeSection in editor/inspector/edgeSection.ts only describes now: the two ends, the type, and for a transition its name field. - The button under several picked links and Delete transition in a state machine go with them. They came from the same line of code, and the menu offers both. - The note under several links stays. It speaks of the Delete key. Tests: - Gate on melektaus-atx: 212 files, 3260 tests, exit 0. - e2e 4,6,26 on melektaus-atx: 275 checks, all pass. - No full run and no smokes. The sum of e2e checks stays at 1676, which is reckoned. - Module 06 now checks that the inspector of a picked link shows neither button. Its menu check finds Hide link and Delete link only in the menu, where it had to take the one drawn last before. - Module 26 checks that a picked transition shows no Delete transition. - No unit test names the buttons. No counter-probe was run. The old checks found both texts in the inspector, which is the state the new ones would fail on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f02adabcf9
commit
c7dc0e4733
3 files changed
+13
-22
No files matched your search
@@ -3,10 +3,10 @@ import { findNode, type GraphEdge, isStateNode, resolveDef, stateName } from '..
|
||||
import { graphLookup } from '../../core/model/graphLookup';
|
||||
import { findGraphAsset, type Project } from '../../core/model/Project';
|
||||
import { textOf } from '../../core/model/Properties';
|
||||
import { Button, Label } from '../../ui';
|
||||
import { hideLinks, linkNoun, removeGraphSelection } from '../actions';
|
||||
import { Label } from '../../ui';
|
||||
import { linkNoun } from '../actions';
|
||||
import { createFieldRow, labelledRow } from './fieldFactory';
|
||||
import { addGap, addNote, addTitle, type InspectorHost } from './host';
|
||||
import { addNote, addTitle, type InspectorHost } from './host';
|
||||
|
||||
const NAME_KEY = 'transition-name';
|
||||
|
||||
@@ -64,7 +64,10 @@ export function edgeSignature(
|
||||
return d ? [d.transition, d.from, d.output, d.to, d.input, d.type].join('|') : 'missing';
|
||||
}
|
||||
|
||||
/** One link: where it comes from and goes to. Several: how many, and the way to delete them. */
|
||||
/**
|
||||
* One link: where it comes from and goes to. Several: how many. Hiding and deleting live in the
|
||||
* right-click menu of the line, not here.
|
||||
*/
|
||||
export function buildEdgeSection(
|
||||
host: InspectorHost,
|
||||
assetId: string,
|
||||
@@ -72,18 +75,9 @@ export function buildEdgeSection(
|
||||
edgeIds: readonly string[],
|
||||
): void {
|
||||
const noun = linkNoun(host.state, assetId);
|
||||
const remove = (label: string) =>
|
||||
host.body.add(
|
||||
new Button(label, {
|
||||
variant: 'danger',
|
||||
onClick: () => removeGraphSelection(host.state, assetId, [], [], edgeIds),
|
||||
}),
|
||||
);
|
||||
if (edgeIds.length > 1) {
|
||||
addTitle(host, `${edgeIds.length} ${noun.toUpperCase()}S`);
|
||||
addNote(host, 'Delete removes all of them in one step.');
|
||||
addGap(host);
|
||||
remove(`Delete ${edgeIds.length} ${noun}s`);
|
||||
return;
|
||||
}
|
||||
const d = describeEdge(host.state.project, assetId, edgeId);
|
||||
@@ -109,10 +103,6 @@ export function buildEdgeSection(
|
||||
fact('Input', d.input);
|
||||
fact('Type', d.type);
|
||||
}
|
||||
addGap(host);
|
||||
if (!d.transition)
|
||||
host.body.add(new Button('Hide link', { onClick: () => hideLinks(host.state, assetId, [edgeId]) }));
|
||||
remove(`Delete ${noun}`);
|
||||
}
|
||||
|
||||
/** Pushes the current name into its row. False when the link is gone (rebuild). */
|
||||
|
||||
Reference in new issue
Block a user