* Allow the Login screen to use the dark theme
There is a whole bunch of code dedicated to attempting to force a "light" theme
onto the login view, even if the deployment is configured to prioritise the
dark theme.
Apparently this was done because, in the old days, the
login view looked rubbish with the dark theme, but now it looks fine.
Fixes https://github.com/element-hq/element-web/issues/31292
* Fix up background colour of auth screen in dark theme
In dark theme, the background of the login/register/welcome box needs to be
translucent black rather than translucent white.
To make this work, I've moved the style from inline to CSS, and used a PostCSS
variable to define the colour.
* Fix up Welcome page colours in dark theme
Make the text and image white, not black, in short.
* Fix incorrect merge
that will teach me to use the Github UI to address merge conflicts.
Because RoomViewStore used two slightly different conditions, the Call.presented flag could get out of sync with the viewingCall flag. But these should effectively be the same thing.
This was causing some subtle bugs if you would join a call, switch to another room, and then click back into the call room via the room list. The call would be visible but not know that it's presented, causing:
1. The hangup sound to get cut off at the end of the call
2. The widget to disappear immediately without offering a 'reconnect' button if you lose connectivity
* feat: implement `ExtrasApi#setRoomIdsForSpace`
* fix: message reply with multiple room views
* fix: message edition when multiple rooms are displayed
* test: check that the view room action is not dispatch when replying
* test: check that the view room action is not dispatch when editing
* refactor: use `ExtraApis#getVisibleRoomBySpaceKey` instead of `ExtraApis#setRoomIdsForSpace`
* test: update tests to use `getVisibleRoomBySpaceKey`
* add function to pause device listener
* add function to check if key backup key missing both locally and in 4s
* reset backup if backup key missing both locally and in 4s
* fixup! add function to check if key backup key missing both locally and in 4s
* Drop KEY_STORAGE_OUT_OF_SYNC_STORE in favour of checking cross-signing
Check if cross-signing needs resetting, because that seems to be what
KEY_STORAGE_OUT_OF_SYNC_STORE is actually trying to do.
* add a function for resetting key backup and waiting until it's ready
* trigger key storage out of sync toast when missing backup key locally
and fetch it when user enters their recovery key
* reset backup when needed if user forgets recovery key
* rename function as suggested in code review
* Remove unreachable code
`view_last_screen` is never used.
* Remove unused action `user_activity_started`
Nothing listens to this, so it's pointless.
* Symbolic constant for `Action.UserActivity`
* Define symbolic constants for more `Action`s
Constants for some actions that are emitted by `Lifecycle`
* Rename callback on E2eSetup component
`BaseDialog.onFinished` is unused when `hasCancel=false`, so this callback is
only used when the user clicks cancel. For clarity, rename it.
* Test for cancellation behaviour
* feat: add options to hide right panel in room view
This option is added for the module API.
* test: add test for hideRightPanel=true of room view
* test: update snapshot ids
* Add voiceOnly options.
* tweaks
* Nearly working demo
* Lots of minor fixes
* Better working version
* remove unused payload
* bits and pieces
* Cleanup based on new hints
* Simple refactor for skipLobby (and remove returnToLobby)
* Tidyup
* Remove unused tests
* Update tests for voice calls
* Add video room support.
* Add a test for video rooms
* tidy
* remove console log line
* lint and tests
* Bunch of fixes
* Fixes
* Use correct title
* make linter happier
* Update tests
* cleanup
* Drop only
* update snaps
* Document
* lint
* Update snapshots
* Remove duplicate test
* add brackets
* fix jest
* Improve screen reader accessibility of auth pages
Using a combination of auto-focus + aria-live to ensure content is read as the states progress
For https://element-io.atlassian.net/browse/PSB-971
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update snapshot
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update snapshots
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix double landmark
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update screenshot
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update jest to v30
* Update jest to v30
* Update snapshots
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Apply jsdom patch
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix tests
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>
* Apply aria-hidden to emoji in SAS verification
So that for screen readers the canonical emoji description is preferred & we avoid the user being read each emoji twice.
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update snapshot
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* feat: add props to hide header in `RoomView`
* feat: add props to hide composer in `RoomView`
* feat: pass `RoomViewProps` to room view in `renderRoomView`
* refactor: add doc and use existing types
* test: add tests for new room view props
* strip mentions from forwarded messages
fixeselement-hq/element-web#30883
* call attachMentions() for empty m.mentions in forwarded messages
As there is no EditorModel, attachMentions() currently does nothing
* fix lint and typecheck
* update test "should be navigable using arrow keys"
* update test "forwards pin drop event"
add empty mentions to expected content
* add doc to transformEvent() & elaborate on attachMentions()
* add test "strips mentions from forwarded messages"
* fix lint
* update source of `attachMentions()` import
---------
Co-authored-by: David Baker <dbkr@users.noreply.github.com>
* Module API experiments
* Move ResizerNotifier into SDKContext
so we don't have to pass it into RoomView
* Add the MultiRoomViewStore
* Make RoomViewStore able to take a roomId prop
* Different interface to add space panel items
A bit less flexible but probably simpler and will help keep things
actually consistent rather than just allowing modules to stick any
JSX into the space panel (which means they also have to worry about
styling if they *do* want it to be consistent).
* Allow space panel items to be updated
and manage which one is selected, allowing module "spaces" to be
considered spaces
* Remove fetchRoomFn from SpaceNotificationStore
which didn't really seem to have any point as it was only called from
one place
* Switch to using module api via .instance
* Fairly awful workaround
to actually break the dependency nightmare
* Add test for multiroomviewstore
* add test
* Make room names deterministic
So the tests don't fail if you add other tests or run them individually
* Add test for builtinsapi
* Update module api
* RVS is not needed as prop anymore
Since it's passed through context
* Add roomId to prop
* Remove RoomViewStore from state
This is now accessed through class field
* Fix test
* No need to pass RVS from LoggedInView
* Add RoomContextType
* Implement new builtins api
* Add tests
* Fix import
* Fix circular dependency issue
* Fix import
* Add more tests
* Improve comment
* room-id is optional
* Update license
* Add implementation for AccountDataApi
* Add implementation for Room
* Add implementation for ClientApi
* Create ClientApi in Api.ts
* Write tests
* Use nullish coalescing assignment
* Implement openRoom in NavigationApi
* Write tests
* Add implementation for StoresApi
* Write tests
* Fix circular dependency
* Add comments in lieu of type
and fix else block
* Change to class field
---------
Co-authored-by: R Midhun Suresh <hi@midhun.dev>
* Make shared component build work in isolation
* Add deps that were missing because they were getting picked up
from element-web main but shared-components needs itself
* Exclude test files from dts generation
* Bump version
* Change all the shared-component import to be the built artifact
* Don't randomly inhale eslint configs in parent dirs please
* maybe we don't need this anymore?
* maybe fix build
* Maybe fix docker build
* More build faff
* build:res on the parent as part of shared component prepare
* link shared component repo inn docker build
* 💅
* 💅x2
* Try converting the translation keys to a .d.ts file manually
so it gets bundled rather than left as a relative import to the json
file
* add the script
* Add this back for 2nd time now I think
* Shouldn't need this anymore
* patch-package on prepare
because we're patching a dev dependency so it won't be there if we're
installed as a dependency
* Unused import
* Prettier compliance
* Only use counterpart from shared components
as per comment
* Import shared components CSS
* Prettier
* Call the one from shared components
rather than recurse infinitely
* Hopefully make tests work
* wake up, comment goes before import
* Fix lint errors
* Fix dupe TranslationKey export
* Update compound-web to fix type error
An update to @types.react adds the 'hint' value to the enum of the
'popover' attribute and this version of compound-web uses the maching
verson of @types/react so they don't conflict.
* Maybe, hopefully, get the types working?
Please?
* Add copyright header to i18nkeys
as eslint complains otherwise since it's now in src
* prettier
* stop running shared-component tests in EW
* update snapshots
because flex is now from an external stylesheet I guess
* More snapshots
* Manual class update
* Avoid bundling compound bits
Because a) it's silly and b) it means we end up bundling a copy of
floating-ui too which causes absolute madness with its useDelayGroup
contexts.
* ignore test util files for coverage
* Add !important
because the styles are being applied in a different order now
* Another !important because css order has changed
* Try adding it here to make the test files ignored
* More !important
* commit yarn lock change
* Add shared components coverage file
* Update snapshots
Because the line height was being overridden to 22.5px somehow by
something I can't find, and now isn't: surely the normal 1.5rem is
more sensible.
* Update snapshots, attempt 2
* Another !important
* More snapshot updates
* Add test for i18n wrappers
& add test script
* lint
* Prettier
* Hopefully run shared component tests
* don't need this bit for non-matrix
* install ew deps
* rigfht coverage location
* Rename job here too
* Try different coverage filename
* Fix copyrights & comment
* Typo
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Only set active descendant when the user starts typing.
* Fix jest tests.
* Remove aria-hidden
It was failing code quality checks and it actually wasn't addressing the issue.
* Only show highlight on arrow key navigation or updating the search query.
* Update screenshots
* Enter should not select an emoji if it is not highlighted.
* On clearing a query and using arrow kets again the highlighted emoji should be reset to the first.
* Update selector in picker tests
* Fix tooltips within context menu portals being unreliable
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update snapshots
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Add test
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* fix(list view): avoid re-create `onFocus` function at each render of the child items
* fix(room list): update `onFocus` signature
* fix(member list): update `onFocus` signature
* fix(room list): avoid re-render at the beginning and end of the scroll
* test(room list): remove scrolling test and props
* test(member list): update member tile view tests
* test(room list): update `ListView` focus test
* test(member list): add `onFocus` test for member list tile
* We should focus the node in the DOM so that the browser focus(with outline) matches the our internal RovingIndex state
* Don't move focus from the input if we are in "virtual" focus(via active descendant)
* add devtool for viewing users and their devices
* show number of devices
* apply changes from review
* Fix typo
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Show timestamps when keyboard focus is within an event tile
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Ensure toolbar navigation pattern works in MessageActionBar
This requires all buttons within to be roving by using the ref callback given by useRovingTabIndex
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Use PureComponent in EventTile to avoid mass re-rendering due to transitive onFocus/onBlur calls
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Remove unused timestamp event tile prop
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Use MessageTimestamp to generate the wrapping anchor so that focusing it brings up the tooltip
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Tweak MessageTimestamp
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Switch back to Component as we specify a shouldComponentUpdate already
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update jest tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update playwright timestamp masks
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Revert snapshot
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update snapshot
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix IRC layout
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Use PureComponent in EventTile to avoid mass re-rendering due to transitive onFocus/onBlur calls
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Remove unused timestamp event tile prop
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Use MessageTimestamp to generate the wrapping anchor so that focusing it brings up the tooltip
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Tweak MessageTimestamp
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Switch back to Component as we specify a shouldComponentUpdate already
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update jest tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update playwright timestamp masks
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Revert snapshot
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update snapshot
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix IRC layout
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Lint styles
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix layout picker
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update snapshots
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update screenshots
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix pcss comment
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate Playwright
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate Playwright
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Pass roomViewStore to the RoomView and add to the RoomContext.
* lint
* lint
* Make constants more DRY
* Make constants more DRY
* Commend non-null assertion on roomViewStore property of the RoomContext
* Update tsdocs.
* Fix sort order in space hierarchy
To match spec and not add unexpected sorting by space vs room
* Update SpaceHierarchy.tsx
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update snapshot
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Add test
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update snapshot
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix highlights in messages (or search results) breaking links
Fixes#17011 and fixes#29807, by running the linkifier that turns text into links before the highlighter that adds highlights to text.
* Fix jest test
* Fix tests related to emojis and pills-inside-spoilers
* Remove dead code
* Address review comments around sanitizeParams
* Address review comment about linkify-matrix
* Fix code style
* Refactor if statement per review
---------
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Change module API to be an instance getter
Helps with circular dependencies by not instantating the module API
on the initial evaluation of the files.
* Add basic test
* add another test
* fix: same member count in header and member list
* test: update test
* chore: use `useRoomMemberCount` to compute member count in member list
* test: add event emitter function on mocked `room.currentState`
* Move ResizerNotifier into SDKContext
so we don't have to pass it into RoomView
* Fix test
* Unused import
* Add tests
* Remove a bunch of resizeNotifier props
* Remove more resizeNotifier props
* Add resizenotifier to test
* Add more sdkcontext wrappers in tests
* More sdkcontext wrappers
* Even more sdkcontext wrappers
* Add test to make sonarcloud happy
* Context isn't always there unlike props
* Test actual resizing too
* Remove commented line