Skip to content

(react-slider) - Adding a Tooltip to the thumb#19572

Closed
czearing wants to merge 15 commits intomicrosoft:masterfrom
czearing:feat/slider-tooltip
Closed

(react-slider) - Adding a Tooltip to the thumb#19572
czearing wants to merge 15 commits intomicrosoft:masterfrom
czearing:feat/slider-tooltip

Conversation

@czearing
Copy link
Collaborator

Pull request checklist

Description of changes

  1. Adding an optional Tooltip component around the converged Slider thumb slot that indicates the current value.
  2. Adding snapshot tests
  3. Adding VR tests
  4. Updating spec

API

This change introduces the new prop tooltipVisible .

  /**
   * Whether the tooltip above the Thumb should be displayed.
   * @default `false`
   */
  tooltipVisible?: boolean;

Image

image

Codesandbox

Here is a Codesandbox of the Tooltip change

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 31, 2021

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-slider
Slider
100.636 kB
31.983 kB
62.723 kB
20.004 kB
37.913 kB
11.979 kB

🤖 This report was generated against 7a5cffb431914970c2a12c2cabf72103f60e2a0d

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 31, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4c86363:

Sandbox Source
Fluent UI React Starter Configuration
Slider Tooltip PR

@size-auditor
Copy link

size-auditor bot commented Aug 31, 2021

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 7a5cffb431914970c2a12c2cabf72103f60e2a0d (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 31, 2021

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 974 956 5000
BaseButton mount 1008 984 5000
Breadcrumb mount 2775 2695 1000
ButtonNext mount 491 476 5000
Checkbox mount 1691 1661 5000
CheckboxBase mount 1447 1482 5000
ChoiceGroup mount 5412 5236 5000
ComboBox mount 1080 1069 1000
CommandBar mount 10778 10855 1000
ContextualMenu mount 6623 6555 1000
DefaultButton mount 1263 1221 5000
DetailsRow mount 4077 4058 5000
DetailsRowFast mount 4171 3989 5000
DetailsRowNoStyles mount 3968 4020 5000
Dialog mount 2435 2360 1000
DocumentCardTitle mount 148 147 1000
Dropdown mount 3563 3579 5000
FluentProviderNext mount 7137 7263 5000
FocusTrapZone mount 1932 1851 5000
FocusZone mount 1868 1816 5000
IconButton mount 1901 1885 5000
Label mount 349 345 5000
Layer mount 1887 1887 5000
Link mount 514 497 5000
MakeStyles mount 1850 1824 50000
MenuButton mount 1600 1589 5000
MessageBar mount 2049 2051 5000
Nav mount 3426 3510 1000
OverflowSet mount 1175 1091 5000
Panel mount 2143 2267 1000
Persona mount 844 877 1000
Pivot mount 1435 1514 1000
PrimaryButton mount 1349 1344 5000
Rating mount 8483 8279 5000
SearchBox mount 1431 1457 5000
Shimmer mount 2685 2758 5000
Slider mount 2013 2052 5000
SpinButton mount 5295 5213 5000
Spinner mount 418 461 5000
SplitButton mount 3472 3327 5000
Stack mount 550 527 5000
StackWithIntrinsicChildren mount 1715 1719 5000
StackWithTextChildren mount 5378 5068 5000
SwatchColorPicker mount 10782 10719 5000
Tabs mount 1464 1480 1000
TagPicker mount 2776 2752 5000
TeachingBubble mount 12334 12199 5000
Text mount 449 443 5000
TextField mount 1475 1458 5000
ThemeProvider mount 1210 1261 5000
ThemeProvider virtual-rerender 596 620 5000
Toggle mount 840 829 5000
buttonNative mount 114 114 5000

Perf Analysis (@fluentui/react-northstar)

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
AttachmentMinimalPerf.default 183 168 1.09:1
DividerMinimalPerf.default 423 389 1.09:1
ListNestedPerf.default 654 604 1.08:1
BoxMinimalPerf.default 400 379 1.06:1
ButtonSlotsPerf.default 615 582 1.06:1
AnimationMinimalPerf.default 469 448 1.05:1
InputMinimalPerf.default 1373 1304 1.05:1
CarouselMinimalPerf.default 511 489 1.04:1
GridMinimalPerf.default 385 369 1.04:1
ListMinimalPerf.default 570 546 1.04:1
ListWith60ListItems.default 696 668 1.04:1
MenuButtonMinimalPerf.default 1823 1759 1.04:1
RadioGroupMinimalPerf.default 501 482 1.04:1
TreeWith60ListItems.default 201 194 1.04:1
DropdownMinimalPerf.default 3298 3192 1.03:1
FlexMinimalPerf.default 305 296 1.03:1
HeaderSlotsPerf.default 843 815 1.03:1
LayoutMinimalPerf.default 388 377 1.03:1
PopupMinimalPerf.default 637 616 1.03:1
SegmentMinimalPerf.default 389 376 1.03:1
SkeletonMinimalPerf.default 394 381 1.03:1
TooltipMinimalPerf.default 1122 1092 1.03:1
VideoMinimalPerf.default 705 684 1.03:1
ChatMinimalPerf.default 699 686 1.02:1
DialogMinimalPerf.default 816 799 1.02:1
HeaderMinimalPerf.default 401 395 1.02:1
LoaderMinimalPerf.default 733 721 1.02:1
TextMinimalPerf.default 390 384 1.02:1
AttachmentSlotsPerf.default 1148 1137 1.01:1
LabelMinimalPerf.default 425 419 1.01:1
MenuMinimalPerf.default 939 933 1.01:1
SplitButtonMinimalPerf.default 4496 4432 1.01:1
IconMinimalPerf.default 668 663 1.01:1
EmbedMinimalPerf.default 4437 4442 1:1
ReactionMinimalPerf.default 428 428 1:1
SliderMinimalPerf.default 1684 1679 1:1
StatusMinimalPerf.default 743 742 1:1
TableMinimalPerf.default 434 436 1:1
CheckboxMinimalPerf.default 2830 2846 0.99:1
DropdownManyItemsPerf.default 729 736 0.99:1
ItemLayoutMinimalPerf.default 1337 1347 0.99:1
RosterPerf.default 1292 1308 0.99:1
ProviderMinimalPerf.default 1116 1125 0.99:1
TextAreaMinimalPerf.default 569 577 0.99:1
CustomToolbarPrototype.default 4112 4151 0.99:1
TreeMinimalPerf.default 882 888 0.99:1
ButtonOverridesMissPerf.default 1822 1857 0.98:1
DatepickerMinimalPerf.default 5691 5829 0.98:1
TableManyItemsPerf.default 2117 2150 0.98:1
ChatDuplicateMessagesPerf.default 302 312 0.97:1
ProviderMergeThemesPerf.default 1729 1778 0.97:1
ToolbarMinimalPerf.default 1052 1079 0.97:1
AvatarMinimalPerf.default 202 211 0.96:1
ChatWithPopoverPerf.default 412 428 0.96:1
ListCommonPerf.default 677 703 0.96:1
CardMinimalPerf.default 594 626 0.95:1
ButtonMinimalPerf.default 181 192 0.94:1
ImageMinimalPerf.default 409 434 0.94:1
PortalMinimalPerf.default 176 188 0.94:1
AccordionMinimalPerf.default 154 166 0.93:1
RefMinimalPerf.default 257 280 0.92:1
FormMinimalPerf.default 445 487 0.91:1
AlertMinimalPerf.default 300 336 0.89:1

@ecraig12345
Copy link
Member

Having this built in is going to be a significant bundle size issue--probably the only reason it's not showing up is that I'm guessing the bundle size tests only cover stuff exported from react-components. So you might need to find some other way to do this, like allowing the user to optionally pass in the component.

Copy link
Member

@ecraig12345 ecraig12345 left a comment

Choose a reason for hiding this comment

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

See above. I don't think the bundle size impact of having this built in will be acceptable.

It looks like the new bundle size tool is configured by adding "bundle-size": "bundle-size measure" under scripts in package.json. Can you make a separate PR doing that (to establish a baseline), then once that's checked in we can re-run this PR's build to see the actual impact?

@ecraig12345
Copy link
Member

Oh for bundle size it looks like you'll also need a file like packages/react-avatar/bundle-size/Avatar.fixture.js.

…eat/slider-tooltip

# Conflicts:
#	packages/react-slider/package.json
@czearing czearing mentioned this pull request Sep 23, 2021
40 tasks
@czearing czearing closed this Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants