Skip to content

[BUGFIX] Threshold color picker goes crazy when holding the mouse cli…#77

Merged
ibakshay merged 1 commit intoperses:mainfrom
adrianSepiol:fix-threshold-editor
Mar 3, 2026
Merged

[BUGFIX] Threshold color picker goes crazy when holding the mouse cli…#77
ibakshay merged 1 commit intoperses:mainfrom
adrianSepiol:fix-threshold-editor

Conversation

@adrianSepiol
Copy link
Contributor

Description

closes TimeSeriesChart: Threshold color picker goes crazy when holding the mouse click down

Eliminated redundant useState/useEffect pattern that was duplicating the steps state from props. The component was maintaining its own copy of the threshold steps and syncing it via useEffect, which created a race condition where simultaneous updates from useEffect setState calls and onChange callbacks would override each other, causing infinite loops.

Now the component relies solely on the external state passed via props as the single source of truth, ensuring consistent updates without conflicting state synchronization.

Screenshots

Screencast.from.03-03-2026.10.29.42.AM.webm

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.
  • E2E tests are stable and unlikely to be flaky.
    See e2e docs for more details. Common issues include:
    • Is the data inconsistent? You need to mock API requests.
    • Does the time change? You need to use consistent time values or mock time utilities.
    • Does it have loading states? You need to wait for loading to complete.

@adrianSepiol adrianSepiol requested a review from a team as a code owner March 3, 2026 09:35
@jgbernalp
Copy link
Contributor

@adrianSepiol thnx for this. Please add your DCO

@adrianSepiol adrianSepiol force-pushed the fix-threshold-editor branch from acf852e to 8f54191 Compare March 3, 2026 09:42
…ck down

Signed-off-by: Adrian Sepiół <adisepko@gmail.com>
@adrianSepiol adrianSepiol force-pushed the fix-threshold-editor branch from 8f54191 to 4222532 Compare March 3, 2026 11:42
@ibakshay ibakshay merged commit 4d322c2 into perses:main Mar 3, 2026
12 checks passed
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.

TimeSeriesChart: Threshold color picker goes crazy when holding the mouse click down

3 participants