Skip to content

Fix RGB scrollbar values persisting across item selections#25

Open
muhammadrashid4587 wants to merge 1 commit into
Osman-Kahraman:mainfrom
muhammadrashid4587:fix/rgb-scrollbar-persistence
Open

Fix RGB scrollbar values persisting across item selections#25
muhammadrashid4587 wants to merge 1 commit into
Osman-Kahraman:mainfrom
muhammadrashid4587:fix/rgb-scrollbar-persistence

Conversation

@muhammadrashid4587

Copy link
Copy Markdown

Summary

  • Fixes bug where R/G/B light editor scrollbar values from a previously selected item persist when selecting a new item
  • UI.memory entries for scrollbar windows are only initialized once (on first render), so the scroll position and condition carry over between item changes
  • Resets scroll and condition for R, G, B memory keys when a new item is selected in the designer

Root Cause

In designer.py, when UI.window("R", ...) is called, the memory entry is created only if it doesn't already exist (guarded by KeyError on cls.memory[name]["surface"]). The "scroll" list and "condition" value therefore persist across item selections, causing the color preview to show stale RGB values from the previous item.

Test plan

  • Open the designer, select an item, open the light editor, move the RGB sliders
  • Select a different item and reopen the light editor — sliders should now reset to 0

Fixes #24

🤖 Generated with Claude Code

When selecting a new item in the designer, the R/G/B scrollbar
memory from the previous item was carried over because UI.memory
entries are only initialized once. This resets the scroll position
and condition for R, G, B scrollbars on item change.

Fixes Osman-Kahraman#24

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@Osman-Kahraman Osman-Kahraman left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@muhammadrashid4587- First of all I don't prefer AI-based PR's on the projects. Please add your own sentences and thoughts.

I tested your changes and it solves the issue #24. But it completely bypasses last updated version, take a look at this closed #23 PR. I cannot merge with prev version.

Please assign yourself for issue #24. And use the last updated version of the repo. Thank you for your contribution.

self.objectAnims = []
# Reset RGB scrollbar state so stale values from
# the previous item are not carried over.
for _rgb_key in ("R", "G", "B"):

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

heavy AI This is heavily used wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: RGB values persist when switching between items

3 participants