Add color picker gradient color stop duplication by holding Alt#4291
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements Alt-drag duplication of gradient stops, allowing users to clone a marker by holding the Alt key during a drag. It adds new message variants (InsertDuplicate and RemoveDuplicate), updates the Svelte frontend to track Alt key states and reconcile duplicates, and introduces a duplicate_stop method in the Rust backend. The review feedback highlights three key issues: a race condition where calling reconcileDuplicate immediately on key events bypasses safety guards and causes the wrong marker to move, a potential bug in findDuplicateAnchorIndex that could delete unrelated markers if the duplicate is missing (suggesting a distance threshold), and a missing defensive guard in the Rust backend to prevent deleting the active marker itself during duplicate removal.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
4 issues found across 4 files
Confidence score: 2/5
- In
frontend/src/components/widgets/inputs/SpectrumInput.svelte, the duplicate-release path can remove the nearest stop even when it doesn’t match the frozen duplicate position, so stale marker props could delete the wrong gradient stop for users — tighten the removal check to only act on an exact frozen-position match before merging. - In
frontend/src/components/widgets/inputs/SpectrumInput.svelte(reconcileDuplicate,moveActiveMarker, and the Alt keydown flow), reconciling duplication too early creates a race that bypasses the stale-index guard and can move an unintended stop after mid-drag duplication — route reconciliation through the guarded path and verify Alt down/up drag behavior with a targeted regression test before merging. - In
editor/src/messages/layout/utility_types/widgets/input_widgets.rs, theun-duplicatedoc wording is a minor clarity issue and not merge-blocking, but updating it to standard phrasing will prevent confusion in future maintenance.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
No description provided.