Skip to content

feat: Shift+click selects several nodes, and the tools act on all of them - #333

Merged
pshenok merged 1 commit into
mainfrom
feat/multi-select
Nov 4, 2026
Merged

pshenok merged 1 commit into
mainfrom
feat/multi-select

Conversation

@pshenok

@pshenok pshenok commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Part of #89, item 2: "Ability to select the multiple nodes and do operations like link/unlike, move node so on."

What a player can do

With the Select tool, Shift+click adds or removes a node. Then:

operation how what happens
Move drag any selected node The group moves together. If one member would land on an occupied tile, the whole group goes back.
Link press Link, click a node Every selected node that may link to it does. If none may, one refusal explains why. Shift keeps the selection for another target.
Unlink press Unlink, click a node Removes the links between the selection and that node, in either direction.
Remove press Delete (Backspace on a Mac keyboard) Removes them, with the Demolish tool's refund. Not while typing in a field, with the menu open, or during the tutorial.

All selected nodes get the bright ring, and their links take the colours from #331.

Decisions to check

  • A click inside the group that moves nothing narrows the selection to that node, as in most design tools.
  • A single selected node does not carry into Link. Every drag leaves one selected, so the next Link click would be a wire nobody asked for. Only a selection of two or more, which takes a deliberate Shift+click, carries over.
  • Link goes from the selection to the node clicked. For one source to many targets, use the Shift hold from feat: Shift keeps the Link source for the next link #332. Selecting three Computes and clicking the LB is refused with the usual message, because Compute can't send to an LB. I didn't reverse it silently, because a link's direction is what the game teaches.
  • Touch has no Shift, so phones keep single selection for now.

Code

The selection is now STATE.selection, a set of node ids, and selectedNodeId goes back to being only the Link source. moveNodeTo() replaces two copies of the same mesh-and-ring code.

Docs

The help screen's Select entry claimed that clicking Compute or a DB upgrades it, which the placement tools do. It now describes what the tool does, in all eleven locales. These lines haven't had a native speaker's review. The README's controls list now has this and the Shift hold from #332.

Checked

In a real browser with real mouse clicks and a held Shift key, on an LB, three Computes and a DB:

step result
select the 3 Computes all three selected, all three rings bright
drag one all three land the same distance away, on the grid
press C selection kept, ring on the DB
click the DB 3 links, selection cleared
select 2, V their links cyan, the third dimmed
press U, click the DB those 2 links gone, the third stays
select 2, press Delete both gone, $60 refund (50% of 2 × $60), the remaining link back to normal colour

I ran 26 mutations across the drag, the tool carry-over, Link, Unlink, Delete and the resets. 25 were caught on the first run. The survivor, a Link source losing its bright ring, showed a missing test, which is now in.

…them

With the Select tool, Shift+click adds or removes a node. Then:

  - dragging any of them moves the group. Every member lands the same
    number of tiles from where it started; if one would land on an
    occupied tile the whole group goes back, because a group that lands
    apart is not the shape the player was moving;
  - Link and Unlink carry the selection over and apply to the node
    clicked next: every member that may link does, and Unlink removes
    the links between the selection and that node in either direction;
  - Delete (Backspace on a Mac keyboard) removes them, refunding as the
    Demolish tool does.

A click inside the group that moves nothing narrows it to that node. A
single selected node does not carry into Link, because every drag leaves
one selected and the next click would be a wire nobody asked for.

The selection is now STATE.selection, a set of node ids, and
selectedNodeId goes back to being only the Link source.

The help screen's Select entry claimed that clicking Compute or a DB
upgrades it, which the placement tools do. It now describes what the tool
does, in all eleven locales. The README's controls list has this and the
Shift hold from the previous change.

Touch has no Shift, so phones keep single selection.

Closes #89 item 2.
@pshenok
pshenok merged commit 365a4d3 into main Nov 4, 2026
1 check passed
@pshenok
pshenok deleted the feat/multi-select branch November 4, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant