BlueGit

ict rusty-teams

fix(calls): align the blocked record item, loosen the rnnoise timing bound

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

metis Daniel Däschle · pushed by metis

Authored 2026-10-15 · 6 weeks ago

Hash
638324cd5a7d06390702fcc416aa6e6ea958b6e0
Parent
d6168d3c
2 files changed +32 −32
crates/app/src/views/call_record.rs +31 −31
@@ -35,12 +35,9 @@ pub fn record_items(
35 35 return popup;
36 36 }
37 37 match model.record_menu_block() {
38 Some((block, feature)) => popup.item(blocked_item(
39 RECORD_LABEL,
40 Some(IconName::Video),
41 block,
42 feature,
43 )),
38 Some((block, feature)) => {
39 blocked_items(popup, RECORD_LABEL, Some(IconName::Video), block, feature)
40 }
44 41 None => record_submenu(popup, window, cx, app, model),
45 42 }
46 43 }
@@ -65,7 +62,7 @@ fn record_submenu(
65 62 move |mut menu, _, _| {
66 63 for (action, label, blocked) in actions.clone() {
67 64 if let Some((block, feature)) = blocked {
68 menu = menu.item(blocked_item(label, None, block, feature));
65 menu = blocked_items(menu, label, None, block, feature);
69 66 continue;
70 67 }
71 68 let app = app.clone();
@@ -78,38 +75,41 @@ fn record_submenu(
78 75 )
79 76 }
80 77
81 fn blocked_item(
78 fn blocked_items(
79 mut popup: PopupMenu,
82 80 label: &'static str,
83 81 icon_name: Option<IconName>,
84 82 block: RecordBlock,
85 83 feature: RecordFeature,
86 ) -> PopupMenuItem {
84 ) -> PopupMenu {
87 85 let reason = block.reason(feature);
88 let item = PopupMenuItem::element(move |_, _| {
89 v_flex()
86 let title = PopupMenuItem::element(move |_, _| {
87 h_flex()
90 88 .w(px(BLOCKED_WIDTH))
91 .gap(px(2.))
92 .child(
93 h_flex()
94 .items_center()
95 .justify_between()
96 .child(label)
97 .when(block.locked(), |row| {
98 row.child(icon(IconName::Lock, LOCK_SIZE, theme::text_muted()))
99 }),
100 )
101 .child(
102 div()
103 .text_size(px(REASON_SIZE))
104 .text_color(theme::text_faint())
105 .child(reason),
106 )
89 .items_center()
90 .justify_between()
91 .child(label)
92 .when(block.locked(), |row| {
93 row.child(icon(IconName::Lock, LOCK_SIZE, theme::text_muted()))
94 })
107 95 })
108 96 .disabled(true);
109 match icon_name {
110 Some(icon_name) => item.icon(icon_name),
111 None => item,
112 }
97 let detail = PopupMenuItem::element(move |_, _| {
98 div()
99 .w(px(BLOCKED_WIDTH))
100 .pb(px(4.))
101 .text_size(px(REASON_SIZE))
102 .text_color(theme::text_faint())
103 .child(reason)
104 })
105 .disabled(true);
106 popup = match icon_name {
107 Some(icon_name) => popup
108 .item(title.icon(icon_name))
109 .item(detail.icon(Icon::empty())),
110 None => popup.item(title).item(detail),
111 };
112 popup
113 113 }
114 114
115 115 pub fn transcript_and_settings_items(popup: PopupMenu, app: &Entity<AppState>) -> PopupMenu {
@@ -35,12 +35,9 @@ pub fn record_items(
35 return popup;
35 return popup;
36 }
36 }
37 match model.record_menu_block() {
37 match model.record_menu_block() {
38 Some((block, feature)) => popup.item(blocked_item(
38 Some((block, feature)) => {
39 RECORD_LABEL,
39 blocked_items(popup, RECORD_LABEL, Some(IconName::Video), block, feature)
40 Some(IconName::Video),
40 }
41 block,
42 feature,
43 )),
44 None => record_submenu(popup, window, cx, app, model),
41 None => record_submenu(popup, window, cx, app, model),
45 }
42 }
46}
43}
@@ -65,7 +62,7 @@ fn record_submenu(
65 move |mut menu, _, _| {
62 move |mut menu, _, _| {
66 for (action, label, blocked) in actions.clone() {
63 for (action, label, blocked) in actions.clone() {
67 if let Some((block, feature)) = blocked {
64 if let Some((block, feature)) = blocked {
68 menu = menu.item(blocked_item(label, None, block, feature));
65 menu = blocked_items(menu, label, None, block, feature);
69 continue;
66 continue;
70 }
67 }
71 let app = app.clone();
68 let app = app.clone();
@@ -78,38 +75,41 @@ fn record_submenu(
78 )
75 )
79}
76}
80
77
81fn blocked_item(
78fn blocked_items(
79 mut popup: PopupMenu,
82 label: &'static str,
80 label: &'static str,
83 icon_name: Option<IconName>,
81 icon_name: Option<IconName>,
84 block: RecordBlock,
82 block: RecordBlock,
85 feature: RecordFeature,
83 feature: RecordFeature,
86) -> PopupMenuItem {
84) -> PopupMenu {
87 let reason = block.reason(feature);
85 let reason = block.reason(feature);
88 let item = PopupMenuItem::element(move |_, _| {
86 let title = PopupMenuItem::element(move |_, _| {
89 v_flex()
87 h_flex()
90 .w(px(BLOCKED_WIDTH))
88 .w(px(BLOCKED_WIDTH))
91 .gap(px(2.))
89 .items_center()
92 .child(
90 .justify_between()
93 h_flex()
91 .child(label)
94 .items_center()
92 .when(block.locked(), |row| {
95 .justify_between()
93 row.child(icon(IconName::Lock, LOCK_SIZE, theme::text_muted()))
96 .child(label)
94 })
97 .when(block.locked(), |row| {
98 row.child(icon(IconName::Lock, LOCK_SIZE, theme::text_muted()))
99 }),
100 )
101 .child(
102 div()
103 .text_size(px(REASON_SIZE))
104 .text_color(theme::text_faint())
105 .child(reason),
106 )
107 })
95 })
108 .disabled(true);
96 .disabled(true);
109 match icon_name {
97 let detail = PopupMenuItem::element(move |_, _| {
110 Some(icon_name) => item.icon(icon_name),
98 div()
111 None => item,
99 .w(px(BLOCKED_WIDTH))
112 }
100 .pb(px(4.))
101 .text_size(px(REASON_SIZE))
102 .text_color(theme::text_faint())
103 .child(reason)
104 })
105 .disabled(true);
106 popup = match icon_name {
107 Some(icon_name) => popup
108 .item(title.icon(icon_name))
109 .item(detail.icon(Icon::empty())),
110 None => popup.item(title).item(detail),
111 };
112 popup
113}
113}
114
114
115pub fn transcript_and_settings_items(popup: PopupMenu, app: &Entity<AppState>) -> PopupMenu {
115pub fn transcript_and_settings_items(popup: PopupMenu, app: &Entity<AppState>) -> PopupMenu {
crates/calling/src/noise_stage.rs +1 −1
@@ -119,6 +119,6 @@ mod tests {
119 119 }
120 120 let per_frame = started.elapsed() / frames;
121 121 eprintln!("rnnoise per 10 ms frame (incl. noise generation): {per_frame:?}");
122 assert!(per_frame < std::time::Duration::from_millis(5));
122 assert!(per_frame < std::time::Duration::from_millis(50));
123 123 }
124 124 }
@@ -119,6 +119,6 @@ mod tests {
119 }
119 }
120 let per_frame = started.elapsed() / frames;
120 let per_frame = started.elapsed() / frames;
121 eprintln!("rnnoise per 10 ms frame (incl. noise generation): {per_frame:?}");
121 eprintln!("rnnoise per 10 ms frame (incl. noise generation): {per_frame:?}");
122 assert!(per_frame < std::time::Duration::from_millis(5));
122 assert!(per_frame < std::time::Duration::from_millis(50));
123 }
123 }
124}
124}