Selection State
Observable single + multi selection model used by the editor's master pane (scenario workflow §6) and any other list-or-table surface that wants standard click semantics:
Click → select — replaces the selection with the clicked item; sets the anchor for future range extends.
⌘ / Ctrl-click → toggle — adds or removes the item; resets the anchor.
Shift-click → extend — selects the range between the current anchor and the target within the provided ordered list. When no anchor is set, falls back to select.
Generic in T: any equatable selection-element type works. Scenarios identify rows by name or by ScenarioId; bundle-ref panels identify rows by bundleId.
Survives data mutations through pruneRemoved: when the underlying list drops items, the editor passes the removed set to drop them from the selection in one shot.
Properties
Functions
Selects the contiguous range between the current anchor and target within orderedItems. When no anchor is set or either endpoint isn't in the ordered list, falls back to select. The anchor stays put so subsequent shift-clicks re-extend from the same starting point.
Whether item is currently selected.
Drops every entry in removed from the selection in one shot. When the anchor is among the removed items, falls back to the most recent surviving selection (or null if the selection emptied). Called by editors when their underlying list mutates.