Skip to content

Add togglable autoLeave to call config (#706)#707

Open
mvanhorn wants to merge 1 commit intoSableClient:devfrom
mvanhorn:feat/706-call-auto-leave-config
Open

Add togglable autoLeave to call config (#706)#707
mvanhorn wants to merge 1 commit intoSableClient:devfrom
mvanhorn:feat/706-call-auto-leave-config

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

Summary

Adds an optional callOptions section to the Sable client config so admins can opt out of Element Call's default "auto leave when all other participants leave" behavior.

Closes #706

Why

Element Call exposes an autoLeave URL parameter that defaults to true for DM-style calls; Sable currently hardcodes the widget URL in src/app/plugins/call/CallEmbed.ts and never passes it, so there's no way to override the default. Issue #706 asks for a config-driven toggle.

Changes

  • src/app/hooks/useClientConfig.ts: new CallOptionsConfig type + optional callOptions on ClientConfig.
  • src/app/plugins/call/CallEmbed.ts: export a CallOptions type; getWidget accepts an optional callOptions argument and, when autoLeaveWhenOthersLeft is defined, sets the autoLeave URL parameter to that boolean as a string.
  • src/app/hooks/useCallEmbed.ts: createCallEmbed forwards callOptions; useCallStart reads clientConfig.callOptions and threads it through.

Default behavior is unchanged when callOptions is absent.

Usage

{
  "callOptions": {
    "autoLeaveWhenOthersLeft": false
  }
}

Testing

  • npx tsc --noEmit clean.
  • npx eslint clean for the touched files (two pre-existing no-console warnings elsewhere in CallEmbed.ts are not from this change).
  • npx prettier --check clean.

Element Call supports an autoLeave URL parameter that controls whether
a call auto-terminates when all other participants leave. Sable was
never forwarding it, so the Element Call default (true for DM-style
calls) always applied with no way to override.

This adds an optional callOptions section to the client config with
an autoLeaveWhenOthersLeft boolean. When set, it flows from
useClientConfig -> useCallStart -> createCallEmbed -> CallEmbed.getWidget,
which translates it into the autoLeave URL parameter. When absent, the
current behavior is unchanged.

Example config.json:

  "callOptions": {
    "autoLeaveWhenOthersLeft": false
  }
@mvanhorn mvanhorn requested review from 7w1 and hazre as code owners April 21, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Togglable autoLeave in config.json

1 participant