1
0
mirror of https://github.com/element-hq/element-web.git synced 2026-10-24 23:19:26 +03:00

28 Commits

Author SHA1 Message Date
Richard van der Hoff
fc4c0390ff Copy changes for "set up recovery" (#35437)
* Update "your chats are backed up" copy

... in the Settings dialog (RecoveryPanel), and the "set up recovery" toast.

* Change labels on "set up recovery" UI

* Add help text to 'Allow key storage' toggle

* update playwright snapshots
2026-10-15 23:01:37 +00:00
Michael Telatynski
b39d7266fa Fix dangling promises in test files (#35462)
* Fix floating promises in test files

Enables typescript/no-floating-promises

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

* Fix flaky url preview test due to expecting old class names
2026-10-14 13:28:12 +00:00
Matthew Hodgson
976622c131 Only dismiss the incoming call toast when its own events are redacted (#35238)
The redaction guard compared the redacted event's id with itself, so any
redaction in the room dismissed the ringing toast. The test did not catch
it because its mock notification used "m.relation" instead of
"m.relates_to", so the call event was never actually referenced.
2026-09-30 14:37:21 +00:00
David Langley
bc9e9cf28a Strip snapshot css module hashes (#35206)
* Strip CSS module hashes from apps/web snapshots

shared-components and compound-web build their CSS module class names
with postcss-modules' default `_<class>_<hash of the stylesheet>_<line>`,
so any edit to a stylesheet renames every class in it and changes every
apps/web snapshot that renders it. Two unrelated PRs touching the same
stylesheet then always conflict in those snapshots.

Add a snapshot serializer, alongside the React useId one, that reduces
those names to `_<class>` in DOM and string snapshots. The shipped class
names keep their content hash, so two copies of the library loaded at
once (e.g. by a module) stay isolated.

Signed-off-by: David Langley <davidl@element.io>

* Update snapshots for the CSS module hash serializer

Signed-off-by: David Langley <davidl@element.io>

* Only strip CSS module hashes inside class attributes

The serializer ran its regex over the whole snapshot, so text or other
attributes shaped like a CSS module name would have been shortened too.
Restrict it to entries of `class="…"` lists, which is where DOM and HTML
string snapshots put class names, and match each entry whole.

String snapshots are now picked up by a cheap `class="` check, which also
removes the `lastIndex` reset the global regex needed.

Signed-off-by: David Langley <davidl@element.io>

* Explain the CSS module class regexes

Signed-off-by: David Langley <davidl@element.io>

* Strip CSS module hashes by splitting on underscores

Rather than matching the exact `_<class>_<hash>_<line>` shape, drop the
last two `_`-separated parts of any class that starts with `_` and has
all three parts. Simpler to read, and produces the same snapshots.

Signed-off-by: David Langley <davidl@element.io>

---------

Signed-off-by: David Langley <davidl@element.io>
2026-09-30 12:23:21 +00:00
Matthew Hodgson
be98db3061 Keep an incoming call ringing when a call in another room ends (#35222)
The room guard in IncomingCallToast's CallStore listener was
'!roomId && roomId !== callRoomId', which never returns early, so any
room's call object being replaced or dropped (e.g. hanging up a call
in the PIP) dismissed every ringing toast.
2026-09-28 13:29:35 +00:00
mxandreas
c8fc9e1d9f Update date for exclude insecure devices banner. (#35117)
* Update date for exclude insecure devices banner.

* Fix visual tests.

* Use a Link to avoid styling issues.

* update snaps

---------

Co-authored-by: Will Hunt <2072976+Half-Shot@users.noreply.github.com>
Co-authored-by: Half-Shot <will@half-shot.uk>
2026-09-22 08:49:11 +00:00
Will Hunt
e7d6fd6473 Move GenericToast to shared-components (#35122)
* Port GenericToast to a shared component

* Update imports of GenericToast

* Remove legacy styles

* update test ids

* Move from classes to testIds

* update snap

* update toasts

* Add a test for coverage
2026-09-21 10:54:12 +00:00
Michael Telatynski
6d644ffe78 Remove legacy Module & Customisation API (#33941)
* Remove legacy Module & Customisation API

in favour of the new runtime modules system

* Delint

* Remove unused i18n string

* Fix tests

* Fix test

* Fix tests

* Iterate

* Fix bad merge

* Bump Module API version

* Bump module-api compatibility ranges

* Update docs

* Fix semver ranges

* Update test module API version

* Too many versions

* Too many versions again
2026-09-11 13:32:48 +00:00
Richard van der Hoff
0bad2dfc81 Do not force identity reset if user forgets recovery key (#35005)
* Remove redundant `forgotRecovery` argument from
`keyStorageOutOfSyncNeedsCrossSigningReset`.

* Do not force identity reset if user forgets recovery key

If we are missing the backup decryption key, and the user has forgotten the
recovery key, we do not need to reset the user's identity: it is adequate to
change the recovery key and create a new key backup.

We already support this for the "key storage out of sync" toast, but if the
user opens the encryption settings and clicks "forgot recovery key" on the
"storage out of sync" panel there, we currently force them to do an identity
reset.

Fixes: #35004
2026-09-10 17:36:16 +00:00
Michael Telatynski
cf4030dab4 Migrate batch of tests from Jest to Vitest (#34839)
* Migrate batch of tests from Jest to Vitest

* Make Jest happy

* Stabilise vitest tests
2026-09-01 12:04:49 +00:00
Michael Telatynski
b819fa58df Migrate batch of Jest tests to Vitest (#34714)
* Migrate batch of Jest tests to Vitest

* Iterate
2026-08-17 11:41:52 +00:00
Michael Telatynski
eadc43ddf4 Enable oxlint rule typescript/no-floating-promises (#34586)
* Enable oxlint rule `typescript/no-floating-promises`

* Iterate
2026-08-13 10:24:13 +00:00
Michael Telatynski
0ae908b851 Replace short-lived no-mobile-guide-redirect cookie with SessionStorage (#34350)
* Replace short-lived no-mobile-guide-redirect cookie with SessionStorage

* Add coverage
2026-07-29 15:37:07 +00:00
Michael Telatynski
bbec915fb0 Enable more oxlint rules (#34189)
* Fix type imports

* Fix jsdoc

* Fixup types

* Fix stray awaits on non-thenables

* Fixup imports

* Fix splats

* Fix this-context on callbacks

* Memoise react contexts

* Prefer find/flatMap

* Make oxlint happier about our React keys

* Avoid unsafe default function params

* Fixup jsdoc

* Fixup contexts

* Switch from eslint to oxlint

* Some oxlint-related tweaks

* Iterate

* Partial revert to defer some changes and shrink diff

* Iterate

* Add eslint-plugin-element-call and enable the copyright rule

* Set strictStorePkgContentCheck

* Iterate

* Enable forwardRef oxlint rule

* Enable no-unused-vars oxlint rule

* Enable no-implied-eval oxlint rule

* Enable no-duplicate-type-constituents oxlint rule

* Enable explicit-length-check oxlint rule

* Enable prefer-number-properties oxlint rule

* Enable no-callback-in-promise oxlint rule

* Enable no-require-imports oxlint rule

* Remove disablement of most unicorn oxlint rules

* Enable no-conditional-tests oxlint rule

* Enable promise-valid-params oxlint rule

* Enable require-unicode-regexp oxlint rule

* Remove max-len comments as we use oxfmt for formatting

* Enable majority of oxlint `suspicious` rules

* Iterate

* Fix oxlint type-aware lint running without dependencies built
2026-07-29 08:26:07 +00:00
Michael Telatynski
106d6024b2 Remove support for MSC3391 & MSC3852 (#34400)
* Remove support for MSC3391 & MSC3852

As they were both rejected & closed.

Synapse already removed support for MSC3852 which means it already did nothing: https://github.com/element-hq/synapse/pull/19430

* Update snapshot
2026-07-23 13:18:00 +00:00
Michael Telatynski
b5fd249e38 Remove more usages of singleton store getter in favour of contexts (#34099)
* Expose SDKContextClass via window for debugging

* Remove stores from window if they are exposed via sdkContext

* Avoid usages of global store instance where React context is accessible

* Remove more usages of singleton store getter in favour of contexts

* Remove more usages of singleton store getter in favour of contexts

* Fix tests by adding SDKContext.Provider

* Fix tests by adding SDKContext.Provider

* Fix tests by adding SDKContext.Provider

* Fix tests by adding SDKContext.Provider

* Fix tests

* Fix tests

* Fix tests

* Iterate

* Fix bad merge

* Iterate

* Fix tests

* Iterate

* Iterate

* Iterate

* Iterate

* Iterate

* Improve coverage

* Improve coverage
2026-07-14 12:58:34 +00:00
Michael Telatynski
4ec8f1edcd Remove LegacyCallHandler singleton (#34086)
* Remove dead code

* Remove LegacyCallHandler singleton

Route via SDKContext to cut import cycles

* Remove unused setting

* Fix tests

* Fix tests

* Cascade SDKContext through PersistedElement

* Improve coverage

* Iterate

* Improve coverage

* Improve coverage
2026-07-07 12:29:54 +00:00
Michael Telatynski
a26eb9f578 Fix Notifier import cycle (#34122)
* Fix Notifier import cycle

* Fix tests

* Delint

* Iterate

* Handle SDKContextClass `client` initialisation internally

Rather than via MatrixChat - this is predominantly for Lifecycle tests as they don't use a MatrixChat and it doesn't make much sense for this component to own this state.

* Fix tests

* Iterate

* Improve coverage

* Improve coverage

* Fix bad merge

* Iterate
2026-07-06 19:20:51 +00:00
Michael Telatynski
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
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
Robin
1cc868a25a Update button in incoming call toast to say 'Decline' (#33405)
* Update button in incoming call toast to say 'Decline'

Rather than 'Ignore'. This change has been agreed with design since 'Ignore' did not properly communicate that clicking the button would inform the caller that you deliberately rejected their call.

* Update incoming call toast screenshots
2026-05-06 10:46:05 +00:00
Robin
03b730db58 Update toast styles, improve incoming call notifications (#33043)
* Update design of incoming call notifications

* Make toast show avatars of group call participants

* Further expand test coverage for call notifications

* Update screenshots

* Update screenshots

* Delete unused variables

* Upgrade Element Call to v0.19.2

For the new group call intents.

* Consolidate some branches

* Apply Compound spacing variables a little more

* Fix lints

* Exclude Element Call assets from being re-minified to fix build
2026-04-27 14:37:42 +00:00
renovate[bot]
c02b970d35 Update dependency @vector-im/compound-web to v9.2.1 (#33270)
* Update dependency @vector-im/compound-web to v9.2.1

* Update button sizes

* More button size updates

* Another button size

* Button size

* Snapshot updates

* Snapshots

* More sm/md

* More button size updates

* snapshot

* and one more from merging develop

* More snapshots

* Phantom typing

* yep, more snapshots

* More snapshots

* More snapshots

* Last ones?

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: David Baker <dbkr@users.noreply.github.com>
2026-04-23 12:18:56 +00:00
Andy Balaam
36ddd5eae5 Ensure the incoming verification request appears above the please verify prompt (#32931) 2026-03-30 13:32:51 +00:00
Andy Balaam
29c24f1f89 Provide the Learn More link for verify_toast_description (#32857)
* Provide the Learn More link for verify_toast_description

* Screenshot test for verify this device toast
2026-03-19 13:54:06 +00:00
Andy Balaam
d18aa31d7d Change 'Verify' to 'Continue' in verify this device toast (#32813) 2026-03-16 15:07:57 +00:00
Andy Balaam
1c2441bc76 Reset key storage if restoring from Recovery encounters the wrong decryption key (#32668)
* Set up the MatrixClient before each RecoveryPanelOutOfSync test

Without this, we can't override MatrixClient methods until we've called
`renderComponent`, which is awkward.

* Actually test that we load the decryption key in RecoveryPanelOutOfSync

It turns out the existing test didn't actually go down the expected code
path and call loadSessionBackupPrivateKeyFromSecretStorage.

* Reset key storage if restoring from Recovery encounters the wrong decryption key

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

Depends on https://github.com/matrix-org/matrix-js-sdk/pull/5202

When we try to load the key storage decryption key from Recovery, but we
find that it does not match the public key of the current key storage
backup, create a new key storage backup.
2026-03-05 10:47:50 +00:00
Michael Telatynski
91a3cb03c1 mv element.io @types __mocks__/ debian docker module_system/ playwright res src test webapp Dockerfile .dockerignore .eslintignore .stylelintrc.cjs babel.config.cjs recorder-worklet-loader.cjs .modernizr.json components.json config.json config.sample.json package.json project.json tsconfig.json tsconfig.module_system.json jest.config.ts playwright.config.ts webpack.config.ts build_config.sample.yaml apps/web/
mkdir apps/web/scripts
mv scripts/{cleanup.sh,ci_package.sh,copy-res.ts,deploy.py,package.sh} apps/web/scripts

And a couple of gitignore tweaks

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2026-02-24 15:43:58 +00:00