Repository navigation
Colour a gridview selection at once, in Signals panel and plot area - #511
Merged
Merged
Conversation
Owner
Author
This was referenced Sep 23, 2026
thebhef
force-pushed
the
task154-colour-selection
branch
from
September 23, 2026 15:43
e6af8ea to
640c31d
Compare
thebhef
force-pushed
the
task150-review-followups
branch
from
September 23, 2026 15:43
27eaf56 to
4037d48
Compare
This was referenced Sep 23, 2026
thebhef
force-pushed
the
task150-review-followups
branch
from
September 23, 2026 16:46
4037d48 to
c826d01
Compare
thebhef
force-pushed
the
task154-colour-selection
branch
from
September 23, 2026 16:46
640c31d to
47a1442
Compare
thebhef
force-pushed
the
task150-review-followups
branch
from
September 24, 2026 01:39
c826d01 to
fb1984e
Compare
thebhef
force-pushed
the
task154-colour-selection
branch
from
September 24, 2026 01:39
47a1442 to
78f9863
Compare
This was referenced Sep 24, 2026
This was referenced Oct 6, 2026
Open
thebhef
marked this pull request as ready for review
October 14, 2026 21:08
Owner
Author
thebhef
changed the base branch from
task150-review-followups
to
graphite-base/511
October 14, 2026 21:10
Both panels' colour pickers wrote one signal at a time even when a multi-row selection was active, so recolouring a group meant picking the same colour N times. Both panels already fan other actions over a selection (the Signals panel's drag source, the plot area's Hide/Show context menu), so the pick now follows the same "selection the right-clicked row belongs to" rule those already use: a right-click on a row already in the selection recolours every selected row; a right-click outside it replaces the selection with just that row first (the plot area's existing rule for its Hide/Show menu, now shared by the swatch picker too). Signals panel: `SignalsPanel.tsx` resolves the right-clicked row against `grid.selection` and writes every non-pattern, non-section key through a new batched `onSetSignalColors` callback (App.tsx's `handleSetSignalColors`), threaded through `ProjectContextValue` alongside the existing single-key `onSetSignalColor`. One `setSignalColors` call, one dirty step, for however many rows the pick touched. A pattern chip or section header caught in the selection carries no signal key and drops out silently (ADR 0045: a pattern names no colour). Plot area: the swatch's right-click handler (`SignalSwatch` in `PlotArea.tsx`) now selects the clicked row first when it isn't already selected, then always writes through a new `onSetSelectionColor` axis handler — the selection-scoped sibling of the existing `onSetSelectionHidden`, implemented in `PlotPanel.tsx` as `setSelectionColor` with the same per-row pattern-materialization rule `setSelectionHidden` already has. Since every pick now goes through this selection-based path (a lone right-click just makes a one-row selection), the old single-ref `setSignalColor` / `onSetSignalColor` plumbing had no remaining caller and is removed rather than left beside the new path. Three existing swatch-picker tests in `PlotPanel.dom.test.tsx` fired the colour input's `change` event directly, skipping the right-click that (now) resolves the write's target; updated them to fire `contextmenu` first, matching the real gesture. The "right-clicking the swatch..." test's expectation flips accordingly: the previously-unselected row now becomes the selection, per the new rule. Storage is unchanged (ADR 0026): a plot pick still lives on the series' `colorPick`, a Signals-panel pick still lives on the project's `signal_colors` map. README's plot-area colour passages and ADR 0026's picker bullet are updated to describe the selection-scoped pick and correct two now-false claims (swatch picks "are not selection gestures"; the selection menu has "no bulk recolor"). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
thebhef
force-pushed
the
task154-colour-selection
branch
from
October 14, 2026 21:11
96e6d18 to
1dbff69
Compare
This was referenced Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Both panels' colour pickers wrote one signal at a time even when a
multi-row selection was active, so recolouring a group meant picking
the same colour N times. Both panels already fan other actions over a
selection (the Signals panel's drag source, the plot area's Hide/Show
context menu), so the pick now follows the same "selection the
right-clicked row belongs to" rule those already use: a right-click on
a row already in the selection recolours every selected row; a
right-click outside it replaces the selection with just that row
first (the plot area's existing rule for its Hide/Show menu, now
shared by the swatch picker too).
Signals panel:
SignalsPanel.tsxresolves the right-clicked rowagainst
grid.selectionand writes every non-pattern, non-section keythrough a new batched
onSetSignalColorscallback (App.tsx'shandleSetSignalColors), threaded throughProjectContextValuealongside the existing single-key
onSetSignalColor. OnesetSignalColorscall, one dirty step, for however many rows the picktouched. A pattern chip or section header caught in the selection
carries no signal key and drops out silently (ADR 0045: a pattern
names no colour).
Plot area: the swatch's right-click handler (
SignalSwatchinPlotArea.tsx) now selects the clicked row first when it isn'talready selected, then always writes through a new
onSetSelectionColoraxis handler — the selection-scoped sibling ofthe existing
onSetSelectionHidden, implemented inPlotPanel.tsxassetSelectionColorwith the same per-row pattern-materialization rulesetSelectionHiddenalready has. Since every pick now goes throughthis selection-based path (a lone right-click just makes a
one-row selection), the old single-ref
setSignalColor/onSetSignalColorplumbing had no remaining caller and is removedrather than left beside the new path.
Three existing swatch-picker tests in
PlotPanel.dom.test.tsxfiredthe colour input's
changeevent directly, skipping the right-clickthat (now) resolves the write's target; updated them to fire
contextmenufirst, matching the real gesture. The"right-clicking the swatch..." test's expectation flips accordingly:
the previously-unselected row now becomes the selection, per the new
rule.
Storage is unchanged (ADR 0026): a plot pick still lives on the
series'
colorPick, a Signals-panel pick still lives on the project'ssignal_colorsmap.README's plot-area colour passages and ADR 0026's picker bullet are
updated to describe the selection-scoped pick and correct two
now-false claims (swatch picks "are not selection gestures"; the
selection menu has "no bulk recolor").
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com