Skip to content

Conversation

@toger5
Copy link
Contributor

@toger5 toger5 commented Aug 20, 2025

This PR is part of an onging effort to move responsiblity to the EC app and out of the EX apps.

4 intends (f.ex join_existing start_new_dm... ) (as url paramters) are introduced in recent element call versions. Those intends behave like defaults. If an intend is set a set of url parameters are predefined.
Not all params can be covered by the intend (for insteance the widget_id or the host_url).
This PR splits the url parameters into configuration (things that can be configured by the intent) and properties (things that still need to be passed one by one)

The goal with this change is that EX only needs to configre the intent once and the EC codebase can update the behavior in those 4 specific scenarios in case new features come along (auto hangup when other participants leave, send call ring notification...)

Signed-off-by: Timo K toger5@hotmail.de

  • Public API changes documented in changelogs (optional)

Signed-off-by:

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 20, 2025

CodSpeed Performance Report

Merging #5560 will not alter performance

Comparing toger5/intent-system-call-url (207255f) with main (441b006)

Summary

✅ 49 untouched benchmarks

@toger5 toger5 force-pushed the toger5/intent-system-call-url branch 3 times, most recently from e1c1764 to ef6890a Compare August 20, 2025 13:52
@codecov
Copy link

codecov bot commented Aug 20, 2025

Codecov Report

❌ Patch coverage is 98.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.89%. Comparing base (441b006) to head (207255f).
⚠️ Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
...tes/matrix-sdk/src/widget/settings/element_call.rs 98.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5560      +/-   ##
==========================================
- Coverage   88.89%   88.89%   -0.01%     
==========================================
  Files         349      349              
  Lines       96546    96542       -4     
  Branches    96546    96542       -4     
==========================================
- Hits        85826    85821       -5     
- Misses       6682     6683       +1     
  Partials     4038     4038              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@toger5 toger5 marked this pull request as ready for review August 20, 2025 16:51
@toger5 toger5 requested a review from a team as a code owner August 20, 2025 16:51
@toger5 toger5 requested review from Hywan and removed request for a team August 20, 2025 16:51
@toger5 toger5 force-pushed the toger5/intent-system-call-url branch from 4d9cb43 to 2f5911f Compare August 26, 2025 16:14
Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

Thanks for the patches.

Can you amend your patches to provide a description please? Your first patch's description is “d”, and the second is “fix tests”. I don't think “d” is enough information to help the reviewer to understand it.

@toger5 toger5 force-pushed the toger5/intent-system-call-url branch from 2f5911f to f007b20 Compare August 27, 2025 08:16
@fkwp fkwp requested a review from Hywan September 1, 2025 14:08
Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. I am approving the changes. Can you answer my questions though :-)?

skip_lobby: Option<bool>,
confine_to_room: bool,
app_prompt: bool,
app_prompt: Option<bool>,
Copy link
Member

Choose a reason for hiding this comment

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

What Option<bool> means here? Specifically, how Some(false) is different from None?

font: Option<String>,
#[serde(rename = "perParticipantE2EE")]
per_participant_e2ee: bool,
per_participant_e2ee: Option<bool>,
Copy link
Member

Choose a reason for hiding this comment

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

Same question as above.

/// compatibility. Use header: "standard"|"none" instead.
hide_header: Option<bool>,
preload: bool,
preload: Option<bool>,
Copy link
Member

Choose a reason for hiding this comment

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

Same question as above.

hide_screensharing: bool,
controlled_media_devices: bool,
/// Supported since Element Call v0.9.0.
hide_screensharing: Option<bool>,
Copy link
Member

Choose a reason for hiding this comment

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

Same question as above.

pub confine_to_room: Option<bool>,

/// Do not show the screenshare button.
pub hide_screensharing: Option<bool>,
Copy link
Member

Choose a reason for hiding this comment

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

Same question as above :-).


/// Make the audio devices be controlled by the os instead of the
/// element-call webview.
pub controlled_audio_devices: Option<bool>,
Copy link
Member

Choose a reason for hiding this comment

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

Guess what ^^?

/// The font scale which will be used inside element call.
///
/// Default: `1`
pub font_scale: Option<f64>,
Copy link
Member

Choose a reason for hiding this comment

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

What happens if it's 0? Is it allowed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would set the font size to 0. Since EC is a webview this would imply that text is basically "not rendered".

I think this is the expected behavior. Since css allso does not do any specific allow rules on this I feel like the url params can have the same flexibility.

@toger5
Copy link
Contributor Author

toger5 commented Sep 9, 2025

@Hywan sorry for the high latency on this PR. (Holidays)

I will work on a rebase/merge today.

What Option means here? Specifically, how Some(false) is different from None?

The ElementCallParams are directly translated into url query parameters.
All fields are optionals where the None case implies, that it will not be part of the url parameters.

For example:

ElementCallParams {
   hide_screensharing: Some(true),
   ..ElementCallParams::default()
}

will become:

my.url?hide_screensharing=true

The reason it might be desirable to not list those configurations in the urls parameters is that the intent implies default for all configuration values in widget itself. Setting the url parameter specifically will overwrite those defaults. So it often is desired for them to be None values (not part of the url).

I will update the docstring to contain this information as well.

@toger5 toger5 force-pushed the toger5/intent-system-call-url branch from f007b20 to 8a67efc Compare September 9, 2025 11:29
Use two structs one for configuration and one for required properties instead of mixing them.
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
@toger5 toger5 force-pushed the toger5/intent-system-call-url branch from 8a67efc to 207255f Compare September 9, 2025 13:27
@toger5 toger5 requested a review from Hywan September 9, 2025 14:44
Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

Thanks!

@Hywan Hywan merged commit d2ca026 into main Sep 10, 2025
53 checks passed
@Hywan Hywan deleted the toger5/intent-system-call-url branch September 10, 2025 09:46
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.

3 participants