Skip to content

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

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

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

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

@mvanhorn mvanhorn commented Apr 21, 2026

Description

Adds an optional callOptions.autoLeaveWhenOthersLeft field to the Sable client config. When set, CallEmbed passes the matching autoLeave query param to the Element Call widget URL; when absent, behavior is unchanged.

Fixes #706

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

AI disclosure:

  • Partially AI assisted (clarify which code was AI assisted and briefly explain what it does).
  • Fully AI generated (explain what all the generated code does in moderate detail).

Claude Code scaffolded the CallOptions type + the autoLeave parameter plumbing across useClientConfig.ts, CallEmbed.ts, and useCallEmbed.ts; I checked the flow end-to-end: admin config field -> createCallEmbed -> getWidget -> URL param, and confirmed the default path with callOptions absent adds nothing to the URL.

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
@nushea
Copy link
Copy Markdown
Contributor

nushea commented Apr 21, 2026

Hi, thank you so much for contributing and i want to say that it is not a large change so its not as relevant but could you please follow the PR template

@mvanhorn
Copy link
Copy Markdown
Contributor Author

Thanks @nushea - tightened the PR body to match the template more closely: shortened Description to the single-line summary the template asks for, kept Fixes #706 on its own line, and trimmed the AI disclosure note to just the sections that were AI-scaffolded. Let me know if there's anything else you'd like cleaned up.

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

2 participants