EditorRightPanel: Path Properties gets Start/End color inputs + 'Swap colors' button (#350 UI layer) #395
Labels
No labels
blocked:commit-ready-failed
blocked:gate-fetch
blocked:gate-lint
blocked:gate-plan
blocked:gate-research
blocked:needs-attention
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:verify-failed
bug
deferred
feature-request
in-progress
needs-decompose
needs-triage
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/Kimi_Agent_Brother_10_Digitizing_App#395
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent-Issue: #350
Depends on #393 (type layer —
gradientfield) and #394 (renderers consume it). Do this issue only after both land and the canvas actually draws gradients.Scope (UI layer — type and renderer already in place)
The Path Properties section of
src/components/editor/EditorRightPanel.tsxcurrently shows a singleThread Colorpicker bound to the selected path'sthreadColor. Add:threadColorvalue)threadColor)closedtoggle at line 230-233 for the pattern)All three operations must flow through the same
setPaths + pushHistorypair used by every other per-path mutation in this panel (e.g., the satin-width slider, the closed toggle), so they are undoable with a single Ctrl+Z.Concrete change
In
EditorRightPanel.tsx, find the Thread Color section in the Path Properties area (around line 670-700 — there is a section-open map keyed by string ids including'thread-color'per the comment at line 672). Add a sibling section that:selectedPath.gradientif defined, else synthesizes{ startColor: threadColor, endColor: threadColor }for displayonUpdateSelectedPathGradient(gradient: { startColor, endColor } | undefined)callback wired up inEditor.tsxnext toonUpdateSelectedPathSatinWidth(line 79-86),onTogglePathClosed(line 233), etc.paths[i].gradient, then callssetPaths(...)andpushHistory(...)onceThe swap button:
Button UX — copy the existing per-row action button style (e.g., the Reverse button pattern at the bottom of Path Properties):
When the user hasn't enabled the gradient, the swap button is disabled. When
startColor === endColor, the swap is a no-op visually — that's fine, no special-case needed.Files to touch
src/components/editor/EditorRightPanel.tsx— UI additionssrc/components/editor/Editor.tsx— wire uponUpdateSelectedPathGradient(parallel toonUpdateSelectedPathSatinWidthat line 79-86)src/components/editor/__tests__/issue-350.test.tsx(or follow the existing per-issue test filename convention — seeissue-339.test.tsx,issue-341.test.tsx,issue-349.test.tsxfor the pattern) — test the swap function plus the disabled stateAcceptance
pnpm testpasses including the new test.origin/mainhas the renderer changes), click Swap, see blue→red in place, Ctrl+Z once to revert.gradientset continues to render as a single solid color (no UI regression).Reference patterns
<ArrowRightLeft>from lucide-react — the Swap button reuses the same icon.Discovery check
Confirm before starting:
The patterns cited above are accurate as of 2026-10-05.