Skip to content

UrlParams: Intend system update, split into configuration and propreties #3376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: livekit
Choose a base branch
from

Conversation

toger5
Copy link
Contributor

@toger5 toger5 commented Jun 30, 2025

Needed for implementing #3372 more cleanly

This PR updates the intend system. We want to solve this before starting on the telephone usecase implementation to prohibit us needing to make too many rust-sdk PR's and to converge to a solution we think brings the best benefits to maintain the url paramters.

This solution tries to get us the most features from this list:

  • Authority in EC (change all platforms at once)
  • Flexible usage of EC in other clients (secondary)
  • Very simple/fast setup on EX (one prop preferably)
  • As much transparency as possible (intent -> changes things the dev did not know about anymore) No time should be wasted on: “was this handled by an intent, do i need to look into the intent description, or do i need to look through feature list”
  • No artificial entanglement (flexibility) If the intent “telephoneOneOnOne” controls “autoleave” (for example) we will always get “startUnmuted” if we want autoleave. Sometimes only one of them is desired.
  • (off topic but related) We want EC to feel like a custom react component with properties. It can execute functions (send call member event, encryption keys) but things like “sendNotifyEvent” might be configurable as params

By implementing intends with a "preset" architecture:

  • The intend is optional and it is possible to tweak each individual configuration
  • Each intend is a list of presets that also adapt based on platform
  • Web + EX configurations should only set the intend and keep all the other options blank. So everything can get controlled in the EC codebase.
  • It is still possible to provide an intend but overwrite a subset of the configuration properties via individual query parametrs.

This PR changes:

  • remove all deprecated fields
  • split the url parameters into UrlProperties and UrlConfiguration (configuration are the ones where you can skip with one intend, properties are always required)

@toger5 toger5 added the PR-Developer-Experience Release note category. A PR that does not change EC but improves working with the repository. label Jun 30, 2025
@toger5 toger5 marked this pull request as ready for review July 1, 2025 08:27
@toger5 toger5 requested a review from a team as a code owner July 1, 2025 08:27
@toger5 toger5 requested a review from robintown July 1, 2025 08:27
// behavior to the needs of specific consumers.
export interface UrlParams {
/**
* This UrlProperties contains as the properties that are used by to pass required data to the widget.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* This UrlProperties contains as the properties that are used by to pass required data to the widget.
* This UrlProperties contains the properties that are used by applications to pass required data to the widget.

Comment on lines +141 to +142
* and configure the behavior of the app. There value is the same if EC is used in
* the same context but different accoutns/users.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* and configure the behavior of the app. There value is the same if EC is used in
* the same context but different accoutns/users.
* and configure the behavior of the app. Their value is the same if EC is used in
* the same context but with different accounts/users.

type: { [s: string]: T } | ArrayLike<T>,
): T | undefined {
const value = this.getParam(name);
if (value && Object.values(type).includes(value as T)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (value && Object.values(type).includes(value as T)) {
if (value !== null && Object.values(type).includes(value as T)) {

To avoid surprises with falsy strings

...properties,
...intentPreset,
...pickBy(configuration, (v) => v !== undefined),
intent,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about the idea of not including intent in the returned object here? That would enforce that we never predicate any behavior on the intent alone, and always provide some other URL parameter to override the behavior with.

Copy link
Contributor Author

@toger5 toger5 Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me check it was used for. But your explanation for why it is not needed (should not be needed) sounds very sane to me.

default:
intentPreset = {
confineToRoom: false,
appPrompt: false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should still be true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Developer-Experience Release note category. A PR that does not change EC but improves working with the repository.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants