fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

feat(Slider): make thumb position clearer when the value is set near edge

Open Thulof opened this issue 1 year ago • 13 comments

Previous Behavior

348393555-5a55ea88-a2e8-41d6-afcd-d2a957b9ec72

The current issue is, given the slider value range is 0 to 100, when the value is set to 10 or 90, the thumb is positioned very close to the edge of the track, which could look like 0 or 100 to users.

New Behavior

untitled-2024-07-19-0252

With an offset, the Slider thumb is in the proper position.

截屏2024-07-19 03 15 44

Related Issue(s)

https://github.com/microsoft/fluentui/issues/31985

  • Fixes #31985

Thulof avatar Jul 18 '24 18:07 Thulof

@microsoft-github-policy-service agree

Thulof avatar Jul 18 '24 18:07 Thulof

Hi, @micahgodbolt could you please help review this Pull Request? Thank you

Thulof avatar Jul 19 '24 06:07 Thulof

/azp run

dmytrokirpa avatar Aug 08 '24 09:08 dmytrokirpa

Azure Pipelines successfully started running 4 pipeline(s).

azure-pipelines[bot] avatar Aug 08 '24 09:08 azure-pipelines[bot]

📊 Bundle size report

✅ No changes found

fabricteam avatar Aug 08 '24 09:08 fabricteam

Perf Analysis (@fluentui/react-components)

Scenario Render type Master Ticks PR Ticks Iterations Status
FluentProviderWithTheme virtual-rerender 33 40 10 Possible regression
All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 627 641 5000
Button mount 301 308 5000
Field mount 1149 1101 5000
FluentProvider mount 708 697 5000
FluentProviderWithTheme mount 86 90 10
FluentProviderWithTheme virtual-rerender 33 40 10 Possible regression
FluentProviderWithTheme virtual-rerender-with-unmount 87 89 10
MakeStyles mount 873 883 50000
Persona mount 1791 1750 5000
SpinButton mount 1356 1437 5000
SwatchPicker mount 1652 1657 5000

fabricteam avatar Aug 08 '24 09:08 fabricteam

Hi @Thulof, thank you for your contribution! There are a few errors in the CI:

  • Could you please address the formatting issues (prettier) in the packages/react-components/react-slider/library/src/components/Slider/useSliderState.tsx file?
  • Ensure to run the build locally for the react-slider package since it updates the react-slider.api.md. If there are any changes, please commit them as well.

Thank you!

dmytrokirpa avatar Aug 08 '24 09:08 dmytrokirpa

Hi @Thulof, thank you for your contribution! There are a few errors in the CI:

  • Could you please address the formatting issues (prettier) in the packages/react-components/react-slider/library/src/components/Slider/useSliderState.tsx file?
  • Ensure to run the build locally for the react-slider package since it updates the react-slider.api.md. If there are any changes, please commit them as well.

Thank you!

OK

Thulof avatar Aug 08 '24 11:08 Thulof

/azp run

dmytrokirpa avatar Aug 09 '24 12:08 dmytrokirpa

Azure Pipelines successfully started running 4 pipeline(s).

azure-pipelines[bot] avatar Aug 09 '24 12:08 azure-pipelines[bot]

  • The solution proposed in the pull request is not effective for sliders with steps:

https://github.com/user-attachments/assets/d3dae059-5fcc-4177-bd06-cb2e2ab3fb74

  • The design team has provided an update on the positioning of the slider thumb, as detailed in issue #32171: image

@Thulof, please let me know if you are interested in addressing this issue, or I will proceed with it.

Thank you!

dmytrokirpa avatar Aug 09 '24 13:08 dmytrokirpa

  • The solution proposed in the pull request is not effective for sliders with steps:

Screen.Recording.2024-08-09.at.15.02.39.mov

image @Thulof, please let me know if you are interested in addressing this issue, or I will proceed with it.

Thank you!

Yes, I will be working on it.

Thulof avatar Aug 12 '24 08:08 Thulof

Hi @Thulof, thank you for your contribution! There are a few errors in the CI:

  • Could you please address the formatting issues (prettier) in the packages/react-components/react-slider/library/src/components/Slider/useSliderState.tsx file?
  • Ensure to run the build locally for the react-slider package since it updates the react-slider.api.md. If there are any changes, please commit them as well.

Thank you!

While working on these two tasks, I encountered some issues:

  1. I tried running yarn prettier packages/react-components/react-slider/library/src/components/Slider/useSliderState.tsx, but it did not display any errors.
  2. When I attempted to run yarn build within the react-slider directory, I encountered numerous type errors. It seems that my TSConfig is not properly recognizing the workspace. Can you please advise on the correct way to run the build process? Screenshot 2024-08-27 00 15 50

Thulof avatar Aug 26 '24 16:08 Thulof

Hello @Thulof, the commands you might be looking for are yarn nx lint react-slider and yarn nx build react-slider. Based on the screenshot you provided, it appears that the react-slider dependencies weren't built. Simply use the NX commands, and they will pre-build everything necessary for you.

Hi @Thulof, thank you for your contribution! There are a few errors in the CI:

  • Could you please address the formatting issues (prettier) in the packages/react-components/react-slider/library/src/components/Slider/useSliderState.tsx file?
  • Ensure to run the build locally for the react-slider package since it updates the react-slider.api.md. If there are any changes, please commit them as well.

Thank you!

While working on these two tasks, I encountered some issues:

  1. I tried running yarn prettier packages/react-components/react-slider/library/src/components/Slider/useSliderState.tsx, but it did not display any errors.
  2. When I attempted to run yarn build within the react-slider directory, I encountered numerous type errors. It seems that my TSConfig is not properly recognizing the workspace. Can you please advise on the correct way to run the build process?
Screenshot 2024-08-27 00 15 50

dmytrokirpa avatar Aug 30 '24 11:08 dmytrokirpa

Looks like this change was made in #32424, so we can probably close this PR.

dmytrokirpa avatar Jan 20 '25 16:01 dmytrokirpa