Commit Graph

147 Commits

Author SHA1 Message Date
Michael Telatynski 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
Michael Telatynski 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 Telatynski 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
Michael Telatynski 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
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
Michael Telatynski 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 Telatynski 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
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
rbondesson a8f9c75fc1 Make EventTileViewModel consume pure render data (#33805) 2026-06-11 08:05:43 +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 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
David Baker 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
R Midhun Suresh a2a9800393 Recreate resizer view-model when switching to/from multiroom view (#33792) 2026-06-09 10:21:29 +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
Florian Duros 067c1b43a5 feat: remove subphrase in edition section dialog (#33780) 2026-06-08 16:04:28 +00:00
David Baker 2fa09e2939 Remove usage of the size prop.
You can have it any size you like as long as it's 8px.
2026-06-08 10:09:51 +01:00
David Baker 0409f2d117 Make presence icons & colours consistent throughout the app
Update WithPresenceIndicator to use the new AvatarPresenceIconView
component rather than its own one with old presece icons / colours.
2026-06-05 14:05:30 +01:00
Michael Telatynski 486fa57b68 [Labs] Sign in with QR on new EW using generated QR for MSC4108 v2024 (#33184)
* PoC Sign in with QR on new EW using generated QR for MSC4108 v2024

* Revert package.json changes

* Prettier

* Fix i18n

* Tidy up

* Remove unused state variable

* Iterate tests

* Partial revert

* Iterate

* Wire up qr_login route

* Iterate UI

* Fix React dev mode double rendering issue

* Fix react key warning

* Hide flow header on login

* Re-roll qr code on channel expiry

* Switch to AbortSignal

* Improve auto-retry QR UX

* Ensure we only show sign in with QR button if enabled

* XXX: enable labs flag on Netlify builds

* Tweak QR code sizing

* Move qr login flow into a dialog to match designs

* Fix null deviceId

* Remove duplicate log

* Iterate

* Fix tests

* Fix types

* Fix tests

* Fix tests

* Make Netlify more useful

* Make Netlify more useful v2

* Update copy

* Refactor QR link flow to use new SDK methods

Requires https://github.com/matrix-org/matrix-js-sdk/pull/5283
For element-hq/wat-internal#188
Split out from https://github.com/element-hq/element-web/pull/33184

* Link to js-sdk branch

* Update tests

* Simplify

* Revert js-sdk linking

* Iterate

* Iterate

* Refactor to handle most of the TODOs

* Remove unused code

* Remove unused code

* Use js-sdk isSignInWithQRAvailable API to simplify code

* Restore app-test.ts

* Improve coverage

* Improve coverage

* Remove unused prop/state

* Iterate

* Fix tests

* Iterate

* Tests

* Handle TODOs

* Docs

* Remove redundant call to crossSignDevice()

* Workaround to remove training slash on the serverName before auto-discovery

* Revert "Workaround to remove training slash on the serverName before auto-discovery"

This reverts commit 0335a8fdd1.

* setLoggedIn not to be used with OIDC flows as it clears storage

as per docs on setLoggedIn we should use restoreSessionFromStorage

* Don't show the security_code_prompt unconditionally(i.e. for the web logging in mobile flow)

* Update LoginWithQRFlow-test.tsx.snap

* Update MatrixChat-test from setLoggedInSpy to restoreSessionSpy

* Add todo for server switch

* Add todo about handling base URL or server name

* Handle server name or base URL being returned

* Format

* Fix loading state height

* Handle the homeserver URL differing during QR code login

* Comments

* Comments

* Register OIDC client ID after homeserver swap

* Make QrLoginDialog async to minimise the impact on bundle size

* Handle unsupported HS earlier in the flow

* Iterate

* Delint

* Fix test

* Discard changes to apps/web/element.io/develop/config.json

---------

Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
Co-authored-by: David Langley <langley.dave@gmail.com>
2026-06-04 13:50:17 +00:00
rbondesson 536fae63ea Refactor EventTile using the MVVM pattern - #8 (#33691)
* Make EventTileViewModel usage coherent

* Extract render helpers

* Extracted small render views

* Reduce Render Branch Duplication

* Clean Up Dead or Legacy Inline Code

* Add/Update documentation

* Updated snapshot

* Fix Sonar issue

* Updated snapshots after merge error

* Fix prettier issue
2026-06-03 06:20:59 +00:00
David Langley 2c6461db17 Remove resizer from fullscreen modules(like multiroom) (#33684)
* Fix multiroom with new resizer

* Fix multiroom with new resizer

* Add jest test

* Add if/else and comments
2026-06-02 14:10:46 +00:00
Andy Balaam 65b0ac8c28 Support MSC4287 m.key_backup stable prefix as well as the unstable prefix (#33034)
* Support MSC4287 m.key_backup stable prefix as well as the unstable prefix

* Update comments to avoid talking about EX since this now applies more widely

* Make comments about m.key_backup more helpful

* Improve comment on recheckBackupDisabled

* Explicitly say backup is disabled only if enabled is actually set to false
2026-06-02 10:25:03 +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
Hubert Chathi 2bd5224dbe Apply new design and display logic to logout confirmation dialog (#33426)
* apply new design to logout dialog

* factor out check for other verified devices

* only show recovery warning when user has no other verified devices

* fix playwright tests

* tweak style to better match design

* another playwright test fix

* fix playwright

* Look for the remove button within the dialog

* Use testid to locate 'Remove this device' button

* move rendering to sub-components, rather than embedded functions

* use <Type> element

* use <Text> for the <a> element

---------

Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
2026-06-02 03:08:18 +00:00
rbondesson 531fc76726 Refactor EventTile using the MVVM pattern - #7b (#33668)
* Normalize Leaf Adapter Pattern

* Extract simple EventTile adapters

* Move simple EventTile adapter VM ownership to EventTileViewModel

* Release listener-owning EventTile child VMs on adapter unmount

* Extract stateful EventTile adapters

* Move action bar VM ownership to EventTileViewModel

* Move reactions row VM ownership into EventTileViewModel

* Extract EventTile receipt rendering

* Extract EventTile sender identity rendering

* Add missing TSDoc on adapters
2026-06-01 13:36:37 +00:00
rbondesson fc23fcad47 Make shared-components tiles render identically outside Element Web - #4 (#33622)
* Use shared MessageTimestampView in edit history

* Move timestamp typography into shared component

* Updated snapshots

* Update comments after clean up

* Fixed sonar issue and added tests for improved coverage

* Fix Prettier issue

* Fix font-size on timestamps and toolbar button sizing

* Updated snapshots

* Updated Storybook screenshots

* Updated screenshots

* Clean up app/web unused/redundant styling for disambiguated profile

* Fix merge error

* Fixes after merge

* Fixes after merge
2026-06-01 05:47:59 +00:00
rbondesson 7ff2bc3e40 Extracting RovingGridIndex from EmojiPicker and move to shared components (#33650)
* Add shared roving grid navigation provider

* Add RovingTabIndex stories and update RovingGridIndex stories

* Handle multiple toolbars/grids in on roving group

* Refactor EmojiPicker to use shared roving grid navigation

* Exclude the roving stories from playwright tests

* Fix Sonar issues
2026-05-29 08:54:58 +00:00
rbondesson 3aa3678c2d Refactor EventTile using the MVVM pattern - #7a (#33640)
* Make EventTileViewModel an owned root VM

* Move timestamp sub-VMs under EventTileViewModel

* Move thread-list action bar VM under EventTileViewModel

* Clean up for improved readability

* Clean up to avoid duplicate EventTile render derivations

* Avoid mutating EventTileViewModel during render

* Move EventTile child VM syncing into adapters

* Replace timestamp VM field setters with batched setProps

* Component wrappers at the end of the file

* Lazy-create EventTile child view models
2026-05-29 05:56:31 +00:00
Zack 3bb9cb2234 Refactor ThreadSummary to MVVM (#33603)
* Refactor ThreadSummary to MVVM

* Stories Snapshot images

* Add ThreadSummary ViewModel coverage

* Fix ThreadSummary preview avatar rendering

* Remove ThreadSummary classnames helper

* Fix Prettier

* Match ThreadMessagePreview typography

* Move folder to correct path and fix storybook path

* Catch ThreadSummary preview refresh errors

* Update snapshot images + fix prettier

* Fix ThreadSummary classNames import

* Update Images

* Remove wrong path
2026-05-28 08:57:55 +00:00
Zack 34c388f760 Refactor E2eMessageSharedIcon to MVVM (#33544)
* Refactor E2eMessageSharedIcon to MVVM

* FIx Prettier and i18n

* Fix prettier

* Remove legacy E2eMessageSharedIcon component

* Cover E2eMessageSharedIcon MVVM updates

* Fix prettier

* Update apps/web/src/components/views/rooms/EventTile.tsx

Co-authored-by: Florian Duros <florian.duros@ormaz.fr>

* Skip unknown E2E shared icon visual

* Track E2E shared icon listener disposal

* Remove E2E shared icon room state guard

* Remove E2E shared icon client resync

* Use built-in disposables for shared icon VM

* Update shared icon VM without React key

---------

Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
2026-05-28 08:01:39 +00:00
rbondesson 6c0f9960b5 Refactor EventTile using the MVVM pattern - #6 (#33621)
* Thin EventTile render state wiring

* Move EventTile E2E verification into a view model

* Derive EventTile E2E padlock slots in view model

* Derive EventTile timestamp slots in render state

* Derive EventTile footer slots in render state

* Fix SonarCloud issues
2026-05-27 11:34:56 +00:00
David Baker 5cfb68962d Fix missed await in ChangePassword (#33588)
Looks like this probably ought to be awaited, anyway, although
I'm not convinced it's the cause of the flake I'm seeing.
2026-05-26 08:08:33 +00:00
rbondesson 5486a22922 Refactor EventTile using the MVVM pattern - #5b (#33600)
* Extract EventTile E2E padlock state

* Refactor EventTile E2E padlock rendering after review comments
2026-05-26 06:36:05 +00:00
rbondesson 03360eb260 Refactor EventTile using the MVVM pattern - #5a (#33587)
* Extract EventTile receipt state

* Extract EventTile thread state

* Extract EventTile reaction relation state

* Extract EventTile reply-chain state

* Keep reply chain collapse wiring in EventTile

* Reuse message event eligibility for receipts
2026-05-22 18:25:32 +00:00
rbondesson 70e59c6221 Refactor EventTile using the MVVM pattern - #4 (#33539)
* Extract EventTile interaction state transitions

* Fix sonar issues
2026-05-21 13:41:58 +00:00
Zack 223a861535 Move E2ePadlock to shared components (#33538)
* Move E2ePadlock to shared components

* Add storybook images

* Move translation to shared components

* Fix E2ePadlock story accessibility

* Update E2eMessageSharedIcon test for padlock role
2026-05-20 13:20:17 +00:00
Florian Duros 4b6e0b7ebf Fix pinned message banner disappearing when a pinned message event is unkown (#33534)
* fix: remove unknown event when fetching pinned message events

* test: update tsts
2026-05-20 09:40:09 +00:00
rbondesson d41ff70057 Refactor EventTile using the MVVM pattern - #3 (#33516)
* Introduce thin EventTile view model snapshot

* Fix errors after merge conflict resolution
2026-05-20 08:32:05 +00:00
R Midhun Suresh 00ccc97c79 Call Tile - Improve tile alignment in modern and bubble layout (#33478)
* Tile must have same indent as messages

* Align the call tiles between the bubbles
2026-05-19 09:18:30 +00:00
Will Hunt 02b6520f09 Module API for adding new file upload mechanisms (#33355)
* Initial reword of upload to MVVM.

* Update tests

* More incremental improvements

* Refactor tests to use helper method for composer uploads.

* Add drag and drop tests

* lint

* Add commentary

* fixup test

* More precise selector

* Retarget uploads

* lint

* fixup

* one more type

* update snap

* Fixup composerUploadFiles

* fix import

* lint

* Copy and paste fixes too

* Add tests for pasting

* Add tests for pasting files.

* Remove redundant fn

* rm comment

* tidy up

* Test cleanup

* More clean up

* another fix

* Begin fleshing out

* Park changes

* More stuff

* Use condensed version

* Cleanup tests

* more cleaning

* last bity

* Add a test for the composer

* Park up changes

* Rewrite Measured to be a functional component

* Add tests to cover narrow viewports

* lint

* breakpoint is optional

* Cleanup

* Support narrow mode

* fixup

* begone

* Provide default value

* add label

* fixup test

* update copyright

* cleanup

* Be a bit more lazy with FileDropTarget

* remove a debug statement

* Fixup

* fix two snaps

* Update screenshot

* and the other one

* Update snaps

* unfake CIDER

* update screens again

* remove extra test

* Undo accidental snapshots

* Bit of tidyup

* fixup

* even more tidyup

* may drag and drop file

* tidy up again

* snap snap snap

* Use load to make sonarQube happy

* Bunch of refactors

* More cleanup

* cleanup debug code

* tweaks

* remove a test we no longer need

* make it happy

* fix import

* fixup

* Update snaps

* typo

* one off

* Add tests

* lint

* remove only

* Reduce screenshot scope

* fix snapshot usage

* cleanup
2026-05-18 21:41:38 +00:00
rbondesson 297ad9bb8d Make shared-components tiles render identically outside Element Web - # 2 (#33485)
* Adding correct layout/density attributes to unit tests

* Move app/web styling to FileBodyView

* Unify styling for MediaBody wrapped components

* Fix prettier issues

* Update app/web snapshots

* Wrap file download and audio loading states in MediaBody

* Revert the MediaBody for download buttons.

* Revert changes for MediaBody wrappers

* Updated snaphots for MediaBody components
2026-05-18 05:59:03 +00:00
rbondesson 7fe8cdafe0 Refactor EventTile using the MVVM pattern - #2 (#33489)
* Improve coverage

* Add view model unit tests to improve coverage

* Extract initial pure EventTile derived state helpers

* Extract EventTile derived state helpers

* Extract EventTile class state derivation

* Extract EventTile line class derivation

* Extract EventTile sender profile state

* Extract EventTile avatar member selection

* Extract EventTile avatar clickability state

* Extract EventTile sender profile mode

* Extract EventTile action bar visibility

* Extract EventTile timestamp visibility

* Extract EventTile timestamp selection

* Extract EventTile timestamp display state

* Extract ReplyChain timestamp visibility

* Extract EventTile footer display state

* Fix sonar issue
2026-05-18 05:36:13 +00:00
Travis Ralston d5a0ac6014 Remove MSC3215 (Report to Moderators) labs feature (#33492)
* Remove MSC3215 (Report to Moderators) labs feature

T&S does not believe this is used, and intends to replace it during Reporting v2 anyway.

Original MSC: https://github.com/matrix-org/matrix-spec-proposals/pull/3215

New (WIP) MSC: https://github.com/matrix-org/matrix-spec-proposals/pull/4468

(This PR/commit doesn't add MSC4468 support because it's unclear if we should use MSC4468 directly or via another endpoint like MSC4457)

[MSC4457]: https://github.com/matrix-org/matrix-spec-proposals/pull/4457

* Remove unused state: isRoomEncrypted
2026-05-14 20:46:01 +00:00
Will Hunt ab904bb6ca Ensure interface gradually reduces visible buttons when viewport shrinks (#33477)
* Rewrite Measured to be a functional component

* Add tests to cover narrow viewports

* lint

* breakpoint is optional

* Cleanup

* Provide default value

* Fixup

* fix two snaps

* Update screenshot

* and the other one

* unfake CIDER

* Update snaps AGAIN
2026-05-14 15:15:43 +00:00
rbondesson 97da3be67a Fix for message action bar visibility getting out of sync with the real UI state (#33445)
* Make sure action bar is not visible when using up/down arrows during editing

* Add a temporary mouse move listener to handle tooltips stealing onMouseLeave events

* Better naming, add comments and test

* Fix test that performs its own hover/pointer movement before clicking.

* Fix playwright test that actually displayed a message time stamp when hover state was stale

* Fixes after merge
2026-05-13 07:52:47 +00:00
Zack 1e7c9f672a Phase 2 Refactor MImageBody to MVVM and remove legacy component (#33212)
* MVVMing of MImageBody and removing legacy component + css

* Fix Prettier

* update small image to large image in test

* Update test

* Preserve MImageBody legacy class names

* Click image in custom component download test

* Update snapshots

* Update MBodyFactory snapshots

* Added new tests to pass coverage

* Fix prettier

* Remove legacy import that was removed

* Add MImageReplayBody test for coverage

* Remove legacy MImageBody selectors from image view

* Update image body selectors in Playwright tests

* Keep file panel image body spacing compact

* Update apps/web/src/viewmodels/message-body/ImageBodyViewModel.ts

Co-authored-by: Florian Duros <florian.duros@ormaz.fr>

* added documentation to component

* Fix hidden media placeholder import

---------

Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
2026-05-13 06:03:43 +00:00
Will Hunt aeaeb55cda Rework Upload internals to use MVVM (#33307)
* Initial reword of upload to MVVM.

* Update tests

* More incremental improvements

* Refactor tests to use helper method for composer uploads.

* Add drag and drop tests

* lint

* Add commentary

* fixup test

* More precise selector

* Retarget uploads

* lint

* fixup

* one more type

* update snap

* Fixup composerUploadFiles

* fix import

* lint

* Copy and paste fixes too

* Add tests for pasting

* Add tests for pasting files.

* Remove redundant fn

* rm comment

* tidy up

* Test cleanup

* More clean up

* another fix

* Use condensed version

* Cleanup tests

* more cleaning

* last bity

* s/throw Error/throw new Error/
2026-05-12 11:30:30 +00:00
Zack 39607799de Refactor view source event to MVVM (#33428)
* Refactor view source event to MVVM

* remove unused variable since movement

* Update view source event screenshots

* Update packages/shared-components/src/room/timeline/event-tile/body/ViewSourceEventView/ViewSourceEventView.tsx

Co-authored-by: Florian Duros <florian.duros@ormaz.fr>

* Use view model disposables for source event decryption

* Consolidate source event view model updates

* Fix prettier

* Fix view source expanded class name

* Remove void from source event decryption

---------

Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
2026-05-12 11:17:47 +00:00
Zack b19025e578 Refactor MJitsiWidgetEvent to shared view MVVM (#33457)
* Refactor Jitsi widget event to shared view

* Align Jitsi widget view model setters

* Inline Jitsi widget icon color

* Remove unused Jitsi timestamp setter

* Tighten Jitsi widget subtitle type
2026-05-12 09:12:43 +00:00
Zack 67ea6bfa53 Refactor room avatar event to MVVM (#33473)
* Refactor room avatar event to MVVM

* Cover room avatar event factory wrapper

* Fix prettier

* added screenshots
2026-05-12 08:17:33 +00:00
R Midhun Suresh 2933b51fea Call Tile - Render a tile showing that a call was started (#32988)
* Ignore specific directories

Otherwise newly generated screenshots will be ignored.

* Create a CallStartedTileView

This view will render a tile that shows when an EC call was started in
the timeline.

* Add storybook tests

* Add vite tests

* Export the view from shared-components package

* Add a viewmodel for driving the view

* Support rendering the tile in the tile factory

* Fix tile rendering

* Add comment to explain css height

* Use semantic token for gap

* Update snapshot

* Use min-height over height

This will scale the element if the user sets a custom font size.

* Don't show timestamp for call started tile

Timestamp is already shown as a part of the tile content.

* Fix broken tile on bubble layout

The tile should be full-width and not shown within a bubble.

* Fix tests

* Update storybook title
2026-05-11 21:12:51 +00:00