Add signal colors and axis drop overlays - #80
Conversation
Introduces per-signal plot color overrides in analysis plots, including legend swatch color picking/reset and persistence through saved configs/local storage. Adds left/right axis drop overlay zones so dragged signals can be assigned directly to a target axis, and updates layout serialization to v2 while keeping backward compatibility with legacy v1 layouts.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5beb9dc2d8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const next = assignSignals(prev, signals, target); | ||
| if (axis === "right") { |
There was a problem hiding this comment.
Clear right-axis membership on left-zone drops
When a signal that already has rightAxis membership is dropped on the left overlay, this path only calls assignSignals; that helper explicitly preserves moved signals' right-axis membership, so the signal still renders on the right axis even though the left zone was selected. Handle axis === "left" by removing the dropped signals from the target group's rightAxis.
Useful? React with 👍 / 👎.
| start: new Date(viewRange[0]).toISOString(), | ||
| end: new Date(viewRange[1]).toISOString(), | ||
| plots: layoutToPlots(plots), | ||
| colors: Object.keys(colorOverrides).length > 0 ? colorOverrides : undefined, |
There was a problem hiding this comment.
Persist saved-view color overrides server-side
When saving a view with custom colors, this adds colors to the POST payload, but the backend does not currently accept or store that field: AnalysisConfigCreate only declares plots in backend/app.py:72-79, and AnalysisConfigsRepository.create_config writes no colors entry in backend/storage.py:240-249. With the pinned Pydantic v2 default of ignoring extra fields, the save still succeeds but listed/loaded configs omit the overrides, so reloading a saved view loses all color choices.
Useful? React with 👍 / 👎.
Adds optional `colors` support when creating analysis configs so color overrides are stored and returned by the backend. Also fixes plot-axis behavior in the workspace by clearing moved signals from `rightAxis` when they are reassigned to the left axis, preventing stale right-axis assignments after drag-and-drop. Includes endpoint/repo and frontend layout/component test updates for both behaviors.
Introduces per-signal plot color overrides in analysis plots, including legend swatch color picking/reset and persistence through saved configs/local storage. Adds left/right axis drop overlay zones so dragged signals can be assigned directly to a target axis, and updates layout serialization to v2 while keeping backward compatibility with legacy v1 layouts.