Commit Graph

367 Commits

Author SHA1 Message Date
David Langley c33a159334 Fix: Focusing a room in the room list(without hovering) doesn't allow tabbing to the more menu (#34043)
* Fix more menu focus issue when focused with no hover.

* Use a js based solution for focus

* Return focus to the menu trigger when closing the menu with Escape

Keep the keyboard-focus marker set while a row/section-header menu is open
(focus is then in the portaled popover, outside the element). This keeps the
trigger revealed so the menu's own focus restoration lands on it when closed
with Escape, instead of dropping to <body>.

* test: cover keyboard-focus reveal of the room list hover menus

Adds unit tests that focus a room row / section header via the keyboard
(:focus-visible on mount) and assert the hover menu is revealed, then cleared
when focus leaves. Brings diff coverage of the focus handlers to 100%.
2026-06-30 11:36:57 +00:00
Will Hunt 5374ae2b53 Fix ToastContext test flake (#34045)
* Fix ToastContext test flake

* remove import
2026-06-30 09:59:50 +00:00
David Langley 84c0d2c479 Sticky Header for Room List Sections (#33968)
* Add a pinned sticky group header to GroupedVirtualizedList

Section-header rows pin natively with `position: sticky`, applied via a
`components.Item` wrapper that detects header entries. Consecutive stuck
headers stack in DOM order, giving compositor-driven cover/reveal: the
incoming header covers the current one on scroll-down and slides off to
reveal the previous on scroll-up.

Because the flat virtualizer unmounts off-screen rows, a sticky header
row vanishes once a tall section scrolls past the overscan window. An
always-mounted overlay outside the item stream backstops this, keeping
the current section's header pinned; a mounted real header row sits over
it for an invisible hand-off. The current section is tracked from the
rendered items' offsets and live scrollTop on Virtuoso's onScroll.

`scrollPaddingTop` on the useVirtualizedList hook lands keyboard-focused
items below the pinned header via Virtuoso's calculateViewLocation.

Signed-off-by: David Langley <langley.dave@gmail.com>

* Show a sticky section header in the room list

VirtualizedRoomListView renders the current section's header into the
pinned overlay via RoomListStickySectionHeaderView, which reuses
RoomListSectionHeaderContent so the chevron, title, notification badge
and section menu stay identical to the real header. The overlay is
mouse-interactive but `aria-hidden` and out of the tab order; the real
header rows keep all keyboard, screen-reader and drag-and-drop duties.

Headers use a uniform 44px height so a covering header fully covers the
one behind it, and an opaque background so stacked stuck headers don't
show through each other. Snapshot regenerated.

Signed-off-by: David Langley <langley.dave@gmail.com>

* Stop enforcing 44px height

* Clarify sticky-header z-index layering

Only the relative order of the room-list sticky stack matters (room rows <
overlay backstop < real sticky header rows), so use 1/2 instead of 10/11 and
spell out the ordering in comments. Explain why the overlay's opaque fill needs
z-index: -1 (absolutely-positioned, so it would otherwise paint over the header
content). No behavioural change.

---------

Signed-off-by: David Langley <langley.dave@gmail.com>
2026-06-29 19:28:50 +00:00
Will Hunt 0ddc418cf9 Move ToastContext and utilities to shared components (#33949)
* Move ToastContext and utilities to shared components

* lint

* fix type

* cleanup

* fix broken test

* fix lint

* Add more tests for ToastContext

* Potential fix for pull request finding 'Unused variable, import, function or class'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-06-29 18:50:36 +00:00
Will Hunt 6ce24e2668 Improve link preview look and feel (#33981)
* Update link previews to match design

* Preview updates

* snap update for pw

* Retain tall image snap

* Move icon to the right.

* cleanup

* Fix bubbles

* resnappening
2026-06-29 18:50:20 +00:00
Florian Duros aed2009b9f Room list: move sections out of labs to all the users (#33810)
* feat: remove section labs flag

* test: update tests

* feat: remove favourites and low prioriy filter in SC

* test: update screenshots

* test: update snapshots

* test: update playwright tests

* test: update playright screenshots

* test: update screenshot

* test: close release announcement

* test: fix skeleton screenshot

* test: fix sliding sync

* test: update room list tests

* test: update room list tests after section dnd

* test: update toast screenshot

* test: update again room list tests

* test: update screenshot
2026-06-29 16:30:27 +00:00
renovate[bot] b2bed9a473 Update npm non-major dependencies (#33944)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-06-29 14:41:41 +00:00
renovate[bot] 4462d6914c Update playwright to v1.61.0 (#33928)
* Update playwright to v1.61.0

* Update snapshots

* Update screenshots

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2026-06-29 10:34:44 +00:00
ElementRobot 52b32adb39 [create-pull-request] automated change (#33971)
Co-authored-by: t3chguy <2403652+t3chguy@users.noreply.github.com>
2026-06-29 09:03:53 +00:00
David Langley a0639bfc4b Add unread toast to room list sections (#33961)
* Forward the scroller element and scroll handle through VirtualizedList

The room list needs two things the generic list did not expose: the underlying
scroll container (to observe which items are genuinely visible) and the imperative
scroll handle (to scroll an item into view). Forward an optional scrollerRef from
useVirtualizedList and pass scrollHandleRef through FlatVirtualizedList, mirroring
what GroupedVirtualizedList already exposes. Both are additive and optional, so other
consumers are unaffected.

Signed-off-by: David Langley <langley.dave@gmail.com>

* Add an unread-activity toast to the room list

Show a clickable "You have unread activity" pill when there are unread rooms
scrolled below the visible fold, including unreads hidden inside collapsed sections
whose header is below the fold. Clicking it scrolls the next such unread into view.

The visible fold is tracked with an IntersectionObserver over the rendered item
elements, so the toast appears as soon as a room crosses the fold rather than only
once it leaves Virtuoso's overscan buffer. The toast click is wired through an
imperative scroll handle the view registers with the view model.

Signed-off-by: David Langley <langley.dave@gmail.com>

* Change toast to target notifications only, not unread activity.

* Fix formatting and refresh Toast snapshots for compound-web 9.7.0

- Apply oxfmt to the room list view model and virtualized view.
- Refresh the RoomListToast/RoomListView story snapshots: compound-web
  9.7.0 moves the typography classes onto the toast .content element and
  rebuilds the Toast CSS module hashes.
- Add the missing UnreadActivityToast render snapshot baseline.

* Add e2e tests for the room list unread activity toast

Cover the unread-activity toast end to end:
- it appears for a notifying room scrolled below the fold and clicking it
  scrolls that room into view (then the toast clears);
- a room with only an unread-activity dot (no notification count) does not
  raise it;
- a collapsed section hiding a notifying room raises it, and clicking
  scrolls the section header into view.

* Add visual snapshot baselines for the unread-activity toast stories

* Converge room-list toast codepaths into a single state-driven toast

Reviewer feedback: the unread-activity toast and the transient event toasts
(section_created / chat_moved) should share one mechanism, with toast
lifecycle and precedence owned by the view model rather than split across a
separate snapshot flag and a view-level ternary.

- RoomListViewModel now reconciles the transient event toast and the derived
  unread-activity state into a single snapshot.toast via recomputeToast(); the
  event toast still takes precedence and auto-dismisses, and the unread toast
  reappears once it clears. Drops hasUnreadActivityBelow from the snapshot.
- RoomListView renders a single RoomListToast driven by snapshot.toast; the
  ToastType union gains 'unread_activity'. The standalone UnreadActivityToast
  component is folded into RoomListToast (clickable arrow-down variant).
- Adds VM tests for the unread-activity toast and the event/unread precedence.

* Pre-bundle the room-list dnd-kit + virtuoso graph in vitest browser mode

The room-list suites (RoomListView, VirtualizedRoomListView,
RoomListItemMoreOptionsMenu) import a heavy @dnd-kit + react-virtuoso graph.
Only @dnd-kit/abstract was pinned in optimizeDeps.include; @dnd-kit/dom,
@dnd-kit/react, @dnd-kit/abstract/modifiers and react-virtuoso were left to
runtime discovery. Under CI load the browser-mode dep optimizer can discover
them late, re-bundle and reload the page, which fails the in-flight
setupTests.ts import for those suites. Pinning the whole graph forces it into
the initial optimize pass so no re-run happens while tests load.

---------

Signed-off-by: David Langley <langley.dave@gmail.com>
2026-06-29 08:55:26 +00:00
David Langley ed768f69e1 Fix ImageReplyBodyView test flake (#33974)
* Fix aspect ratio in ImageReplyBodyView story

* De-flake blurhash story via per-story failureThreshold

Revert the aspectRatio change (it produced byte-identical blurhash output,
so it did not address the flake, and only churned the with-banner baseline)
and instead allow a small per-story failureThreshold on LoadingWithBlurhash.
The blurhash <canvas> rasterizes to one of two ~33px-apart variants per run;
this tolerates that benign jitter while keeping the strict 3px elsewhere.
2026-06-26 14:09:53 +00:00
David Langley c4b12cbb4c Update to compound-web 9.7.0 (#33967)
* Update to compound-web 9.7.0

* Update snapshots for compound-web 9.7.0 toast markup

The 9.7.0 Toast moves typography classes from .toast-container to .content
and rebuilds CSS-module hashes, so the RoomListToast unit snapshots, the
storybook visual baselines, and the room-list e2e screenshots needed
regenerating.

* Update blurhash screenshot

* Revert "Update blurhash screenshot"

This reverts commit 6eacecc1ed.
2026-06-26 11:00:33 +00:00
Florian Duros 1f83ba4bbb Room list: add drag and drop of sections to reorder them (#33606)
* feat(rls): centralize room-list section ordering via getOrderedSections

Introduce a single source of truth for the ordered list of section
tags (defaults + custom) in section.ts. RoomListStoreV3 no longer
hard-codes the default tag order — it asks section.ts.

* feat(vm): add section reorder logic to RoomListStoreV3 and view model

* refactor(sc): extract RoomListSectionHeaderContent from RoomListSectionHeaderView

* feat(sc): add drag-and-drop reordering for room-list sections

* test(sc): update existing tests

* test: add new tests

* test(sc): add snapshot test for overlay

* test(e2e): add playright test for dnd of sections

* feat: tweak opacity

* fix: section detection when dragged

* feat: use relative position in section order

* chore: move style to room list section header view

* test: add e2e test for moving section before another

* feat: make favourite and low priority no draggable

* test: remove deprecated e2e test

* fix: type correctly dnd provider and hooks

* fix: use String instead of casting to string

* fix: wrong a11y attributes on section header

* test: fix keyboard navigation e2e tests

* feat: use custom a11y announcement for dnd

* fix: add aria-hidden to the overlay

* chore: remove duplicated code in a11Y announcement

* fix: increase keyboard drag offset

* fix: tests

* fix: virtuoso computed item key

* fix: aria-expanded double annoncement why dragging

* fix: re-add screen reader instructions

* chore: remove unused import

* fix: reduce keyboard drag offset

* fix: improve text readback on unread section

* feat: use a custom a11y plugin instead of buitin a11y plugin

* chore: formatting

* test: fix incorrect tests

* chore: use randomUUID

* fix: try to make test working

* fix: put back mock

* fix: circular import

* Revert "fix: circular import"

This reverts commit 6c69313ade.

* chore: add @dnd-kit/abstract to optimizeDeps.include

* test: fix e2e tests

* fix: disable interaction with section when dragging

* fix: be more explicit if the section will be dropped before or after

* fix: add info that space is dropping too

* fix: scroll to dropped section

* test: fix virtualized room list test

* chore: update lang

* chore: fix dead code analyze

* test: add provider section story

* fix: lang

* fix: again lang...

* fix: improve voice over on chrome

* test: upate snapshot

* fix: add readback when a section is over a non droppable element
2026-06-26 10:00:44 +00:00
ElementRobot 29b9c04d20 [create-pull-request] automated change (#33952)
Co-authored-by: t3chguy <2403652+t3chguy@users.noreply.github.com>
2026-06-24 07:46:07 +00:00
renovate[bot] 92076e00fb Update nx (major) (#33931)
* Update nx

* Fix nx config

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2026-06-23 10:03:31 +00:00
Will Hunt 2570c3367e Bump @element-hq/web-shared-components to 0.1.1 (#33933) 2026-06-22 13:31:10 +00:00
renovate[bot] 02ab1943a1 Update dependency temporal-polyfill to v1 (#33930)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-06-22 10:04:41 +00:00
ElementRobot 19d2161bce [create-pull-request] automated change (#33905)
Co-authored-by: t3chguy <2403652+t3chguy@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2026-06-22 08:04:53 +00:00
Will Hunt 171164f324 @element-hq/web-shared-components@i.1.0 (#33910) 2026-06-19 14:22:09 +00:00
Florian Duros 338c18df16 Room list: add release announcement for sections (#33800)
* feat: add release announcement for sections

* test: update screenshot

* test: update tests

* test: add release annoucement utils to close it

* test: close release announcement in custom section tests

* test: update release announcement e2e test

* test: add more tests

* feat: update Ra labels

* test: update screenshot

* chore: remove stale screenshot
2026-06-19 12:06:58 +00:00
David Baker 43b9bc9458 Fix long display / user names in UserMenu (#33900)
* Fix long display / user names in UserMenu

And add a playwright test to assert (see playwright screenshot for
after photo).

* Dave installs the oxfmt extension

* snapshots
2026-06-19 11:14:57 +00:00
R Midhun Suresh 0980ef0284 Make the separator container smaller (#33869)
Currently the scrollbar is broken
2026-06-17 12:04:20 +00:00
Michael Telatynski 90f4ae0b7a Make shared-components vitest happier (#33863)
* Make shared-components vitest happier

Silence logs about legacy JSX transform

* Fix typedoc warning
2026-06-17 09:23:16 +00:00
ElementRobot ecbab6d137 [create-pull-request] automated change (#33882)
Co-authored-by: t3chguy <2403652+t3chguy@users.noreply.github.com>
2026-06-17 09:02:55 +00:00
renovate[bot] d3085e06e9 Update dnd-kit to ^0.5.0 (#33885)
* Update dnd-kit to ^0.5.0

* Remove patch

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2026-06-17 09:07:21 +00:00
Michael Telatynski eca2f39dbb Switch from prettier to oxfmt (#33844)
* Switch from prettier to oxfmt

* Make knip happy

* Make knip happy

* Apply suggestion from @t3chguy

* Rename .oxfmtrc.json to .oxfmtrc.jsonc

* Make oxfmt happier
2026-06-16 12:17:18 +00:00
David Baker 3ab233940c User status in user menu (#33797)
* Add user status on user profile icon

Currently unstyled & no tests

* Style the user status icon

* Update snapshot

for avatar wrapper

* More snapshot updates

* add if braces

* Split out user status functions

to avoid circular dep which has the weird effect of just breaking
jest's mocking.

* type imports

* Update imports

* Update snapshot

* Tests

* baseline image

* Just snapshot the component itself

* User status in user menu

first pass, unstyled

* fix export

* superstylin'

* snapshots

* Add story & test

* Snapshots

and re-use the repeated rules

* Tests

* Fix jest lcov projectRoot config

* Change tooltip text to just 'clear'

* Add comment & fix console warn

* Remove all options screenshot

as it's not really particularly useful as a preset story

* remove stale screenshot

* fix imports

---------

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2026-06-16 09:01:34 +00:00
Florian Duros 1c8654e394 Room list: add notifications to section headers (#33826)
* feat(sc): add notification decoration to header

* feat(vm): add notification decoration to vm

* test(e2e): add test
2026-06-15 18:05:51 +00:00
Zack 0f0f8c6ba2 Refactor UnreadNotificationBadge to shared MVVM view (#33672)
* Refactor notification badge to shared MVVM view

* Bage icons Images

* Narrow unread notification badge refactor scope

* Align unread badge MVVM pattern

* Reduce unread badge viewmodel duplication

* Document unread badge viewmodel props

* Remove legacy badge classes from shared view

* Update css for knocked door

* Update thread badge e2e selector

* Update read receipt badge e2e selectors
2026-06-15 10:20:27 +00:00
ElementRobot 48af8cad02 [create-pull-request] automated change (#33830)
Co-authored-by: t3chguy <2403652+t3chguy@users.noreply.github.com>
2026-06-12 08:17:35 +00:00
Florian Duros 36a39f7fd6 Room list: fix keyboard navigation on sections (#33809)
* fix: keyboard navigation on sections

* test: add e2e test for keyboard navigation

* fix: add more keyboard navigation

* test: add e2e tests

* chore: remove useless check
2026-06-11 16:14:36 +00:00
rbondesson 8a21fdb127 Move the AutoHideScrollbar to shared components (#33777)
* First version of shared component

* Refactor as a functional component

* Add unit tests and more documentation

* Fix problem where wrappedRef was used by parent before assignment was performed.

* Use the shared component in app/web

* Clean up unused styling

* Added scrollbar-gutters as default styling in shared component

* Make sure the legacy mx_AutoHideScrollbar is set in app/web

* Updated snapshots

* Removing default style, scrollbar-gutter: stable;

* Updated snapshots

* useRef on wrapperRef to avoid loop in rendering

* scrollbar-width does not propagate

* Add AutoHideScrollbar to RoomListView

* Fix Prettier issue

* Updated snapshots

* Updated snapshot after merge

* Fix Sonar issue
2026-06-11 07:08:24 +00:00
Michael Telatynski e9a89d9872 Consolidate vitest CI & coverage (#33808)
* Consolidate modules vitest coverage

* Use vite-common as base for modules vitest config

* Make knip happier

* Fix coverage paths

* Place modules unit tests alongside src

* Switch to defineProject for better type safety

* Consolidate vitest CI & coverage

Kills off vite-common

* Update comment

* Update lockfile

* Fix shared-components vitest config

* Soften eslint config for tests in modules

* Run eslint on modules/playwright dir too

* Make tsc happy
2026-06-10 16:00:34 +00:00
Michael Telatynski 50035ce07e Merge pull request #33776 from element-hq/t3chguy/merge-modules
Absorb element-modules into monorepo
2026-06-10 10:10:03 +00:00
t3chguy f5ba03da4b [create-pull-request] automated change 2026-06-10 07:44:21 +00:00
Michael Telatynski eaccc01687 Merge branch 'develop' of ssh://github.com/element-hq/element-web into t3chguy/merge-modules
# Conflicts:
#	pnpm-lock.yaml
#	pnpm-workspace.yaml
2026-06-09 12:39:57 +01:00
renovate[bot] fa0b88ca9f Update vite (#33757)
* Update vite

* Update vite

* Bump @vitest/browser-playwright to match rest of vitest deps

* Regenerate pnpm-lock.yaml

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2026-06-09 11:11:01 +00:00
Florian Duros 5fa2da2a91 Room list: improve section in room list context menu (#33733)
* fix: hide section separator in context menu when there is no section

* fix: truncate long section name

* feat: add remove from section entry to room list item context menu

* test: update tests and stories

* test: add new test

* test: use same mocks

* test: add e2e test for "Remove from section"
2026-06-09 10:11:02 +00:00
Florian Duros c99590dcb1 Room list: remove checkmark in section toast (#33779)
* feat: remove checkmark in section toast

* test: update playwright screenshots

* chore: add figma link to room list toast sory
2026-06-08 15:39:17 +00:00
Florian Duros 1f6319b651 Room list: add fade effect to room list item being dragged (#33696)
* feat: tweak opacity of dragged room in room list

* feat: put test as primary when room item is dragged

* test: update screenshots
2026-06-08 15:35:08 +00:00
Michael Telatynski 4825a5a4a4 Tidy deps 2026-06-08 10:33:09 +01:00
David Baker 5ab5fa1e04 Limit width of the display name in user menu (#33746)
* Limit width of the display name in user menu

Fixes https://github.com/element-hq/element-web/issues/33726

* Change js-sdk moduleNameMapper to apps/web (#33734)

Turns out the pnpm link has to be set to apps/web to actually work, so update the moduleNameMapper to look there too.

* update screenshots

* Update snapshot

* Update other snapshots

* Snapshot

* More snapshots
2026-06-05 09:49:28 +00:00
ElementRobot 1b81b04ab9 [create-pull-request] automated change (#33755)
Co-authored-by: t3chguy <2403652+t3chguy@users.noreply.github.com>
2026-06-05 08:24:02 +00:00
David Baker bb07f84e41 Add user status on user profile icon (#33653)
* Add user status on user profile icon

Currently unstyled & no tests

* Style the user status icon

* Update snapshot

for avatar wrapper

* More snapshot updates

* add if braces

* Split out user status functions

to avoid circular dep which has the weird effect of just breaking
jest's mocking.

* type imports

* Update imports

* Update snapshot

* Tests

* baseline image

* Just snapshot the component itself

---------

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2026-06-04 15:15:19 +00:00
Florian Duros 96549b1edc Room list: add expand all icon to room list header (#33732)
* feat: add expand all icon to room list header

* test: add screenshot

* test: add snapshot tests
2026-06-03 15:38:24 +00:00
R Midhun Suresh 2c8fafdec4 Implement new separator design (#33599)
* Remove `onFocus` and `onBlur` handlers

react-resizable-panels fixed the issue where focus-visible was not
working as expected, so we no longer need this bit of code.

* Implement new hover/focus separator

* Collapse the panel when clicking on the new focus separator

* Remove `isFocusedViaKeyboard` from snapshot

* Update tests and storybook

* Expand panel only on double click

* Add animation

* Fix tests

* Don't render border when type is bar

* Single click to expand, double click to collapse

* Change focus separator color
2026-06-03 12:29:49 +00:00
ElementRobot 918a2dc738 [create-pull-request] automated change (#33681)
Co-authored-by: t3chguy <2403652+t3chguy@users.noreply.github.com>
2026-06-03 08:19:24 +00:00
Zack 9df1a616a1 Phase 1: Add shared MImageReplyBody view (#33517)
* Add shared image reply body view

* Added storybook screens

* Fix Prettier

* Add image reply body view coverage

* Show image reply banner in visual story

* fix annotation issue with stories

* stop blurhush from reanimating to pass CI image diff
2026-06-03 08:08:21 +00:00
Zack 1c04814c2b Refactor EventPreview to shared MVVM (#33646)
* Refactor EventPreview to shared MVVM

* Fix EventPreviewView export formatting

* Snapshots images for stories

* Deduplicate event preview formatting

* Handle event preview update failures

* Coalesce event preview updates

* Wait for event preview test expectations
2026-06-02 08:36:28 +00:00
Michael Telatynski 35484e5183 Switch to using diff-cover for the Coverage gate (#33673)
* Switch to using diff-cover for the Coverage gate

Enabling developers to check their PR coverage without waiting for CI

* Remove sonar-project.properties - in automatic mode Sonar will not read this file

* Add note to CONTRIBUTING.md

* Skip sonar in MQ
2026-06-01 12:26:03 +00:00