Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keytips: Align keytipData with visible instance for dupes #28522

Merged

Conversation

jspurlin
Copy link
Contributor

@jspurlin jspurlin commented Jul 13, 2023

Previous Behavior

Currently, keytips have the ability to render only for visible instances of target elements, but if there are multiple of the same registration (e.g. keytipData), the first one is always used. This can result in the keytip not being positioned correctly for the instance that's visible. Note, this is related to responsive scaling where the same control can be rendered with the same keytip tree multiple times where only one instance is visible at a time

New Behavior

With this change, the fetching of the keytipData will now return the instance that's associated with the corresponding visible element instance. This makes the keytipData that's used align with how keytips already choose where to be visible (e.g. which element is their target). This new code will only run if there are multiple keytips with the exact same registration (same keytip sequence (e.g. tree and element keytip)) which can happen for responsive scaling.

@jspurlin jspurlin requested a review from khmakoto July 13, 2023 17:00
@jspurlin jspurlin requested review from a team as code owners July 13, 2023 17:00
@codesandbox-ci
Copy link

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 1dcaf74:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@fabricteam
Copy link
Collaborator

📊 Bundle size report

🤖 This report was generated against 8d06e6d07e96f556e72b7a597664f14bef933eac

@size-auditor
Copy link

size-auditor bot commented Jul 13, 2023

Asset size changes

Project Bundle Baseline Size New Size Difference
office-ui-fabric-react fluentui-react-KeytipLayer 98.227 kB 98.335 kB ExceedsBaseline     108 bytes
office-ui-fabric-react fluentui-react-Keytips 100.981 kB 101.087 kB ExceedsBaseline     106 bytes
office-ui-fabric-react fluentui-react-northstar-Debug 10.621 kB  Deleted       BelowBaseline     -10.621 kB
office-ui-fabric-react fluentui-react-northstar-Design 36.723 kB  Deleted       BelowBaseline     -36.723 kB
office-ui-fabric-react fluentui-react-northstar-SvgIcon 37.687 kB  Deleted       BelowBaseline     -37.687 kB
office-ui-fabric-react fluentui-react-northstar-Flex 48.871 kB  Deleted       BelowBaseline     -48.871 kB
office-ui-fabric-react fluentui-react-northstar-Animation 56.773 kB  Deleted       BelowBaseline     -56.773 kB
office-ui-fabric-react fluentui-react-northstar-Portal 59.811 kB  Deleted       BelowBaseline     -59.811 kB
office-ui-fabric-react fluentui-react-northstar-Grid 72.891 kB  Deleted       BelowBaseline     -72.891 kB
office-ui-fabric-react fluentui-react-northstar-Image 76.159 kB  Deleted       BelowBaseline     -76.159 kB
office-ui-fabric-react fluentui-react-northstar-Text 76.755 kB  Deleted       BelowBaseline     -76.755 kB
office-ui-fabric-react fluentui-react-northstar-TextArea 76.883 kB  Deleted       BelowBaseline     -76.883 kB
office-ui-fabric-react fluentui-react-northstar-Header 77.448 kB  Deleted       BelowBaseline     -77.448 kB
office-ui-fabric-react fluentui-react-northstar-Box 77.974 kB  Deleted       BelowBaseline     -77.974 kB
office-ui-fabric-react fluentui-react-northstar-Layout 78.055 kB  Deleted       BelowBaseline     -78.055 kB
office-ui-fabric-react fluentui-react-northstar-Video 78.187 kB  Deleted       BelowBaseline     -78.187 kB
office-ui-fabric-react fluentui-react-northstar-Segment 78.983 kB  Deleted       BelowBaseline     -78.983 kB
office-ui-fabric-react fluentui-react-northstar-Status 79.184 kB  Deleted       BelowBaseline     -79.184 kB
office-ui-fabric-react fluentui-react-northstar-Divider 79.414 kB  Deleted       BelowBaseline     -79.414 kB
office-ui-fabric-react fluentui-react-northstar-Reaction 80.16 kB  Deleted       BelowBaseline     -80.16 kB
office-ui-fabric-react fluentui-react-northstar-Skeleton 80.46 kB  Deleted       BelowBaseline     -80.46 kB
office-ui-fabric-react fluentui-react-northstar-Label 80.804 kB  Deleted       BelowBaseline     -80.804 kB
office-ui-fabric-react fluentui-react-northstar-ItemLayout 80.989 kB  Deleted       BelowBaseline     -80.989 kB
office-ui-fabric-react fluentui-react-northstar-Loader 81.579 kB  Deleted       BelowBaseline     -81.579 kB
office-ui-fabric-react fluentui-react-northstar-Breadcrumb 82.964 kB  Deleted       BelowBaseline     -82.964 kB
office-ui-fabric-react fluentui-react-northstar-Checkbox 83.063 kB  Deleted       BelowBaseline     -83.063 kB
office-ui-fabric-react fluentui-react-northstar-Avatar 83.329 kB  Deleted       BelowBaseline     -83.329 kB
office-ui-fabric-react fluentui-react-northstar-Table 84.172 kB  Deleted       BelowBaseline     -84.172 kB
office-ui-fabric-react fluentui-react-northstar-Embed 84.77 kB  Deleted       BelowBaseline     -84.77 kB
office-ui-fabric-react fluentui-react-northstar-Card 85.931 kB  Deleted       BelowBaseline     -85.931 kB
office-ui-fabric-react fluentui-react-northstar-Button 86.433 kB  Deleted       BelowBaseline     -86.433 kB
office-ui-fabric-react fluentui-react-northstar-RadioGroup 86.755 kB  Deleted       BelowBaseline     -86.755 kB
office-ui-fabric-react fluentui-react-northstar-Pill 86.879 kB  Deleted       BelowBaseline     -86.879 kB
office-ui-fabric-react fluentui-react-northstar-Slider 87.909 kB  Deleted       BelowBaseline     -87.909 kB
office-ui-fabric-react fluentui-react-northstar-Accordion 89.075 kB  Deleted       BelowBaseline     -89.075 kB
office-ui-fabric-react fluentui-react-northstar-Attachment 90.341 kB  Deleted       BelowBaseline     -90.341 kB
office-ui-fabric-react fluentui-react-northstar-Alert 91.103 kB  Deleted       BelowBaseline     -91.103 kB
office-ui-fabric-react fluentui-react-northstar-Tree 91.442 kB  Deleted       BelowBaseline     -91.442 kB
office-ui-fabric-react fluentui-react-northstar-Input 91.733 kB  Deleted       BelowBaseline     -91.733 kB
office-ui-fabric-react fluentui-react-northstar-List 92.24 kB  Deleted       BelowBaseline     -92.24 kB
office-ui-fabric-react fluentui-react-northstar-Provider 94.914 kB  Deleted       BelowBaseline     -94.914 kB
office-ui-fabric-react fluentui-react-northstar-Form 96.154 kB  Deleted       BelowBaseline     -96.154 kB
office-ui-fabric-react fluentui-react-northstar-Carousel 109.432 kB  Deleted       BelowBaseline     -109.432 kB
office-ui-fabric-react fluentui-react-northstar-Tooltip 112.1 kB  Deleted       BelowBaseline     -112.1 kB
office-ui-fabric-react fluentui-react-northstar-Dialog 117.057 kB  Deleted       BelowBaseline     -117.057 kB
office-ui-fabric-react fluentui-react-northstar-Menu 132.497 kB  Deleted       BelowBaseline     -132.497 kB
office-ui-fabric-react fluentui-react-northstar-Popup 138.468 kB  Deleted       BelowBaseline     -138.468 kB
office-ui-fabric-react fluentui-react-northstar-Chat 159.446 kB  Deleted       BelowBaseline     -159.446 kB
office-ui-fabric-react fluentui-react-northstar-MenuButton 168.377 kB  Deleted       BelowBaseline     -168.377 kB
office-ui-fabric-react fluentui-react-northstar-Toolbar 180.854 kB  Deleted       BelowBaseline     -180.854 kB
office-ui-fabric-react fluentui-react-northstar-SplitButton 184.697 kB  Deleted       BelowBaseline     -184.697 kB
office-ui-fabric-react fluentui-react-northstar-Datepicker 193.768 kB  Deleted       BelowBaseline     -193.768 kB
office-ui-fabric-react fluentui-react-northstar-Dropdown 203.774 kB  Deleted       BelowBaseline     -203.774 kB

ExceedsTolerance Over Tolerance (1024 B) ExceedsBaseline Over Baseline BelowBaseline Below Baseline New New Deleted  Removed 1 kB = 1000 B

Baseline commit: 8d06e6d07e96f556e72b7a597664f14bef933eac (build)

@fabricteam
Copy link
Collaborator

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
BaseButton mount 615 623 5000
Breadcrumb mount 1659 1648 1000
Checkbox mount 1684 1669 5000
CheckboxBase mount 1459 1473 5000
ChoiceGroup mount 2950 2973 5000
ComboBox mount 665 641 1000
CommandBar mount 6151 6178 1000
ContextualMenu mount 11595 11758 1000
DefaultButton mount 744 754 5000
DetailsRow mount 2186 2172 5000
DetailsRowFast mount 2137 2219 5000
DetailsRowNoStyles mount 1983 2019 5000
Dialog mount 2597 2786 1000
DocumentCardTitle mount 227 210 1000
Dropdown mount 1982 1965 5000
FocusTrapZone mount 1109 1098 5000
FocusZone mount 1049 1056 5000
GroupedList mount 36896 41375 2
GroupedList virtual-rerender 19625 19668 2
GroupedList virtual-rerender-with-unmount 50021 50060 2
GroupedListV2 mount 228 221 2
GroupedListV2 virtual-rerender 210 208 2
GroupedListV2 virtual-rerender-with-unmount 220 228 2
IconButton mount 1096 1090 5000
Label mount 322 322 5000
Layer mount 2707 2723 5000
Link mount 395 390 5000
MenuButton mount 912 922 5000
MessageBar mount 21229 21197 5000
Nav mount 1899 1909 1000
OverflowSet mount 780 788 5000
Panel mount 1791 1750 1000
Persona mount 715 753 1000
Pivot mount 860 868 1000
PrimaryButton mount 830 834 5000
Rating mount 4603 4565 5000
SearchBox mount 917 922 5000
Shimmer mount 1845 1896 5000
Slider mount 1307 1317 5000
SpinButton mount 2862 2834 5000
Spinner mount 388 385 5000
SplitButton mount 1829 1818 5000
Stack mount 400 401 5000
StackWithIntrinsicChildren mount 849 867 5000
StackWithTextChildren mount 2648 2663 5000
SwatchColorPicker mount 6067 6030 5000
TagPicker mount 1442 1444 5000
Text mount 370 368 5000
TextField mount 908 916 5000
ThemeProvider mount 838 827 5000
ThemeProvider virtual-rerender 587 589 5000
ThemeProvider virtual-rerender-with-unmount 1288 1258 5000
Toggle mount 610 600 5000
buttonNative mount 193 197 5000

@khmakoto khmakoto merged commit bbba728 into microsoft:master Jul 17, 2023
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Jul 18, 2023
* master:
  ci(bundlesize): opt out using --since as lightrail doesnt support this behaviour and needs everything build on every PR (microsoft#28545)
  feat: automatically add v9 package stories to public docsite and correctly create codesandbox demo source code (microsoft#28528)
  applying package updates
  Keytips: Align keytipData with visible instance for dupes (microsoft#28522)
  applying package updates
  V8 Fluent2 Theme: Spinner sizes (microsoft#28512)
  feat: add extra-tiny size value to size prop (microsoft#28249)
  feat(react-infobutton): Remove InfoIcon from react-infobutton (microsoft#28534)
  Made Breadcrumb package public (microsoft#28549)
  X bars showing incorrect data when the values are large- bug 8380 (microsoft#28510)
  feat(tools): implement `prepare-initial-release` generator (microsoft#28505)
  feat: release react-breadcrumb to preview (microsoft#28402)
  applying package updates
  fix: v8 SplitButton and split MenuItem have two touch targets when checkable (microsoft#28523)
  fix(react-infobutton): Apply aria-owns only when the popover is open and cleanup infobutton stories (microsoft#28463)
  fix: Pivot overflow role uses tab (microsoft#28409)
  Migrate react-search to preview (microsoft#28531)
makopch-ms added a commit to makopch-ms/fluentui that referenced this pull request Aug 24, 2023
khmakoto pushed a commit that referenced this pull request Aug 24, 2023
…28977)

* Revert "Keytips: Align keytipData with visible instance for dupes (#28522)"

This reverts commit bbba728.

* change files
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.

3 participants