* Very first pass at shared component views
Turn the trivial TextualEvent into a shared component with a separate view
model for element web. Args to view model will probably change to be more
specific and VM typer needs abstracting out into an interface, but should
give the general idea.
* Remove old TextualEvent
* Pass showHiddenEvents
Because we used it anyway, we just cheated by getting it from the context
* Factor out common view model stuff
* Move ViewModel interface into the shared components
* Add tiny wrapper hook
* Move showHiddenEvents into props fully
* Fill in stories / test
* chore: setup storybook
cherry pick edc5e87056
from florianduros/storybook
* Add TextualEvent component to storybook
* Add mock view model & snapshot
* Remove old style stories entry
* Change import
* Change import
* Prettier
* Add paxckage patch to @types/mdx
for React 19 compat
* Pass getSnapshot as getServerSnapshot too
* Maybe make sonar regognise tests as tests
* Typo
* Use storybook reacvt-vite
There's no reason to use the react-webpack plugin just because our app
is stuck on webpack, it just means we have vite as a dependency too.
* Change here too
* Workaround for incomatible types in rollup
https://github.com/rollup/rollup/issues/5199
* Remove webpack styling addon
Not necessary now we're using vite
* Hopefully do screenshot testing...
* need newer node
* quote issues
* Make it an npm script
* colons
* use right port
* Install playwright browsers
* Try without the if
* Oh right, we need the headless shell
* Pass flag to store received screenshots
and upload diffs too
* Update snapshot from received
* Include platform in snapshot / received dir
because font rendering differs between platforms
* Suffix snapshots with platform instead
like we do for playwright
* Remove unnecessary env vars
and better name
* Add some comments
* Prettier
* Fix yarn.lock
* Memoise vm creation
Co-authored-by: Florian Duros <florianduros@element.io>
* Add implements
Co-authored-by: Florian Duros <florianduros@element.io>
* Fix listener interface
* Add implements
Co-authored-by: Florian Duros <florianduros@element.io>
* Fix types
* Fix more types
* Revert useMemo
as this isn't a hook
* Unused import
* Add missing playwright step
* Add return type annotation
* Change to add / remove subscription callback
* Change to 'add' rather than 'subs.subscribe'
* Add cache specifier for only shell playwright browsers
* Add copyright headers
---------
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
Co-authored-by: Florian Duros <florianduros@element.io>
* Apply lint rule @typescript-eslint/no-empty-object-type
To avoid the footgun that is https://www.totaltypescript.com/the-empty-object-type-in-typescript
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Switch to React18 useId
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Enable react-compiler eslint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix an easy one
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Disable in tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix usage of useRef as memoization
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix mutation of external values in hooks
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Make React compiler happy about some frankly non-issues
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix MapMock
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Revert MemberListViewModel.tsx changes and disable linter per line
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Make viewmodel compatible with react-compiler linter
- Remove searchQuery ref/state and instead pass this query to the
loadMember function.
- Now we no longer need a separate search function
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: R Midhun Suresh <hi@midhun.dev>
* Upgrade to latest compound-web package
* Use a custom render function for jest tests
This way we don't need to manually wrap our components with
<TooltipProvider>
* Pin wrap-ansi to fix broken yarn install
* Add playwright helper to find tooltip from element
and use it in the failing test
* Exclude floating-ui divs/spans from axe testing
This is rendered outside .MatrixChat by compound and contains all the
tooltips.
* Wrap outermost components with TooltipProvider
* Remove onChange and use onSelect for toggle
* Fix jest tests and update snapshots
* Use vector-im/matrix-wysiwig
---------
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Replace `MatrixClient.keyBackupKeyFromRecoveryKey` by `decodeRecoveryKey`
* Replace `MatrixClient.isValidRecoveryKey` by local check with `decodeRecoveryKey`
* Replace old `decodeRecoveryKey` import
* Remove `matrix-js-sdk/src/crypto/recoverykey` import of eslint exception
* Add tests for `RestoreKeyBackupDialog`
* Don't consider textual characters to be emoji
We were using emojibase-regex to match emoji within messages. However, the docs (https://emojibase.dev/docs/regex/) state that this regex matches both emoji and text presentation characters. This is not what we want, and will result in false positives for characters like '↔' that could turn into an emoji if paired with a variation selector. Unfortunately, none of the other regexes provided by Emojibase do what we want either (https://github.com/milesj/emojibase/issues/174). In the meantime, browser support for the RGI_Emoji character sequence class has made it feasible to write an emoji regex by hand, so that's what I've done.
* Add a fallback for BIGEMOJI_REGEX as well
* `DecryptionFailureTracker`: stronger typing
Use `DecryptionFailureCode` rather than string
* `DecryptionFailureTracker`: remove use of `DecryptionError`
The second argument to `MatrixEventEvent.Decrypted` callbacks is deprecatedf,
and we can get the info we need direct from the event. This means that we no
longer need to reference the internal `DecryptionError` class in the js-sdk.
* `DecryptionFailureTracker`: use a different Posthog code for historical UTDs
* Update for new UTD error codes
* Use test helpers from js-sdk for encrypted events
Rather than gut-wrenching into the matrix-js-sdk, let's use the newly-exported
test helpers to generate encrypted events.
* Fix up
* Fix references to `crypto-api/verification`
This is supposed to be an internal module; use the front door instead.
* `IRecoveryKey` -> `GeneratedSecretStorageKey`
`IRecoveryKey` is just a backwards-compatibility alias for
`GeneratedSecretStorageKey`
* `ISecretStorageKeyInfo` -> `SecretStorage.SecretStorageKeyDescription`
Again, same thing
* `IPassphraseInfo` -> `SecretStorage.PassphraseInfo`
* Remove unused import restriction exceptions
* Switch to importing TypedEventEmitter from main js-sdk export
* Switch to importing js-sdk/matrix in cypress
* Remove duplicated imports
* Fix lint:js-fix to run prettier last otherwise ESLint --fix may cause a mess
* Add lint rule
* Switch to importing models/Room from main js-sdk export
* Switch to importing models/room-state & models/room-member from main js-sdk export
* Fix cypress-axe import
* Fix more imports
* Fix cypress-axe import
* Fix bad merge
* Switch to importing TypedEventEmitter from main js-sdk export
* Switch to importing js-sdk/matrix in cypress
* Remove duplicated imports
* Fix lint:js-fix to run prettier last otherwise ESLint --fix may cause a mess
* Add lint rule
* Switch to importing models/Room from main js-sdk export
* Fix cypress-axe import
* Fix more imports
* Fix cypress-axe import
* Fix duplicated lint rule
* Switch to importing TypedEventEmitter from main js-sdk export
* Switch to importing js-sdk/matrix in cypress
* Remove duplicated imports
* Fix lint:js-fix to run prettier last otherwise ESLint --fix may cause a mess
* Add lint rule
* Fix cypress-axe import
* Fix cypress-axe import