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

feat(ActionList): add Virtualization #2471

Merged
merged 9 commits into from
Jan 15, 2025
Merged

Conversation

saurabhdaware
Copy link
Member

@saurabhdaware saurabhdaware commented Jan 14, 2025

Description

Adds isVirtualized prop to ActionList to virtualize the items

Example: https://codesandbox.io/p/sandbox/trusting-feather-wphnnc?workspaceId=ws_CscdT6KxPm5VEoVzhtZAMq

Changes

Additional Information

Component Checklist

  • Update Component Status Page
  • Perform Manual Testing in Other Browsers
  • Add KitchenSink Story
  • Add Interaction Tests (if applicable)
  • Add changeset

Copy link

changeset-bot bot commented Jan 14, 2025

🦋 Changeset detected

Latest commit: c7b6a69

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@razorpay/blade Minor

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Contributor

github-actions bot commented Jan 14, 2025

✅ PR title follows Conventional Commits specification.

Copy link

codesandbox-ci bot commented Jan 14, 2025

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 c7b6a69:

Sandbox Source
razorpay/blade: basic Configuration

@saurabhdaware saurabhdaware changed the title feat(ActionList): add Virtulization feat(ActionList): add Virtualization Jan 14, 2025
@rzpcibot
Copy link
Collaborator

rzpcibot commented Jan 14, 2025

Bundle Size Report

Updated Components
Status Component Base Size (kb) Current Size (kb) Diff
Accordion, AccordionItemHeader, AccordionItemBody, AccordionItem 8.072 8.092 +0.020 KB
ActionList, ActionListItem, ActionListItemAvatar, ActionListItemBadge, ActionListItemBadgeGroup, ActionListItemIcon, ActionListItemText, ActionListSection 16.586 20.498 +3.912 KB
Alert 11.488 11.508 +0.020 KB
Amount 1.316 1.336 +0.020 KB
AnimateInteractions 0.860 0.885 +0.025 KB
Avatar, AvatarGroup, TrustedBadgeIcon 6.304 6.320 +0.016 KB
Badge 0.865 0.887 +0.022 KB
useBaseMenuItem -0.067 -0.044 +0.023 KB
MotionDiv -0.071 -0.048 +0.023 KB
BladeProvider 1.676 1.701 +0.025 KB
BottomNav, BottomNavItem 1.066 1.092 +0.026 KB
BottomSheet 9.621 9.644 +0.023 KB
Box 0.833 0.858 +0.025 KB
Breadcrumb, BreadcrumbItem 2.616 2.641 +0.025 KB
ButtonGroup 1.246 1.270 +0.024 KB
Card, CardBody, CardHeader, CardHeaderIcon, CardHeaderIconButton, CardHeaderLeading, CardHeaderTrailing, CardFooter, CardFooterLeading, CardFooterTrailing 9.331 9.355 +0.024 KB
Carousel, CarouselItem 7.106 7.131 +0.025 KB
Checkbox 6.335 6.358 +0.023 KB
Chip, ChipGroup 8.454 8.478 +0.024 KB
Collapsible, CollapsibleLink, CollapsibleButton, CollapsibleBody 9.732 9.750 +0.018 KB
Counter 0.820 0.843 +0.023 KB
DatePicker 86.687 86.770 +0.083 KB
Divider 0.523 0.546 +0.023 KB
Drawer, DrawerBody, DrawerHeader, drawerPadding 17.480 17.495 +0.015 KB
Dropdown, DropdownOverlay, DropdownButton, DropdownLink, DropdownFooter, DropdownHeader 28.781 28.801 +0.020 KB
Fade 1.031 1.053 +0.022 KB
FileUpload 17.711 17.732 +0.021 KB
Indicator 1.057 1.081 +0.024 KB
List, ListItem, ListItemLink, ListItemCode, ListItemText 5.198 5.218 +0.020 KB
Menu, MenuItem, MenuOverlay, MenuDivider, MenuFooter, MenuHeader 29.454 29.534 +0.080 KB
Modal 13.236 13.251 +0.015 KB
Morph 0.209 0.234 +0.025 KB
Move 1.066 1.089 +0.023 KB
Popover, PopoverInteractiveWrapper 21.353 21.372 +0.019 KB
ProgressBar 3.023 3.049 +0.026 KB
Radio 5.056 5.081 +0.025 KB
Scale 0.881 0.905 +0.024 KB
SideNav, SideNavLink, SideNavLevel, SideNavSection, SideNavItem, SideNavFooter, SideNavBody, SIDE_NAV_EXPANDED_L1_WIDTH_BASE, SIDE_NAV_EXPANDED_L1_WIDTH_XL 33.353 33.370 +0.017 KB
Skeleton 0.749 0.776 +0.027 KB
Slide 1.239 1.261 +0.022 KB
SpotlightPopoverTour, SpotlightPopoverTourFooter, SpotlightPopoverTourStep 29.742 29.755 +0.013 KB
Stagger 0.907 0.930 +0.023 KB
StepGroup, StepItem, StepItemIcon, StepItemIndicator 6.499 6.527 +0.028 KB
Switch 4.814 4.837 +0.023 KB
Table, TableHeader, TableHeaderCell, TableHeaderRow, TableBody, TableCell, TableRow, TableFooter, TableFooterCell, TableFooterRow, TablePagination, TableToolbar, TableToolbarActions, TableEditableCell, TableEditableDropdownCell 66.809 70.242 +3.433 KB
Tabs, TabItem, TabList, TabPanel 7.270 7.301 +0.031 KB
Tag 3.825 3.849 +0.024 KB
ToastContainer, useToast 12.839 12.854 +0.015 KB
Tooltip, TooltipInteractiveWrapper 15.872 15.888 +0.016 KB
TopNav, TopNavActions, TopNavBrand, TopNavContent 1.299 1.326 +0.027 KB
Button 6.078 6.100 +0.022 KB
IconButton 1.063 1.088 +0.025 KB
CheckboxGroup 5.086 5.106 +0.020 KB
SelectInput, AutoComplete 36.508 36.512 +0.004 KB
OTPInput 30.316 30.322 +0.006 KB
PasswordInput 32.052 32.063 +0.011 KB
PhoneNumberInput 60.823 64.189 +3.366 KB
SearchInput 34.730 34.748 +0.018 KB
TextArea 32.567 32.583 +0.016 KB
TextInput 34.143 34.164 +0.021 KB
Link 2.167 2.191 +0.024 KB
RadioGroup 5.076 5.095 +0.019 KB
Spinner 1.883 1.907 +0.024 KB
TabNav, TabNavItems, TabNavItem 3.044 3.069 +0.025 KB
Code 0.574 0.599 +0.025 KB
Display 0.301 0.326 +0.025 KB
Heading, getHeadingProps 0.299 0.323 +0.024 KB
Text -0.021 0.002 +0.023 KB

Generated by 🚫 dangerJS against c7b6a69

@anuraghazra
Copy link
Member

Screen.Recording.2025-01-14.at.5.21.51.PM.mov

Checkboxes looks a bit flickery when scrolling 🤔 are they rerendering maybe?

packages/blade/package.json Outdated Show resolved Hide resolved

return (
<StyledListBoxWrapper
isInBottomSheet={isInBottomSheet}
Copy link
Member

Choose a reason for hiding this comment

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

Let's try it out with a bottomsheet once in a real device. Ensure there is no weird issues

Comment on lines 139 to 142
{itemCount < 30 ? (
childrenWithId
) : (
<VirtualizedList
Copy link
Member

Choose a reason for hiding this comment

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

🤔 We ignore isVirtuzaliedList prop if itemCount is less than 30?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

Copy link
Member Author

Choose a reason for hiding this comment

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

Reduced it to 10 items

Comment on lines +12 to +14
> [!NOTE]
>
> Current version only supports virtulization of fixed height list where items do not have descriptions. We'll be adding support for dynamic height lists in future versions
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add this in docs as well ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a note in ActionList docs prop table. Will add better note when we write documentation for virtulization

Comment on lines 139 to 142
{itemCount < 30 ? (
childrenWithId
) : (
<VirtualizedList
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we can log an info that if item count is less switching to non virtualized list , might lead to a different experience in dev or prod env. if itemCount is less.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh true good call. Will probably reduce the itemCount number and add a note in docs

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a note in ActionList docs props table. Will add better note when we write docs and tests and virtulization. Currently I have not added any documentation.

Copy link
Member

Choose a reason for hiding this comment

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

might lead to a different experience in dev or prod env. if itemCount is less.

Let's wrap it in DEV flag, otherwise consumers may suddenly get lot of noise in their consoles.

@saurabhdaware
Copy link
Member Author

Screen.Recording.2025-01-14.at.5.21.51.PM.mov
Checkboxes looks a bit flickery when scrolling 🤔 are they rerendering maybe?

They are rerendering (which is expected in virtulization). They shouldn't flicker when they render again though. I have created issue to track #2474. Will fix it separately

@saurabhdaware saurabhdaware merged commit a9e46af into master Jan 15, 2025
12 of 14 checks passed
@saurabhdaware saurabhdaware deleted the actionlist/virtulization branch January 15, 2025 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 Critical Review - L1 First level of review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants