* Remove vm related code from element-web/src
* Add and export view model code from package
* Update imports
* Rewrite vm tests using vitest
* Add github action to run vm tests
* Fix lint errors
* Mvoe tests over to jest
* Try fixing code coverage
* Second attempt at fixing code coverage
* fix: update jest config with new shared components path
* fix: update sonar config
* chore: add `storybook` & `@storybook/react-vite` to run the shared components tests
* Update dependency uuid to v13
* Make jest happier
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Remove redundant @types package
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Add support for Module API 1.3.0
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Add missing import
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>
* Fix import
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Bump module API
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update module API and remove jest stub
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix test mocks
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve coverage
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* types
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Coverage
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Coverage
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* 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 edc5e8705674b8708d986910b02b5d2545777fb3
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>
* Add commercial licence and update config files
* Update license in headers
* Revert "Update license in headers"
This reverts commit 7ed7949485e88889a9ffc8075a9df1f8e936777e.
* Update only spdx id
* Remove LicenseRef- from package.json
LicenseRef- no longer allowed in npm v3 package.json
This fixes the warning in the logs and failing build check.
* Remove Twemoji SBIX font in favour of COLRv0
as it is supported everywhere we need it
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Remove unused mock
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* 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>
* Use WebAudio API to play notification sound
So that it won't appear in system media control.
* Run prettier
* Chosse from mp3 and ogg
* Run prettier
* Use WebAudioAPI everywhere
There's still one remoteAudio. I'm not sure what it does. It seems it's
only used in tests...
* Run prettier
* Eliminate a stupid error
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update setupManualMocks.ts
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* delint
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>
* mocks
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* mocks
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>
* Simplify
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* covg
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Upgrade compound-web
I forgot to include this in https://github.com/matrix-org/matrix-react-sdk/pull/12209, which has caused avatar and username colors to be out of sync and sometimes revert to plain black/white.
* Update tests
* Update tests
* Add mechanism to check only one instance of the app is running
This isn't used yet, but will form part of the solution to
https://github.com/vector-im/element-web/issues/25157.
* disable instrumentation for SessionLock
* disable coverage reporting
* exclude SessionLock in sonar.properties
* Revert "disable coverage reporting"
This reverts commit 80c4336f76ec8e47e376b6744ef612a73299d14f.
* only disable session storage
* use pagehide instead of visibilitychange
* Add `checkSessionLockFree`
* Give up waiting for a lock immediately when someone else claims
* Update src/utils/SessionLock.ts