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.

Call names: Teams in a browser is read as Teams, and a Teams window from a program not on the list (its web view) is read for the call's app instead of dropped, with the program named in the log (#83)

christianmatfade7d62fda7
diff --git a/app/src/main/callNames/index.ts b/app/src/main/callNames/index.ts
index 50341e0d..28a2fd2d 100644
--- a/app/src/main/callNames/index.ts
+++ b/app/src/main/callNames/index.ts
@@ -32,6 +32,15 @@ const APPS: Record<string, { kind: CallKind; ids: string[] }> = {
/** The apps to read for a meeting: the one it was detected in; with none (started by hand) any of them, the frontmost with a call first */
export const watchIds = (app: string | null): string[] => (app ? APPS[app]?.ids ?? [] : Object.values(APPS).flatMap((a) => a.ids))
const kindOf = (bundleId: string): CallKind | null => Object.values(APPS).find((a) => a.ids.includes(bundleId))?.kind ?? null
+/**
+ * The reader for a reading. The program's own kind; else the call's app (#83: the Teams desktop app's window can come
+ * from its web view, a program not on the list, and was dropped). A browser showing Teams is read as Teams, not Meet.
+ */
+export function kindFor(appId: string, windows: Array<{ title?: string }>, callApp: string | null): CallKind | null {
+ const kind = kindOf(appId) ?? (callApp ? APPS[callApp]?.kind ?? null : null)
+ if (kind === 'meet' && windows.some((w) => /\bMicrosoft Teams\b|\|\s*Teams\b/i.test(w.title ?? ''))) return 'teams'
+ return kind
+}
/** how often the app is read */
export const WATCH_EVERY_MS = 400
@@ -45,7 +54,7 @@ const MAX_RESTARTS = 20
const LOGGED_CHANGES = 30
type Sample = Omit<CallSample, 'ms'> & { t: number }
-type Session = { ids: string[]; heardAt: number; restarts: number; samples: Sample[]; priorLines: Set<number>; watch?: { stop(): void }; everyApp: boolean; offset?: number; startedAt: number; pictured: boolean; errors: Set<string>; last: string; logged: number }
+type Session = { app: string | null; ids: string[]; heardAt: number; restarts: number; samples: Sample[]; priorLines: Set<number>; watch?: { stop(): void }; everyApp: boolean; offset?: number; startedAt: number; pictured: boolean; errors: Set<string>; last: string; logged: number }
export function hookCallNames(p: {
store: Pick<Store, 'meeting' | 'segments' | 'setSegmentSpeakers' | 'updateMeeting'>
@@ -86,8 +95,12 @@ export function hookCallNames(p: {
s.samples.push({ t: l.t, speaking: [], participants: [], me: null, ok: false })
return
}
- const kind = kindOf(l.app)
- if (!kind) return
+ const kind = kindFor(l.app, l.windows, s.app)
+ if (!kind) {
+ const why = `${l.app} is not a call app Yogurt reads`
+ if (!s.errors.has(why)) { s.errors.add(why); log(`call names: ${why}`) }
+ return
+ }
// the first reading of each meeting goes to the log in short, so a real call shows what its app gives
if (!s.pictured) { s.pictured = true; log(`call names: reading ${l.app} (${kind}), its window in short:\n${summarize(l.windows)}`) }
const r = readCall(kind, l.windows)
@@ -100,7 +113,7 @@ export function hookCallNames(p: {
p.onStart((m) => {
const ids = watchIds(m.app)
- const s: Session = { ids, heardAt: now(), restarts: 0, everyApp: !m.app, samples: [], priorLines: new Set(p.store.segments(m.id, { hidden: true }).map((line) => line.id)), startedAt: m.resume ? m.resume.startedAt - m.resume.startMs : m.startedAt, pictured: false, errors: new Set(), last: '', logged: 0 }
+ const s: Session = { app: m.app, ids, heardAt: now(), restarts: 0, everyApp: !m.app, samples: [], priorLines: new Set(p.store.segments(m.id, { hidden: true }).map((line) => line.id)), startedAt: m.resume ? m.resume.startedAt - m.resume.startMs : m.startedAt, pictured: false, errors: new Set(), last: '', logged: 0 }
sessions.set(m.id, s)
if (!ids.length) { log(`call names: ${m.app} can't be read, the other side is Them`); return }
try { s.watch = p.watch(ids, (l) => onLine(m.id, s, l)) } catch (e) { console.error('call names: the watch did not start', e) }
@@ -112,6 +125,7 @@ export function hookCallNames(p: {
const s = sessions.get(m.id)
if (!s || !s.everyApp || !m.app) return
s.everyApp = false
+ s.app = m.app
s.watch?.stop(); s.watch = undefined
const ids = watchIds(m.app)
s.ids = ids; s.heardAt = now()
diff --git a/app/test/callNames.test.ts b/app/test/callNames.test.ts
index cb5991a8..f2b6e392 100644
--- a/app/test/callNames.test.ts
+++ b/app/test/callNames.test.ts
@@ -106,6 +106,26 @@ describe('Webex accessibility roster', () => {
})
describe('hookCallNames', () => {
+ // #83 (Windows): Teams in Chrome was read with the Meet reader, and the Teams desktop app's readings were dropped
+ const teamsTree = (): AxNode => ({ r: 'frame', k: [
+ { r: 'section', t: 'Dana Smith, speaking' },
+ { r: 'tree', t: 'Participants', k: [{ r: 'tree item', t: 'Dana Smith, unmuted' }, { r: 'tree item', t: 'Ann Lee, muted' }, { r: 'tree item', t: 'Alex Morgan (You)' }] },
+ ] })
+ it('Teams in a browser tab is read as Teams, not Meet', () => {
+ const s = setup({ app: 'Chrome' })
+ s.start()
+ s.emit({ t: 1_000_000, app: 'chrome.exe', windows: [{ title: 'Weekly sync | Microsoft Teams - Google Chrome', tree: teamsTree() }] })
+ expect(s.logs.some((l) => l.startsWith('call names: reading chrome.exe (teams)'))).toBe(true)
+ expect(s.logs).toContain('call names: teams talking 1 of 3, me known')
+ })
+ it('a Teams call whose window comes from a program not on the list (its web view) is still read as Teams, and the log names it', () => {
+ const s = setup({ app: 'Teams' })
+ s.start()
+ s.emit({ t: 1_000_000, app: 'msedgewebview2.exe', windows: [{ title: 'Meeting | Microsoft Teams', tree: teamsTree() }] })
+ expect(s.logs.some((l) => l.startsWith('call names: reading msedgewebview2.exe (teams)'))).toBe(true)
+ expect(s.logs).toContain('call names: teams talking 1 of 3, me known')
+ })
+
it('a reader that goes quiet (no reading for over 5 s while recording) is started again, and the log says so', () => {
const s = setup()
s.start()