Commit Graph
283 Commits
Author SHA1 Message Date
renovate[bot]GitHubrenovate[bot] <29139614+renovate[bot]@users.noreply.github.com>Michael Telatynski
d88c1a1de8 Update playwright (#34036)
* Update playwright

* Make axe happier with TabbedView accessibility

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2026-06-30 13:12:56 +00:00
Huy HoangandGitHub b430edf43b Pluralise the multi-session remove button and confirmation dialog (#33983)
* Pluralise the multi-session remove button and confirmation dialog

When several sessions are selected in Settings > Sessions, the bulk remove button and its confirmation dialog used the singular "Remove this device" string. The singular "this" misleadingly implied the current device would be removed. Use the existing count-aware settings|sessions|sign_out_n_sessions key, matching the other-sessions menu, so the label reads "Remove N sessions".

Fixes #33812

* Update device-management e2e test for the pluralised remove button

The multi-select remove button now reads "Remove N sessions" instead of "Remove this device", so update the Playwright assertion to match.

* Put "Cancel" before "Remove N sessions" in the bulk session action bar

In the "Other sessions" multi-select action bar, "Remove N sessions" was
rendered before "Cancel", which placed the destructive action on the left.
Swap the two buttons so "Cancel" is on the left and "Remove N sessions" on the
right, per review feedback on #33983.
2026-06-30 13:04:07 +00:00
Michael TelatynskiandGitHub ffdd9595c7 Cut some import cycles (#34038)
* Fix SettingsController -> SettingsStore import cycles

* Fix AnalyticsToast<->AnalyticsLearnMoreDialog import cycle

* Fix emojipicker import cycle

* Fix MessageComposerButtons import cycle

* Fix ReadReceiptGroup<>ReadReceiptMarker import cycle

* Fix RoomSettingsDialog import cycles

* Fix SlashCommands import cycles

* Fix Pill import cycles

* Fill TODO comment
2026-06-30 12:49:28 +00:00
David BakerandGitHub 1aa86110e2 Stub (window.)location (#34041)
* Stub (window.)location

As per comment

* avoid sonar's trigger word
2026-06-30 08:16:22 +00:00
Will HuntGitHubCopilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
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
3e40e58b12 Mock out window.addEventListener globally (#34028)
* Mock out window.addEventListener globally

As some code uses it

* Move to setupGlobals

* clean up import

* Only needed if we don't have happy-dom

* thank you!

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2026-06-29 17:08:32 +00:00
Florian DurosandGitHub 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
Richard van der HoffandGitHub d1e6bb5b52 Add "user identity" display to dev tools (#33977)
* Add "user identity" display to dev tools

* Correct incorect hard-coded string in test mock

* Fix up tests
2026-06-29 15:49:03 +00:00
Florian DurosandGitHub c42899b0b1 Room list: remove usage of algorithms of old room list store (#33975)
* feat:add missing methods to rls V3

* feat: use rls v3 methods instead of old alrgorithms

* feat: move stabel function to own utils

* feat: use this new moved functions

* test: cleaner test
2026-06-29 14:29:28 +00:00
David BakerandGitHub c71f17e6de Don't re-export MainSplitContentType enum (#34021)
* Don't re-export MainSplitContentType enum

I don't see why this was necessary, importing RoomView pulls in all sort
of stuff, whereas RoomContext is much smaller.

* ts, not tsx

* unintentional change
2026-06-29 12:58:52 +00:00
Florian DurosandGitHub 526b4b8c33 Room list: remove usage of old room list store in LoggedInView & InviteDialog (#33973)
* feat: add functions to dm and server notice in rls

* feat: use these functions in dialogs to get rid of old rls
2026-06-29 11:46:14 +00:00
Florian DurosandGitHub 3205db9c07 feat: migrate RoomGeneralContextMenu off legacy RoomListStore (#33979) 2026-06-29 09:44:15 +00:00
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 LangleyandGitHub 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
Florian DurosandGitHub 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 6c69313ade9ed2ab17a4622c692b435fbdb94ad2.

* 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
Michael TelatynskiandGitHub f9b97be1d7 Refactor languageHandler to avoid import cycles (#33948)
* Refactor languageHandler to avoid import cycles

Also move its tests to vitest

* Small refactor

* Iterate

* Iterate
2026-06-24 09:49:49 +00:00
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
Michael TelatynskiandGitHub a26732b040 Tidy up React JSX to make Sonar happier (#33946)
* Eradicate unused React props

* Fix unmatched defaultProps

* Remove spurious React fragments

* Remove unused JSX

* Remove unused React state field

* Remove unused React state field

* Update snapshots
2026-06-23 16:40:42 +00:00
Michael TelatynskiandGitHub 918f2932df Tidy languageHandler test (#33945)
Avoid using special test classes in favour of fetchMock
2026-06-23 11:25:34 +00:00
Michael TelatynskiandGitHub 1a3d5bbfff Fix double tooltip on collapsed Quick Settings button (#33923)
* Fix double tooltip on collapsed Quick Settings button

* Update snapshot
2026-06-22 10:31:48 +00:00
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
Michael TelatynskiandGitHub 45234b9c94 Migrate more jest tests to vitest (#33898)
* Migrate more jest tests to vitest

* Fix jest config

* Fix jest config

* Make remaining jest tests type-happy
2026-06-19 15:34:18 +00:00
Florian DurosandGitHub 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
renovate[bot]GitHubrenovate[bot] <29139614+renovate[bot]@users.noreply.github.com>Michael Telatynski
90fb221a8e Update zxcvbn-ts monorepo to v4 (#33880)
* Update zxcvbn-ts monorepo to v4

* Handle breaking changes

* Improve coverage

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2026-06-18 11:17:50 +00:00
Michael TelatynskiandGitHub 7bb842e8d4 Replace override raw-loader with ?raw query (#33854)
* Replace override raw-loader with `?raw` query

For compatibility with vite/st

* Make knip happy

* Fix icon in Jitsi lobby

* Fix jest config for `?raw`

* Remove stale `$webapp` alias

* Ensure css files loaded as `?raw` do not get bundled
2026-06-18 09:36:07 +00:00
Michael TelatynskiandGitHub 7a1a3f518c Make codebase comply to knip --strict (#33893)
* Make codebase comply to `knip --strict`

Deletes a few bits of dead code

* Trim i18n strings

* Fix missing export

* Remove test of dead code
2026-06-18 09:35:47 +00:00
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
Michael TelatynskiandGitHub 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
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 DurosandGitHub 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
Michael TelatynskiandGitHub 86a89c2aa5 Replace require calls for image uris with imports (#33847)
* Replace `require` calls for image uris with imports

In prep for vitest

* Fix copyright
2026-06-15 16:09:51 +00:00
Michael TelatynskiandGitHub 2f4e6a4ec4 Use vitest for some EW unit tests (#33816)
* Use vitest for some EW unit tests

* Ensure library builds are done before unit tests

* Stabilise jest tests

* Move more tests over

* Make sonar happier

* Update types/node for happy-dom compat again

* Decrease max-workers to stabilise jest tests

* Split jest over 3 runners to alleviate memory woes

* Switch jest to runInBand

* Attempt to deflake jest tests

* tweak coverage

* tweak coverage
2026-06-15 13:24:33 +00:00
Michael TelatynskiandGitHub 7949980a7e Apply html utils sanitiser to embedded page (#33842)
* Apply html utils sanitiser to embedded page

* Write tests
2026-06-15 12:58:56 +00:00
ZackandGitHub 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
5bcec9112e [create-pull-request] automated change (#33841)
Co-authored-by: t3chguy <2403652+t3chguy@users.noreply.github.com>
2026-06-15 08:40:28 +00:00
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
add7d4c405 Room list: hide the empty/collapse icon when the room list is empty (#33814)
* fix: don't display the empty/collapse icon when the room list is empty

* Fix jest lcov projectRoot config

---------

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2026-06-11 13:01:32 +00:00
Florian DurosandGitHub 2d434c72d4 feat: remove logic to expand a section when a filter is selected (#33785) 2026-06-11 09:21:30 +00:00
rbondessonandGitHub a8f9c75fc1 Make EventTileViewModel consume pure render data (#33805) 2026-06-11 08:05:43 +00:00
rbondessonandGitHub 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
t3chguyandgithub-actions[bot] f5ba03da4b [create-pull-request] automated change 2026-06-10 07:44:21 +00:00
Michael TelatynskiandGitHub 67295e2334 Handle unknown screens better (#33793)
* Remove legacy export

* Extract view map to a switch case statement with typescript checking that all cases are handled

This lets us drop the `default` case as we know we will never reach it.
Additionally move all the settings conditions to the state-setters rather than the renderer so we are never stuck in an undefined state

* Fix comment

* Handle unknown screens better

Redirect to welcome/home rather than getting stuck at spinner
2026-06-09 17:15:19 +00:00
Will HuntandGitHub 6cac2730fd Add mechanism to locally enforce MSC1763 retention rules (#33772)
* First pass at new retention

* Add more test cases

* fixup

* Fix TODO

* Disable retention explicitly from the start

* fixup

* Just apply retention as-is

* Fixup
2026-06-09 16:35:02 +00:00
Will HuntandGitHub ae0b3c9c42 Merge pull request #33796 from anoadragon453/anoa/fix_transports_error_handling
Fix "unexpected error" logging when fetching RTC transports from the homeserver
2026-06-09 15:28:26 +00:00
David BakerandGitHub 9b6fe3f867 Merge pull request #33764 from element-hq/dbkr/withpresence_use_new_component
Make presence icons & colours consistent throughout the app
2026-06-09 14:04:34 +00:00
Andrew Morgan 62c14560e5 Fix "unexpected error" logging when fetching RTC transports from the homeserver
The previous code assumed that the homeserver would return `M_NOT_FOUND`
when the endpoint wasn't implemented. But homeservers should return
`M_UNRECOGNIZED` instead in this case.

See
https://spec.matrix.org/v1.18/client-server-api/#:~:text=The%20server%20did%20not%20understand%20the%20request%2E
2026-06-09 14:36:34 +01:00
Will HuntandGitHub 925c762859 Disable URL previews per-message when the message provides a hint (#33775)
* Disable URL previews if the message requests it.

* Use MSC4095

* Expose type

* Document MSC

* cleanup

* cleanup
2026-06-09 10:40:41 +00:00
R Midhun SureshandGitHub a2a9800393 Recreate resizer view-model when switching to/from multiroom view (#33792) 2026-06-09 10:21:29 +00:00
Florian DurosandGitHub 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
David Baker 107289a16c Put tooltips on presence consistently
Sort out duplication between presence icon code, have the MemberIconView
position the presence icon rather than the presence icon trying to position
itself.
2026-06-08 17:55:32 +01:00