Skip to content

Migrate Slider#4986

Draft
denieler wants to merge 5 commits into
masterfrom
bill-migrate-slider
Draft

Migrate Slider#4986
denieler wants to merge 5 commits into
masterfrom
bill-migrate-slider

Conversation

@denieler

@denieler denieler commented May 29, 2026

Copy link
Copy Markdown
Collaborator

[FX-NNNN]

Description

Describe the changes and motivations for the pull request.

How to test

  • Temploy
  • FIXME: Add the steps describing how to verify your changes

Screenshots

Before. After.
Insert screenshots or screen recordings Insert screenshots or screen recordings

Development checks

  • Add changeset according to guidelines (if needed)
  • Double check if picasso-tailwind-merge requires major update (check its README.md)
  • Read CONTRIBUTING.md and Component API principles
  • Make sure that additions and changes on the design follow Toptal's BASE design, and it's been already discussed with designers at #-base-core
  • Annotate all props in component with documentation
  • Create examples for component
  • Ensure that deployed demo has expected results and good examples
  • Ensure the changed/created components have not caused accessibility issues. How to use accessibility plugin in storybook.
  • Self reviewed
  • Covered with tests (visual tests included)

Breaking change

  • codemod is created and showcased in the changeset
  • test alpha package of Picasso in StaffPortal

All development checks should be done and set checked to pass the
GitHub Bot: TODOLess action

Alpha packages

Manually trigger the publish.yml workflow to publish alpha packages. Specify pull request number as a parameter (only digits, e.g. 123).

PR Review Guidelines

When to approve? ✅

You are OK with merging this PR and

  1. You have no extra requests.
  2. You have optional requests.
    1. Add nit: to your comment. (ex. nit: I'd rename this variable from makeCircle to getCircle)

When to request changes? ❌

You are not OK with merging this PR because

  1. Something is broken after the changes.
  2. Acceptance criteria is not reached.
  3. Code is dirty.

When to comment (neither ✅ nor ❌)

You want your comments to be addressed before merging this PR in cases like:

  1. There are leftovers like unnecessary logs, comments, etc.
  2. You have an opinionated comment regarding the code that requires a discussion.
  3. You have questions.

How to handle the comments?

  1. An owner of a comment is the only one who can resolve it.
  2. An owner of a comment must resolve it when it's addressed.
  3. A PR owner must reply with ✅ when a comment is addressed.

@changeset-bot

changeset-bot Bot commented May 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 54fb5a2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Preview

🚀 Your Storybook preview is ready: View Storybook

📍 Preview URL: https://toptal.github.io/picasso/prs/4986/

This preview is updated automatically when you push changes to this PR.

github-actions Bot added a commit that referenced this pull request May 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Preview

🚀 Your Storybook preview is ready: View Storybook

📍 Preview URL: https://toptal.github.io/picasso/prs/4986/

This preview is updated automatically when you push changes to this PR.

github-actions Bot added a commit that referenced this pull request May 29, 2026
@denieler denieler force-pushed the bill-migrate-slider branch from efb842a to c7a2fff Compare May 29, 2026 19:39
@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Preview

🚀 Your Storybook preview is ready: View Storybook

📍 Preview URL: https://toptal.github.io/picasso/prs/4986/

This preview is updated automatically when you push changes to this PR.

github-actions Bot added a commit that referenced this pull request May 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Picasso design patterns check failed

Rule Status
1 — Optimize defaults for the common case
2 — Reuse prop names across components
3 — Keep prop names short and simple
4 — Mirror native HTML prop names
5 — Style overrides only via className or style
6 — Prefer children over content props
7 — Use rem for all sizes railStyle uses top: '6px'; thumbStyle uses top: '-7px' and marginLeft: '-6px' — px not rem
10 — Extend BaseProps
14 — No is prefix on boolean props isOverlaped in exported SliderValueLabelProps uses the is prefix

@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Preview

🚀 Your Storybook preview is ready: View Storybook

📍 Preview URL: https://toptal.github.io/picasso/prs/4986/

This preview is updated automatically when you push changes to this PR.

github-actions Bot added a commit that referenced this pull request May 29, 2026

@vedrani vedrani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There are also good things in this PR: alpha trick, solving position, better BASE UI structure, no owner state.

I plan to update my PR based on it and also address data-state and uncontrolled I commented here.

This PR needs to address design fixes regarding color and thumb and mark size.


// We mirror the value internally so that marks and value labels can reflect
// the live value even when the component is used in an uncontrolled way.
const [uncontrolledValue, setUncontrolledValue] = useState<number | number[]>(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's mirroring state. I understand it's because of uncontrolled way.

Btw did we supported uncontrolled way before migration?

I suggest we use BASE ui state as single point of truth.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@vedrani I don't think we changed how component behaves, we keep the exactly the same Props 🤷‍♂️

const containerRef = useRef<HTMLDivElement>(null)
const sliderRef = useCombinedRefs<HTMLElement>(ref, useRef<HTMLElement>(null))

const setRootRef = useCallback(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why not useCombinedRefs, it's not following convention.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@vedrani does it do the same what useCombinedRefs do? I don't think so 🤔

{marksData.map(mark => (
<SliderMark
key={mark.value}
data-index={mark.value}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think it should be mark index, not value.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

agree, but to me seems like "nit", we even didn't have that before 😃

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants