Skip to content

Port LineDoubleSlider2D and RangeSlider to v2#1157

Open
JigyasuRajput wants to merge 1 commit intofury-gl:v2from
JigyasuRajput:feat/range-slider-port-1117
Open

Port LineDoubleSlider2D and RangeSlider to v2#1157
JigyasuRajput wants to merge 1 commit intofury-gl:v2from
JigyasuRajput:feat/range-slider-port-1117

Conversation

@JigyasuRajput
Copy link

@JigyasuRajput JigyasuRajput commented Mar 8, 2026

Closes #1117
Closes #1115

Implement LineDoubleSlider2D and RangeSlider following the v2 pygfx-based architecture established by LineSlider2D. Remove legacy commented-out code and add 16 new tests covering both components.
This pull request introduces and tests two new UI slider components, LineDoubleSlider2D and RangeSlider, into the FURY UI module. It adds them to the public API, provides comprehensive unit tests for their initialization, behavior, and integration, and removes old commented-out tests for these components.

New UI Components and Public API Exposure:

  • Added LineDoubleSlider2D and RangeSlider to the __all__ list and import statements in fury/ui/__init__.pyi, making them available as public UI elements. [1] [2]

Comprehensive Unit Tests for New Components:

  • Added extensive tests for LineDoubleSlider2D, covering initialization, value clamping, handle crossing prevention, synchronization between value and ratio, alias property consistency, layout, text formatting, callbacks, visibility propagation, and edge cases.
  • Added tests for RangeSlider, verifying correct initialization, actor aggregation, sizing, visibility propagation, text precision, and scene integration.

Cleanup of Old/Commented Code:

  • Removed or commented out legacy and interactive tests for LineDoubleSlider2D and RangeSlider, as well as related value range tests, to streamline the test suite and avoid redundancy. [1] [2]

Implement LineDoubleSlider2D and RangeSlider following the v2 pygfx-based
architecture established by LineSlider2D. Remove legacy commented-out code
and add 16 new tests covering both components.

Closes fury-gl#1117
@medha-14
Copy link

medha-14 commented Mar 8, 2026

@JigyasuRajput I am currently working on a related issue where I am introducing a Slider2D base class in my PR #1121 that all slider components will inherit from as suggested by @ganimtron-10 . Since this component will also inherit from that base class, I plan to address it once that work is completed. Also, apologies for the delayed response, I completely missed this earlier. Therefore I will create the PR on this issue when #1121 is completed thanks!

@JigyasuRajput
Copy link
Author

Hey @medha-14, thanks for the heads up! I see that your PR #1121 introduces a Slider2D base class
that LineSlider2D and RingSlider2D inherit from.

Since I've already done a fair amount of work on this PR (porting both LineDoubleSlider2D and
RangeSlider with full tests), I'd like to keep this moving forward. Once your PR is merged, I'll
rebase and refactor LineDoubleSlider2D to inherit from the Slider2D base class so everything stays
consistent.

@medha-14
Copy link

medha-14 commented Mar 8, 2026

Hi @JigyasuRajput, I had already made those changes locally a while ago as I was waiting for #1121 to get merged first. However, since you have opened this PR, it's fine. But please confirm beforehand before opening a PR, as it can lead to duplicate work and waste both of our time. Thanks :)

@JigyasuRajput
Copy link
Author

Hi @medha-14, thanks for the clarification.

Apologies for the noise here. When I checked the issue earlier, I didn’t see any recent activity or comments indicating that someone was actively working on it (issue 1117), so I went ahead and started implementing it. While working on #1117 I realized that #1115 was a prerequisite, which is why I included it in this PR as well.

Since I had already completed a substantial portion of the implementation (including tests), I thought it would be useful to open the PR and iterate from there. I’m happy to rebase or adapt the implementation once #1121 is merged so that it aligns with the new Slider2D base class.

If you'd prefer a different approach or collaboration on this, I’m open to that as well. Thanks!

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.

Port RangeSlider Component to v2 Port LineDoubleSlider2D Component to v2

2 participants