Skip to content

Add color picker gradient color stop duplication by holding Alt#4291

Merged
Keavon merged 3 commits into
masterfrom
gradient-stop-duplication
Jun 29, 2026
Merged

Add color picker gradient color stop duplication by holding Alt#4291
Keavon merged 3 commits into
masterfrom
gradient-stop-duplication

Conversation

@Keavon

@Keavon Keavon commented Jun 28, 2026

Copy link
Copy Markdown
Member

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread frontend/src/components/widgets/inputs/SpectrumInput.svelte Outdated
Comment thread frontend/src/components/widgets/inputs/SpectrumInput.svelte
Comment thread editor/src/messages/color_picker/color_picker_message_handler.rs

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, the un-duplicate doc 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

Comment thread frontend/src/components/widgets/inputs/SpectrumInput.svelte Outdated
Comment thread frontend/src/components/widgets/inputs/SpectrumInput.svelte
Comment thread frontend/src/components/widgets/inputs/SpectrumInput.svelte Outdated
Comment thread editor/src/messages/layout/utility_types/widgets/input_widgets.rs

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread frontend/src/components/widgets/inputs/SpectrumInput.svelte
@Keavon Keavon merged commit 244b257 into master Jun 29, 2026
11 checks passed
@Keavon Keavon deleted the gradient-stop-duplication branch June 29, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant