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

6 Commits

Author SHA1 Message Date
Timo
5fae057a60 Element call as a react component (#34935)
* Add an end-to-end Element Call test with a real MatrixRTC backend

Element Web's Playwright coverage of Element Call has only ever used a stand-in:
`sample-files/fake-element-call.html`, a page that does just enough for the widget
plumbing to be exercised. Nothing in the suite has ever carried media.

This adds one real call between two users, through the Element Call the build under
test ships (`@element-hq/element-call-embedded`, copied to `widgets/element-call/`),
against a real MatrixRTC backend:

- `testcontainers/livekit.ts` — a LiveKit SFU advertising loopback so the browser
  reaches it through published ports on macOS as well as Linux.
- `testcontainers/lk-jwt-service.ts` — the authorisation service, validating OpenID
  tokens over Synapse's federation API.
- `testcontainers/matrix-rtc.ts` — starts the two and produces the Synapse
  configuration that announces the transport (MSC4143) and enables the MSCs Element
  Call needs.
- `services.ts` — a `matrixRTC` worker option turning all of that on.

`routeConfigJson` no longer hard-codes the dev server's origin: it resolves
`config.json` against the context's `baseURL`, so a `BASE_URL` other than the default
works, and other origins a test loads keep their own.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Make Renovate actually see the new testcontainer images

The custom manager's `depName` group is `[^@]+`, which matches newlines and
quotes, so it is only bounded by the next `@` in the file. In `synapse.ts` and
`mas.ts` an `@element-hq/…` import happens to sit above the image literal and
caps it; `livekit.ts` and `lk-jwt-service.ts` import `testcontainers` and `yaml`,
so the match instead starts at that import and swallows everything up to the
image name. Renovate gets a nonsense package name, finds nothing, and the pins
quietly rot.

Exclude quotes and whitespace from both groups. All four digest-pinned files now
extract correctly, synapse and mas unchanged.

Bump lk-jwt-service to 0.7.0 while here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Address the bundled Element Call by directory, not by index.html

The full-call spec passed against the webpack dev server and failed in CI, where
the production build is hosted by `serve`.

`ElementCall.generateWidgetUrl` built `./widgets/element-call/index.html#…`.
`serve` has `cleanUrls` on by default, so it 301s that to the extensionless
`/widgets/element-call`. Element Call's `index.html` references its chunks
relatively (`./assets/…`), and against a base with no trailing slash the browser
resolves those to `/widgets/assets/…` — 404. Element Call never boots, so the
lobby never appears and the test times out.

Address the directory instead. It is the same deployment, the trailing slash
sidesteps the redirect, and the hash is overwritten further down either way. This
is not only a test concern: Netlify also strips `.html` by default, and that is
what serves the PR previews and develop.element.io.

Doing it here rather than in the spec keeps the test honest — it exercises the
widget URL Element Web really generates, with no `Developer.elementCallUrl`
override. Setting `cleanUrls` in a `serve.json` was the other candidate and is
not viable: any value other than the default also stops `serve` resolving `/` to
`index.html`, which breaks every other test.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* EC react component Plan

* The implemantation Element Call React Component with mocked EC react
component

* final plan

* tests

* update plan to not do e2e tests in EW but in EC

* Start using the real react component instead of the mock (activation
react EC)

* add playwright e2e tests

* fix transport discovery (pass in via config. Hack the well-known source
for servers not supporting get_transports)

* stylesheet fixes

* Update element-call-react-plan.md

* add docuemnt pip

* Depend on the Element Call component from its git branch

`@element-hq/element-call-component` was a `link:` to a hand-built
`dist/` in a machine-local worktree. It is now a git dependency on the
`component` directory of element-hq/element-call, on the
`valere/component_ec_M1` branch (element-call#4233), whose `prepare`
script builds the component on install; pnpm has to be allowed to run
it (`allowBuilds`). The ref goes back to `main` once that PR has merged.

The branch first needs the commit that adds the component's manifest
and build (`toger5/component-package-manifest` in the EC checkout);
until it is pushed, `path:/component` resolves to no manifest and the
lockfile keeps the old `link:` entry. Both are written up in the plan.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* use the component_ec_m1 dep lock file entries

* fix element call reloading

* pass the right theme to element-call component

* bump element-call-component

* Return a call from the browser PiP window to where it left from

Closing the Document Picture-in-Picture window always dropped the call
into Element Web's floating PiP, even when it had filled the room's call
view a moment earlier and the user was still looking at that room.

The store now remembers whether the call left from the call view, and
on release opens the call view again when it did — unless the call has
ended, the user has moved to another room, or the user opened the call
view themselves (which is what closed the window). A call that was
floating in Element Web's PiP before goes back there, as it did.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Draw the call header's outline icons a little smaller

The room header's icons are Compound's solid set, but minimise,
maximise and pop-out exist only as outlines: Compound has no filled
counterparts, and nothing else in the set says what they say. At the
solid icons' size their open strokes look heavy-handed next to them.

Scaling the glyphs down slightly inside the buttons lets them sit
comfortably next to their neighbours without changing the buttons'
footprint.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Hand a persisted tree to the remaining placeholder on unmount

When two PersistedElements for the same key mount in one React commit
(a call returning from the browser PiP window into the call view, while
Element Web's floating PiP briefly shows it as well), whichever rendered
the tree last owns the child's ref. If that one is then the one to
unmount, it hid the tree, and the survivor, never having been handed the
child, could not show it again.

On unmount, if another placeholder is mounted, render the tree once more
with the most recently mounted survivor's wrapper so it takes over the
child and positions it; only hide the tree when nothing is left to show
it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Adjust to updates done in EC
(simpler public api. More resilient to prop changes)

* package.json back to EC branch valere/component_ec_M1

* fix closing in component mode

* Configure pnpm store location in workflows

Keep the pnpm store out of node_modules to prevent incorrect
bundling of element-call-component when building git dependencies.

* update docs on EC packaging improvements

* fix ci

* Update pnpm-lock and tsconfig

* Move the browser Picture-in-Picture window and call header changes to a follow-up

Keeps this PR to Element Call as a React component. The Document
Picture-in-Picture window (DocumentPipStore, useDocumentPip, the
PersistedElement detach/reattach and placeholder hand-over, the
PipContainer awareness of it), the call header's minimise, maximise and
pop-out buttons with their outline-icon sizing, the browser API typings,
their strings, tests and e2e spec move to toger5/ec-document-pip.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* bump to main branch EC

* fix CI failing due to pnpm store

* remove docs and dev journals

* review

* CI: silence zizmor's github-env finding on the pnpm store action

zizmor flags every $GITHUB_ENV write inside a composite action, because it
cannot see which triggers the action will be used from. The value written
here is a constant built from RUNNER_TEMP with nothing attacker-controlled
in it, so suppress the finding the way the repo does elsewhere.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Keep the ready promise's rejection from going unobserved

close() rejects the pending ready promise so that a start() still waiting on
the component learns the call went away instead of hanging until the timeout.
Usually nothing is waiting, and the unobserved rejection then surfaced as an
unhandled promise rejection, which crashed the Vitest worker running
Call.test.ts. Mark the promise as handled before rejecting it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* review

* review: double import

* move types to EC repo (just import them here)

* review: refactor ElementCallAppTile to a MVVM shared compoenent

* merge useEffectiveTheme and useTheme hooks

* cnvert the ElementCallMock to MVVM

* use unstable EC branch. DO NOT MERGE UNTI THIS COMMIT IS REVERTED
this branch is used to test CI with the new exports from EC.
We need to first merge:
https://github.com/element-hq/element-call/pull/4269 before we can put
this back to main (revert this commit).

* Move Node and pnpm setup into a single action

The setup-node-pnpm action now includes pnpm/action-setup and
actions/setup-node alongside the store relocation, eliminating
boilerplate across workflows and fixing the setup order in one place.

* fix broken lock file

* test for review change "reject on promise race"

* review: letter spacing

* Import the EC CSS layered

* Use self-repository syntax

* Fix import path

* Fix webpack

* Revert actions syntax as Sonar doesn't seem compatible with it

* Switch to Flex

* Switch to a11y label

* Take client from SdkContext

* Make strings in mock view translatable

* Keep class names in EW

* Move mock view to shared components and add stories

* Exempt voip|element_call_mock|title

* Fix tests

* Clarify doc string

* Add labs.md entry

* Use text element

* Remove redundant test

* Remove redundant test

* Delint

* Format

* Update snapshots

* Bump element-call

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-09-25 15:12:19 +00:00
hayyaksi
fc0f0d4e61 Restore the read marker fade by using a valid CSS easing function (#34485)
* Restore the read marker fade by using a valid CSS easing function

* Drop postcss-easings

The read marker was the last thing that could have used a named easing, and
its style now lives in shared-components, which vite builds without the
plugin. Nothing in the tree names an easing any more, so the plugin, its type
shim and the dependency all go.
2026-08-12 14:11:05 +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
Sirius
84653bb416 Sending URL Preview Bundles (MSC 4095) (#34150)
* Fetches link previews for all links in message (instead of just the first one)

* message url component to display preview for multiple urls

* Revert visible behaviour back to only showing one URL preview

While fetching all link previews in the text message.

* Moved URL preview VM to MessageComposer

* Added com.beeper.linkpreviews to messages sent with the markdown compositor

* MSC 4452 implemented for the older (markdown) composer

* claude told me to use logger instead of console

* Previews generated with snapshot instead of vm

* moved attachPreviews to a separate file

* added attach URL previews to rich text editor

* don't let attachUrlPreviews block clearning the composer

* fixed linter errors

* moved url preview behind labs feature gate

* passed linters

* moved lab feature checking to where attach preview is used

* claude wrote some unit tests for url previewing

* fixed linter errors

* added feature to labs.md

* fixed linter errors

* fixed oxfmt error

* set previews to none if all previews failed

* resolved PR reviews besides the ones that requires a larger code change

* moved url preview VM creation to message composer

* removed delay when clearing composer url preview on message send

* minor changes to stop using globals everywhere

* moved debouncing responsibility to urlpreviewVM

* minor lint fixes

* added comment

* remove composer content from the state of urlpreview, moved it to the vm

* urlpreviewwrapper depends on the vm only

* added comments

* edited the comment

* updated snapshots

* claude fixed tests

* enable feature for tests that requires MSC4095

* updated snapshot
2026-07-13 15:31:18 +00:00
renovate[bot]
793c4ff110 Update css (#32552)
* Update css

* Patch weak types in postcss-mixins

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>
2026-03-20 15:17:07 +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