Skip to content

Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.

fix(linux): finish call names without reading the calendar

10ax5498bc8d4752
diff --git a/app/native/yogurt-system/smoke/linux.sh b/app/native/yogurt-system/smoke/linux.sh
index 2ca12c96..e2730b6c 100644
--- a/app/native/yogurt-system/smoke/linux.sh
+++ b/app/native/yogurt-system/smoke/linux.sh
@@ -49,7 +49,7 @@ check "no X server (pure Wayland): null" "v == {'title': None}" "$(env -u DISPLA
# names in calls: no accessibility bus on the runner, so the watch says why and ends when its stdin closes
CALLS=$(sleep 1 | timeout 10 "$BIN" call-watch 100 zoom | head -n 1)
-check "call-watch says it cannot read, and stops with stdin" "v.get('error') in ('no-accessibility', 'not-running')" "$CALLS"
+check "call-watch says it cannot read, and stops with stdin" "v.get('error') in ('no-accessibility', 'not-running', 'no-call-window')" "$CALLS"
# wrong use fails like the Mac helper
if "$BIN" browser-title 2>/dev/null; then echo "browser-title with no id should fail"; exit 1; fi
diff --git a/app/native/yogurt-system/src/atspi.rs b/app/native/yogurt-system/src/atspi.rs
index b900d144..1a127e5a 100644
--- a/app/native/yogurt-system/src/atspi.rs
+++ b/app/native/yogurt-system/src/atspi.rs
@@ -2,7 +2,7 @@
//! Read-only: nothing is clicked or changed in the app. The tree is cut at a depth and a node budget, like the Mac's.
use std::collections::HashMap;
-use std::time::Duration;
+use std::time::{Duration, Instant};
use serde_json::{json, Map, Value};
use zbus::blocking::{connection::Builder, Connection};
@@ -29,7 +29,6 @@ pub struct A11y {
}
/// One application on the accessibility bus: its bus name and root object
-#[derive(Clone)]
pub struct App {
pub bus: String,
pub path: OwnedObjectPath,
@@ -38,7 +37,11 @@ pub struct App {
impl A11y {
/// The accessibility bus: the session bus says where it is (org.a11y.Bus)
pub fn connect() -> Result<Self, String> {
- let session = Connection::session().map_err(|e| format!("no session bus: {e}"))?;
+ let session = Builder::session()
+ .map_err(|e| format!("no session bus: {e}"))?
+ .method_timeout(TIMEOUT)
+ .build()
+ .map_err(|e| format!("no session bus: {e}"))?;
let addr: String = session
.call_method(Some("org.a11y.Bus"), "/org/a11y/bus", Some("org.a11y.Bus"), "GetAddress", &())
.map_err(|e| format!("no accessibility bus: {e}"))?
@@ -82,8 +85,12 @@ impl A11y {
self.call(bus, path.as_str(), ACCESSIBLE, "GetChildren", &()).unwrap_or_default()
}
- /// One element and what is under it, in the shape src/main/callNames/parse.ts reads (AxNode)
- pub fn node(&self, bus: &str, path: &OwnedObjectPath, depth: usize, max_depth: usize, budget: &mut i32) -> Value {
+ /// One element and what is under it, in the shape src/main/callNames/parse.ts reads (AxNode). Stops at `deadline`,
+ /// so an app that stopped answering cannot hold the watch for minutes.
+ pub fn node(&self, bus: &str, path: &OwnedObjectPath, depth: usize, max_depth: usize, budget: &mut i32, deadline: Instant) -> Value {
+ if Instant::now() >= deadline {
+ return Value::Object(Map::new());
+ }
*budget -= 1;
let role = self.role(bus, path).unwrap_or_default();
let props = self.props(bus, path);
@@ -112,13 +119,13 @@ impl A11y {
n.insert("c".into(), json!(classes));
}
}
- if depth < max_depth && *budget > 0 {
+ if depth < max_depth && *budget > 0 && Instant::now() < deadline {
let mut kids = Vec::new();
for (b, p) in self.children(bus, path) {
- if *budget <= 0 {
+ if *budget <= 0 || Instant::now() >= deadline {
break;
}
- kids.push(self.node(&b, &p, depth + 1, max_depth, budget));
+ kids.push(self.node(&b, &p, depth + 1, max_depth, budget, deadline));
}
if !kids.is_empty() {
n.insert("k".into(), json!(kids));
diff --git a/app/native/yogurt-system/src/calls.rs b/app/native/yogurt-system/src/calls.rs
index 32c9b3cf..4a66a085 100644
--- a/app/native/yogurt-system/src/calls.rs
+++ b/app/native/yogurt-system/src/calls.rs
@@ -76,21 +76,35 @@ pub fn watch(every_ms: u64, ids: &[String]) -> ! {
}
}
+/// one reading stops walking after this long: an app that stopped answering cannot hold the watch for minutes
+const READ_DEADLINE: Duration = Duration::from_millis(1500);
+/// the controls only a call window has: the calendar and chat views have none
+const CALL_CONTROLS: &[&str] = &["leave", "leave call", "hang up", "end call", "mute mic", "unmute mic", "close participants pane"];
+/// how much of a Teams window to read before trusting it is a call (the measured call has its Leave button within ~200)
+const CALL_PROBE: i32 = 1200;
+
fn read_once(a11y: &A11y, ids: &[String]) -> Result<Value, String> {
let t = now_ms();
+ let deadline = Instant::now() + READ_DEADLINE;
let apps = a11y.apps()?;
let mut seen = false;
+ let mut timed_out = false;
+ // the first matching app with a call window is reported: the watch is for the meeting's app, not a survey of all
for app in &apps {
+ if Instant::now() >= deadline {
+ timed_out = true;
+ break;
+ }
let Some(pid) = a11y.pid(&app.bus) else { continue };
let Some(id) = matched_id(pid, ids) else { continue };
seen = true;
let kind = kind(&id);
- let windows = windows(a11y, app, kind);
+ let windows = windows(a11y, app, kind, deadline);
if !windows.is_empty() {
return Ok(json!({ "t": t, "app": id, "windows": windows }));
}
}
- Ok(if seen {
+ Ok(if seen || timed_out {
json!({ "t": t, "error": "no-call-window" })
} else {
json!({ "t": t, "error": "not-running" })
@@ -98,12 +112,12 @@ fn read_once(a11y: &A11y, ids: &[String]) -> Result<Value, String> {
}
/// The call windows of one app, in the shape src/main/callNames/parse.ts reads
-fn windows(a11y: &A11y, app: &App, kind: Kind) -> Vec<Value> {
+fn windows(a11y: &A11y, app: &App, kind: Kind, deadline: Instant) -> Vec<Value> {
let mut budget: i32 = if kind == Kind::Zoom { 1500 } else { 4000 };
let max_depth = if kind == Kind::Zoom { 14 } else { 40 };
let mut out = Vec::new();
for (bus, path) in a11y.children(&app.bus, &app.path) {
- if out.len() == 4 || budget <= 0 {
+ if out.len() == 4 || budget <= 0 || Instant::now() >= deadline {
break;
}
let Some(role) = a11y.role(&bus, &path) else { continue };
@@ -114,13 +128,49 @@ fn windows(a11y: &A11y, app: &App, kind: Kind) -> Vec<Value> {
if !call_window(kind, &title) {
continue;
}
- let tree = a11y.node(&bus, &path, 0, max_depth, &mut budget);
+ // Teams keeps its calendar and chat in windows shaped like the call's: read a little of the tree first and
+ // only copy it out when the call controls are there, so that text never reaches the JSON or the log
+ let tree = if kind == Kind::Teams {
+ let mut probe = CALL_PROBE;
+ let probe_tree = a11y.node(&bus, &path, 0, max_depth, &mut probe, deadline);
+ if !is_call_tree(&probe_tree) {
+ continue;
+ }
+ if probe > 0 {
+ probe_tree
+ } else {
+ let mut budget = 4000;
+ a11y.node(&bus, &path, 0, max_depth, &mut budget, deadline)
+ }
+ } else {
+ a11y.node(&bus, &path, 0, max_depth, &mut budget, deadline)
+ };
out.push(json!({ "title": title, "tree": tree }));
}
out
}
-/// Whether a window holds the call: a browser only when its front tab is a Meet call, Zoom only a meeting
+/// Whether a tree has a call control: the calendar and chat views have no Leave or Mute, the call window always does
+fn is_call_tree(tree: &Value) -> bool {
+ fn walk(n: &Value) -> bool {
+ let Some(o) = n.as_object() else { return false };
+ let role = o.get("r").and_then(Value::as_str).unwrap_or("");
+ if matches!(role, "button" | "push button" | "toggle button" | "menu item") {
+ for key in ["t", "d"] {
+ if let Some(s) = o.get(key).and_then(Value::as_str) {
+ if CALL_CONTROLS.contains(&s.trim().to_ascii_lowercase().as_str()) {
+ return true;
+ }
+ }
+ }
+ }
+ o.get("k").and_then(Value::as_array).is_some_and(|kids| kids.iter().any(walk))
+ }
+ walk(tree)
+}
+
+/// Whether a window may hold the call: a browser only when its front tab is a Meet call, Zoom only a meeting, Teams
+/// any window (its calendar and chat views look like the call's; is_call_tree tells them apart)
fn call_window(kind: Kind, title: &str) -> bool {
match kind {
Kind::Teams => true,
@@ -136,6 +186,15 @@ fn has_word(title: &str, word: &str) -> bool {
/// The id asked about that this process is: its Flatpak app id, else its program name
fn matched_id(pid: u32, ids: &[String]) -> Option<String> {
+ if let Some(id) = matched_id_here(pid, ids) {
+ return Some(id);
+ }
+ // A sandboxed app's accessibility tree can be exported by its xdg-dbus-proxy, whose program name is not the
+ // app's. Its cgroup normally names the Flatpak app; if that is gone, one level up is the app's own process.
+ matched_id_here(parent_pid(pid)?, ids)
+}
+
+fn matched_id_here(pid: u32, ids: &[String]) -> Option<String> {
if let Some(flatpak) = flatpak_id(pid) {
if let Some(id) = ids.iter().find(|id| **id == flatpak) {
return Some(id.clone());
@@ -145,7 +204,16 @@ fn matched_id(pid: u32, ids: &[String]) -> Option<String> {
ids.iter().find(|id| **id == program).cloned()
}
+fn parent_pid(pid: u32) -> Option<u32> {
+ parent_pid_from_status(&fs::read_to_string(format!("/proc/{pid}/status")).ok()?)
+}
+
+fn parent_pid_from_status(status: &str) -> Option<u32> {
+ status.lines().find_map(|line| line.strip_prefix("PPid:").and_then(|rest| rest.trim().parse().ok()))
+}
+
/// A Flatpak app runs in its own cgroup: app-flatpak-com.example.App-<instance>.scope
+/// (a real scope always has the instance; without one the whole id is kept)
fn flatpak_id(pid: u32) -> Option<String> {
let cgroup = fs::read_to_string(format!("/proc/{pid}/cgroup")).ok()?;
flatpak_id_from_cgroup(&cgroup)
@@ -203,16 +271,42 @@ mod tests {
assert!(call_window(Kind::Zoom, "Zoom Meeting"));
assert!(call_window(Kind::Zoom, "Zoom Webinar - 123"));
assert!(!call_window(Kind::Zoom, "Zoom Workplace"));
- assert!(call_window(Kind::Teams, "Chat | Microsoft Teams"));
+ }
+
+ #[test]
+ fn only_a_tree_with_call_controls_is_a_call() {
+ let call = json!({ "r": "frame", "k": [
+ { "r": "static", "t": "Calendar | Meeting with Dana Smith | Microsoft Teams" },
+ { "r": "button", "t": "Mute mic" },
+ { "r": "button", "t": "Leave" }
+ ] });
+ assert!(is_call_tree(&call));
+ let calendar = json!({ "r": "frame", "k": [
+ { "r": "static", "t": "Calendar | Meeting with Dana Smith | Microsoft Teams" },
+ { "r": "button", "t": "Go to today November 12, 2026" }
+ ] });
+ assert!(!is_call_tree(&calendar));
+ assert!(!is_call_tree(&json!({})));
}
#[test]
fn a_flatpak_id_comes_from_the_cgroup() {
let line = "0::/user.slice/user-1000.slice/[email protected]/app.slice/app-flatpak-com.github.IsmaelMartinez.teams_for_linux-1512112203.scope";
assert_eq!(flatpak_id_from_cgroup(line).as_deref(), Some("com.github.IsmaelMartinez.teams_for_linux"));
+ assert_eq!(
+ flatpak_id_from_cgroup("0::/user.slice/user-1000.slice/app-flatpak-com.spotify.Client-42.scope").as_deref(),
+ Some("com.spotify.Client")
+ );
assert_eq!(flatpak_id_from_cgroup("0::/user.slice/user-1000.slice/session-3.scope"), None);
}
+ #[test]
+ fn a_parent_pid_comes_from_status() {
+ assert_eq!(parent_pid_from_status("Name:\tbash\nPPid:\t1234\n"), Some(1234));
+ assert_eq!(parent_pid_from_status("Name:\tbash\n"), None);
+ assert_eq!(parent_pid_from_status("PPid:\tabc\n"), None);
+ }
+
#[test]
fn the_program_name_is_the_file_name() {
assert_eq!(program_name_of(b"/app/teams-for-linux/teams-for-linux\0--ozone-platform=wayland\0").as_deref(), Some("teams-for-linux"));
diff --git a/app/native/yogurt-system/src/main.rs b/app/native/yogurt-system/src/main.rs
index ab9a9ebe..dd1b47ee 100644
--- a/app/native/yogurt-system/src/main.rs
+++ b/app/native/yogurt-system/src/main.rs
@@ -29,6 +29,11 @@ use win as os;
use serde_json::{json, Value};
use std::io::Write;
+#[cfg(target_os = "linux")]
+const USAGE: &str = "yogurt-system mic-apps | running-apps APP_ID... | browser-title APP_ID | call-watch MS APP_ID...";
+#[cfg(not(target_os = "linux"))]
+const USAGE: &str = "yogurt-system mic-apps | running-apps APP_ID... | browser-title APP_ID";
+
fn out(v: Value) {
let mut stdout = std::io::stdout().lock();
let _ = writeln!(stdout, "{v}");
@@ -59,6 +64,6 @@ fn main() {
let every = args[1].parse::<u64>().unwrap_or(400);
calls::watch(every, &args[2..])
}
- _ => fail("yogurt-system mic-apps | running-apps APP_ID... | browser-title APP_ID | call-watch MS APP_ID..."),
+ _ => fail(USAGE),
}
}
diff --git a/app/src/main/callNames/parse.ts b/app/src/main/callNames/parse.ts
index 57932d47..3fa9039e 100644
--- a/app/src/main/callNames/parse.ts
+++ b/app/src/main/callNames/parse.ts
@@ -161,39 +161,56 @@ function readMeet(windows: AxWindow[], o: { talkingClasses?: string[] }): CallRe
// ---- Microsoft Teams (new Teams, com.microsoft.teams2, and classic) ----
// Measured on Teams for Linux 2.28.0 (AT-SPI, Plasma Wayland): the People panel's "Attendees" tree has rows
// "Name, Role, Muted|Unmuted" ("Dana Smith, Organizer, Unmuted"), and the row's section repeats it. Teams marks the
-// active speaker only with a ring: no word and no class in the tree. What is read is words only: those roster rows,
-// an element labelled "Name, speaking" / "Name is speaking" / "Active speaker: Name" (other builds), and "(You)"
-// after the person's own name. When the roster is closed and nobody is marked, only a call of two can be named
-// (attribute.ts).
+// active speaker only with a ring: no word and no class in the tree. What is read is words only: those roster rows
+// (inside a tree or table named Participants/Attendees/People, so a chat or calendar line that happens to read like
+// one is never a person), an element labelled "Name, speaking" / "Name is speaking" / "Active speaker: Name" (other
+// builds), and "(You)" after the person's own name. When the roster is closed and nobody is marked, only a call of two
+// can be named (attribute.ts).
const TEAMS_SPEAKING = [/^(.{2,60}?)(?:,\s*|\s+is\s+)(?:speaking|talking)\b/i, /\b(?:active speaker|now speaking|speaking now)[:,]?\s+(.{2,60})$/i]
/** the state Teams puts after a person in the roster; the role ("Organizer", "Presenter", ...) may sit between */
const TEAMS_STATUS = /^(?:muted|unmuted|mic(?:rophone)? (?:on|off)|video (?:is )?(?:on|off)|camera (?:is )?(?:on|off))$/i
+/** the roles Teams puts between the name and the state */
+const TEAMS_ROLE = /^(?:organizer|presenter|guest|external|co-?organizer|attendee|host|co-?host|interpreter)$/i
const TEAMS_SAYS = /^(?:speaking|talking|active speaker|now speaking)$/i
const TEAMS_ME = /^(.{2,60}?)\s*\((?:you|me)\)/i
const cleanTeams = (s: string) => s.replace(/\s*\((?:organizer|presenter|guest|external|you|me)\)/gi, '').replace(/[,.:;]+$/, '').trim()
-/** "Dana Smith, Organizer, Unmuted" → Dana Smith; null when the label is not a person with a state */
+/** the roles a roster row has: the People panel's tree, or a table/list in another build */
+const TEAMS_ROW = new Set(['tree item', 'table row', 'list item', 'row', 'AXRow'])
+/** a list that can hold the roster; its name says whether it does */
+const TEAMS_LIST = new Set(['tree', 'tree table', 'table', 'list', 'list box', 'outline', 'AXOutline', 'AXTable'])
+const TEAMS_LIST_NAME = /^(?:meeting )?(?:participants|attendees|people|in (?:this|the) meeting)\b/i
+
+/** whether an element sits in the People panel: a row, inside a list named Participants/Attendees/People */
+function inTeamsRoster(n: AxNode, up: AxNode[]): boolean {
+ if (!TEAMS_ROW.has(n.r) && !up.some((a) => TEAMS_ROW.has(a.r))) return false
+ return up.some((a) => TEAMS_LIST.has(a.r) && TEAMS_LIST_NAME.test((a.d ?? a.t ?? '').trim()))
+}
+
+/** "Dana Smith, Organizer, Unmuted" → Dana Smith; "Smith, Dana, Organizer, Unmuted" → Smith, Dana */
function teamsPersona(label: string): { name: string; speaking: boolean } | null {
const fields = label.normalize('NFKC').split(/\s*,\s*/)
- if (fields.length < 2) return null
- const name = cleanTeams(fields[0])
+ const state = fields.findIndex((f) => TEAMS_STATUS.test(f))
+ if (state < 1) return null
+ const before = fields.slice(0, state)
+ while (before.length > 1 && TEAMS_ROLE.test(before.at(-1)!)) before.pop()
+ const name = cleanTeams(before.join(', '))
if (name.length < 2 || name.length > 60) return null
- const rest = fields.slice(1)
- if (!rest.some((f) => TEAMS_STATUS.test(f))) return null
- return { name, speaking: rest.some((f) => TEAMS_SAYS.test(f)) }
+ return { name, speaking: fields.some((f) => TEAMS_SAYS.test(f)) }
}
function readTeams(windows: AxWindow[]): CallReading {
const speaking: string[] = [], participants: string[] = []
let me: string | null = null
for (const w of windows) {
- walk(w.tree, (n) => {
+ walk(w.tree, (n, up) => {
+ const roster = inTeamsRoster(n, up)
for (const label of texts(n)) {
for (const re of TEAMS_SPEAKING) { const m = re.exec(label); if (m) { const name = cleanTeams(m[1]); if (name.length >= 2 && !/^(you|me)\b/i.test(name)) speaking.push(name) } }
- const persona = teamsPersona(label)
+ const persona = roster ? teamsPersona(label) : null
if (persona) { participants.push(persona.name); if (persona.speaking) speaking.push(persona.name) }
- const mine = TEAMS_ME.exec(label)
+ const mine = roster ? TEAMS_ME.exec(label) : null
if (mine) { me = cleanTeams(mine[1]); participants.push(me) }
}
})
diff --git a/app/src/main/permissions.ts b/app/src/main/permissions.ts
index 76cf32fb..1c5b102f 100644
--- a/app/src/main/permissions.ts
+++ b/app/src/main/permissions.ts
@@ -78,11 +78,12 @@ export type Permissions = ReturnType<typeof createPermissions>
/**
* Windows and Linux have no prompts to ask with: the mic, call audio and notifications are simply on. Windows can still
* block desktop apps from the mic; the recorder finds that out when it starts (no-mic), and the mic reads as off until a
- * recording hears it again. Its Settings page opens from the hint. Calendar and Accessibility don't exist there.
+ * recording hears it again. Its Settings page opens from the hint. Calendar doesn't exist there; Linux reads call names
+ * through AT-SPI, which asks nothing, so Accessibility is granted there. On Windows it doesn't exist and stays unknown.
*/
function offMac(platform: string, open: (url: string) => void, micBlocked?: () => boolean) {
const status = async (): Promise<PermissionStatus> =>
- ({ mic: platform === 'win32' && micBlocked?.() ? 'denied' : 'granted', systemAudio: 'granted', calendar: 'unknown', notifications: 'granted', accessibility: 'unknown' })
+ ({ mic: platform === 'win32' && micBlocked?.() ? 'denied' : 'granted', systemAudio: 'granted', calendar: 'unknown', notifications: 'granted', accessibility: platform === 'linux' ? 'granted' : 'unknown' })
return {
status,
async request(kind: PermissionKind): Promise<Access> { return (await status())[kind] },
diff --git a/app/test/callParse.test.ts b/app/test/callParse.test.ts
index d1d33ebe..58984114 100644
--- a/app/test/callParse.test.ts
+++ b/app/test/callParse.test.ts
@@ -87,14 +87,15 @@ describe('Google Meet', () => {
})
})
-// ---- Teams: words only (no measured tree yet) ----
+// ---- Teams: the People panel roster (measured on Linux), and the words other builds show ----
describe('Microsoft Teams', () => {
- it('reads "Name, speaking", tiles with a mic or video state, and "(You)"', () => {
+ it('reads "Name, speaking", roster rows with a mic or video state, and "(You)"', () => {
const tree = node('AXWindow', {},
- node('AXGroup', { d: 'Dana Smith, unmuted, video on' }, node('AXStaticText', { v: 'Dana Smith' })),
node('AXGroup', { d: 'Dana Smith, speaking' }),
- node('AXGroup', { d: 'Ann Lee, muted' }),
- node('AXRow', { d: 'Alex Morgan (You)' }),
+ node('AXOutline', { d: 'Participants' },
+ node('AXRow', { d: 'Dana Smith, unmuted, video on' }, node('AXStaticText', { v: 'Dana Smith' })),
+ node('AXRow', { d: 'Ann Lee, muted' }),
+ node('AXRow', { d: 'Alex Morgan (You)' })),
node('AXButton', { d: 'Leave' }))
expect(readCall('teams', [win(tree, 'Weekly sync | Microsoft Teams')])).toEqual({ speaking: ['Dana Smith'], participants: ['Dana Smith', 'Ann Lee', 'Alex Morgan'], me: 'Alex Morgan' })
})
@@ -107,10 +108,18 @@ describe('Microsoft Teams', () => {
it('reads AT-SPI names as well as descriptions (Linux)', () => {
const tree = node('frame', {},
node('section', { t: 'Dana Smith, speaking' }),
- node('section', { t: 'Ann Lee, muted' }))
+ node('tree', { t: 'Participants' },
+ node('tree item', {}, node('section', { t: 'Ann Lee, muted' }))))
expect(readCall('teams', [win(tree)])).toEqual({ speaking: ['Dana Smith'], participants: ['Ann Lee'], me: null })
})
+ it('never takes a chat or calendar line for a person, even when it reads like a roster row', () => {
+ const tree = node('frame', {},
+ node('list', { t: 'Chat' }, node('list item', { t: 'Dana Smith, muted' }), node('list item', { t: 'Dana Smith (you)' })),
+ node('section', { t: 'Ann Lee, Organizer, Unmuted' }))
+ expect(readCall('teams', [win(tree)])).toEqual({ speaking: [], participants: [], me: null })
+ })
+
it('reads the People panel roster (Teams for Linux): "Name, Role, Muted|Unmuted"', () => {
const tree = node('frame', { t: 'Meeting | Microsoft Teams' },
node('landmark', { t: 'Participants' },
@@ -134,6 +143,13 @@ describe('Microsoft Teams', () => {
expect(readCall('teams', [win(tree)])).toEqual({ speaking: [], participants: ['Dana Smith', 'Alex Morgan', 'Sam Lee'], me: null })
})
+ it('keeps a comma in a roster name', () => {
+ const tree = node('frame', {},
+ node('tree', { t: 'Attendees' },
+ node('tree item', { t: 'Smith, Dana, Organizer, Unmuted' })))
+ expect(readCall('teams', [win(tree)])).toEqual({ speaking: [], participants: ['Smith, Dana'], me: null })
+ })
+
it('a roster row marked (You) is the person using Yogurt', () => {
const tree = node('frame', {},
node('tree', { t: 'Attendees' },
diff --git a/app/test/onboarding.test.ts b/app/test/onboarding.test.ts
index bdb39e7e..09ecbc79 100644
--- a/app/test/onboarding.test.ts
+++ b/app/test/onboarding.test.ts
@@ -99,7 +99,7 @@ describe('the launch screen', () => {
})
})
-describe('a computer without a calendar or names from calls (Windows, Linux)', () => {
+describe('a computer without a calendar or names from calls (Windows)', () => {
const kinds = supportedKinds(capabilities('win32'))
it('the first run never asks for them', () => {
const plan = firstRunPlan({ ask: true, welcomed: false, introSeen: false, status: all('unknown'), kinds })
@@ -117,3 +117,13 @@ describe('a computer without a calendar or names from calls (Windows, Linux)', (
expect(finishSetupPercent(st, supportedKinds(capabilities('darwin')))).toBe(finishSetupPercent(st))
})
})
+
+describe('a Linux computer with names from calls', () => {
+ const kinds = supportedKinds(capabilities('linux'))
+ it('asks for Accessibility too, and Finish setup completes once it is on', () => {
+ const plan = firstRunPlan({ ask: true, welcomed: false, introSeen: false, status: all('unknown'), kinds })
+ expect(screensOf(plan.steps).map((s) => s.id)).toEqual(['record', 'notifications', 'accessibility'])
+ // AT-SPI asks nothing, so the permission reads granted without a prompt
+ expect(finishSetupPercent({ ...all('granted'), calendar: 'unknown' }, kinds)).toBe(100)
+ })
+})
diff --git a/app/test/permissions.test.ts b/app/test/permissions.test.ts
index 74e5a91d..a8da567c 100644
--- a/app/test/permissions.test.ts
+++ b/app/test/permissions.test.ts
@@ -90,7 +90,14 @@ describe('permissions on Windows and Linux', () => {
it('nothing needs asking: the mic, call audio and notifications are on, and no helper is asked', async () => {
for (const platform of ['win32', 'linux']) {
const { p, calls } = offMac(platform)
- expect(await p.status()).toEqual({ mic: 'granted', systemAudio: 'granted', calendar: 'unknown', accessibility: 'unknown', notifications: 'granted' })
+ expect(await p.status()).toEqual({
+ mic: 'granted',
+ systemAudio: 'granted',
+ calendar: 'unknown',
+ // Linux reads call names through AT-SPI, which has no permission prompt; Windows has no such permission
+ accessibility: platform === 'linux' ? 'granted' : 'unknown',
+ notifications: 'granted',
+ })
expect(await p.request('mic')).toBe('granted')
expect(calls).toEqual([])
}