Room list: add a grouped virtualized list to shared components (#32566)

* refactor: extract most of the logic from the virtualized list

The VirtualizedList component is renamed FlatVirtualizedList and most of
the logic is extracted. In order to prepare the introduction of the
GroupedVirtualizedList which will share most of the behaviour.

* refactor: use `FlatVirtualizedList` instead of `VirtualizedList`

* feat: add grouped virtualized list to shared components

* feat: add accessiblity helps for virtualized list

* test: use one test suite for the two virtualized lists

* test: update storybook screenshots

* feat: add keyboard navigation on header

* test: make a11y test pass

* chore: delete old screenshot

* doc: a11y docs to list stories

* chore: fix copyright
This commit is contained in:
Florian Duros
2026-03-13 09:53:09 +00:00
committed by GitHub
parent 5f92215ead
commit 40a322ac05
17 changed files with 1304 additions and 234 deletions
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
import { Form } from "@vector-im/compound-web";
import React, { type JSX, useCallback } from "react";
import { Flex, type VirtualizedListContext, VirtualizedList } from "@element-hq/web-shared-components";
import { Flex, type VirtualizedListContext, FlatVirtualizedList } from "@element-hq/web-shared-components";
import {
type MemberWithSeparator,
@@ -108,7 +108,7 @@ const MemberListView: React.FC<IProps> = (props: IProps) => {
<Form.Root onSubmit={(e) => e.preventDefault()}>
<MemberListHeaderView vm={vm} />
</Form.Root>
<VirtualizedList
<FlatVirtualizedList
items={vm.members}
getItemComponent={getItemComponent}
getItemKey={getItemKey}