Repository navigation
Conversation
Emptying a stop's color text and leaving the field removes that stop (with one neighboring transition hint). The only color stop gets its previous color back. A window/tab switch doesn't count as leaving. The Remove menu action now shares removeStopAt(), which takes the hint before the last stop instead of leaving a dangling trailing hint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
β Deploy Preview for hd-gradients ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Owner
Author
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.


Problem
Clearing a color stop's text field left the stop in place with an empty color, so the gradient went invalid until you typed something or found Remove in the stop's menu (#81). Separately, Remove on the last stop used
splice(position, 2), which only removed the stop and left a dangling hint at the end of the list.Solution
document.hasFocus()guard), so an alt-tab mid-edit won't eat the stop.removeStopAt()insrc/utils/stops.ts. The blur path and the Remove menu both use it: the last stop takes the hint before it, so Remove no longer leaves a dangling hint. 5 unit tests insrc/utils/removeStop.test.ts.Verified with Playwright in Chromium and Firefox at 1440px and at 390px with reduced motion. With 4 stops I emptied the middle stop, then the last one. Both were removed, the hint count stayed at stops β 1, and the CSS snippet stayed valid. Two undos restored both stops with their original colors, and emptying the only stop restored its color. No page errors. WebKit wasn't checked: Playwright WebKit crashes on this machine even on the live gradient.style. Checks:
npm test(129 passing),npm run lintandnpm run buildall pass.svelte-checkshows the same baseline errors as main.I also tried #100 (Firefox can't copy the snippets) in Playwright Firefox: the snippet Copy button and Global Actions β Copy modern CSS both reached
navigator.clipboard.writeTextand resolved. It doesn't reproduce in current Firefox, so it's probably safe to close. This PR doesn't touch it.Impact
Fixes #81. Deleting a stop is now as quick as clearing its text, which matches how people already try to do it. The Remove action stops leaving a trailing hint behind.
π€ Generated with Claude Code