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: Meet's own text is never a person, a Teams chat can't hide another call, and main.log keeps no names or captions

christianmat7a5c1eb4d815
diff --git a/app/native/yogurt-mac/main.swift b/app/native/yogurt-mac/main.swift
index 82e87146..8711dadc 100644
--- a/app/native/yogurt-mac/main.swift
+++ b/app/native/yogurt-mac/main.swift
@@ -269,6 +269,28 @@ func axCopy(_ e: AXUIElement, depth: Int, maxDepth: Int, budget: inout Int, zoom
}
/** the windows of a call app that hold the call */
+let callControls: Set<String> = ["leave", "leave call", "hang up", "end call", "mute mic", "unmute mic", "close participants pane"]
+
+/// Whether a window has a button that only a call has, looking at no more than `budget` elements
+func hasCallControl(_ w: AXUIElement, budget: Int = 1500) -> Bool {
+ var left = budget, queue = [w]
+ while !queue.isEmpty && left > 0 {
+ let e = queue.removeFirst(); left -= 1
+ let role = axText(axAttr(e, kAXRoleAttribute)) ?? ""
+ if role == "AXButton" || role == "AXMenuItem" || role == "AXCheckBox" {
+ for key in [kAXDescriptionAttribute, kAXTitleAttribute] as [String] {
+ // a label can carry its shortcut: "Leave (⌘⇧H)"
+ if let s = axText(axAttr(e, key)) {
+ let plain = s.replacingOccurrences(of: #"\s*\([^)]*\)\s*$"#, with: "", options: .regularExpression).trimmingCharacters(in: .whitespaces).lowercased()
+ if callControls.contains(plain) { return true }
+ }
+ }
+ }
+ queue.append(contentsOf: (axAttr(e, kAXChildrenAttribute) as? [AXUIElement]) ?? [])
+ }
+ return false
+}
+
func callWindows(_ app: AXUIElement, _ id: String) -> [AXUIElement] {
let all = (axAttr(app, kAXWindowsAttribute) as? [AXUIElement]) ?? []
if id == "us.zoom.xos" {
@@ -277,7 +299,9 @@ func callWindows(_ app: AXUIElement, _ id: String) -> [AXUIElement] {
return ident.hasPrefix("zm.meeting") || title.hasPrefix("Zoom Meeting") || title.hasPrefix("Zoom Webinar")
}
}
- if id.hasPrefix("com.microsoft.teams") { return all }
+ // Teams keeps its chat and calendar in windows shaped like the call's: only a window with a call control (Leave,
+ // Mute) is a call, so an open chat can't hide a call in another app (#72). The same controls as Linux (calls.rs).
+ if id.hasPrefix("com.microsoft.teams") { return all.filter { hasCallControl($0) } }
// Webex's meeting surfaces have stable accessibility identifiers; exclude its home window so it cannot hide another
// call app when a recording was started by hand.
if id == "Cisco-Systems.Spark" || id == "com.cisco.webexmeetingsapp" {
diff --git a/app/src/main/callNames/index.ts b/app/src/main/callNames/index.ts
index 11f85265..d20090fe 100644
--- a/app/src/main/callNames/index.ts
+++ b/app/src/main/callNames/index.ts
@@ -41,7 +41,7 @@ const APP_LAG_MS = 750
const LOGGED_CHANGES = 30
type Sample = Omit<CallSample, 'ms'> & { t: number }
-type Session = { samples: Sample[]; priorLines: Set<number>; watch?: { stop(): void }; offset?: number; startedAt: number; pictured: boolean; errors: Set<string>; last: string; logged: number }
+type Session = { 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'>
@@ -55,6 +55,8 @@ export function hookCallNames(p: {
onStart: (fn: (m: RecordingStart) => void) => unknown
onStop: (fn: (m: Meeting) => void) => unknown
onCapture: (fn: (c: { on(e: 'pcm', fn: (track: 'me' | 'them', ms: number, samples: Float32Array) => void): unknown }, meetingId: string) => void) => unknown
+ /** a recording started by hand learned its call app from the mic (watch.ts, CALL bind) */
+ onBind?: (fn: (m: Meeting) => void) => unknown
log?: (msg: string) => void
now?: () => number
}) {
@@ -83,19 +85,34 @@ export function hookCallNames(p: {
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)
s.samples.push({ t: l.t, ...r })
- const said = `${r.speaking.join(', ') || '-'} of ${r.participants.length}${r.me ? ', me known' : ''}`
+ // counts only: main.log is pasted into public issues, and names belong to the people in the call
+ const said = `${r.speaking.length} of ${r.participants.length}${r.me ? ', me known' : ''}`
if (said !== s.last && s.logged < LOGGED_CHANGES) { s.logged++; log(`call names: ${kind} talking ${said}`) }
s.last = said
}
p.onStart((m) => {
const ids = watchIds(m.app)
- const s: Session = { 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 = { 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) }
})
+ // A recording started by hand reads every call app, the frontmost with a call first; another app's window (a Teams
+ // chat) can win that. Once the mic says which app the call is in, only that one is read.
+ p.onBind?.((m) => {
+ const s = sessions.get(m.id)
+ if (!s || !s.everyApp || !m.app) return
+ s.everyApp = false
+ s.watch?.stop(); s.watch = undefined
+ const ids = watchIds(m.app)
+ log(`call names: the call is in ${m.app}, reading only it`)
+ if (!ids.length) return
+ s.pictured = false
+ try { s.watch = p.watch(ids, (l) => onLine(m.id, s, l)) } catch (e) { console.error('call names: the watch did not start', e) }
+ })
+
// meeting time 0 on the wall clock: the earliest any audio could have been heard (each frame arrives a little after it was said)
p.onCapture((c, id) => {
c.on('pcm', (_track, ms, samples) => {
diff --git a/app/src/main/callNames/parse.ts b/app/src/main/callNames/parse.ts
index c79b2310..62a3ea3c 100644
--- a/app/src/main/callNames/parse.ts
+++ b/app/src/main/callNames/parse.ts
@@ -159,11 +159,34 @@ const TILE_UP = 7
/** text in Meet's window that is never a person: times, the meeting code, chat */
const NOT_A_NAME = /^\d{1,2}[:.]\d{2}(\s?[AP]M)?$|^[a-z]{3}-[a-z]{4}-[a-z]{3}$|says in chat|^(AM|PM)$|^\d+$/i
+/** Meet's own words that stand alone like a name */
+const MEET_WORDS = new Set(['meet', 'reframe', 'captions', 'chat', 'people', 'activities', 'host controls', 'present', 'raise hand', 'reactions'])
+/** lowercase words that sit inside real names: Ana María de la Cruz, Ludwig van Beethoven */
+const PARTICLES = new Set(['de', 'del', 'della', 'der', 'den', 'di', 'da', 'das', 'do', 'dos', 'du', 'la', 'le', 'van', 'von', 'ter', 'ten', 'y', 'e', 'bin', 'binti', 'al', 'el', 'ibn', 'zu'])
+
+/**
+ * A tile's name, or null for anything else Meet writes in a box of its own (#71): sentences from toasts and the lobby
+ * ("Your camera is on.", "Reducing noise"), times and dates, a shared tab's title ("Plan - Google Docs") and control
+ * labels. A name has no digits, no sentence ending, at most five words, and in a name of several words every word
+ * starts with a capital letter (or is a particle like "de", or comes from a script without capitals). Getting a person
+ * wrong means Them for their lines, never another name.
+ */
function meetName(text: string): string | null {
const name = text.normalize('NFKC').replace(/\s*\((presenting|presentation|you)[^)]*\)\s*$/i, '').trim()
- return name.length >= 2 && name.length <= 60 && /\p{L}/u.test(name) && !NOT_A_NAME.test(name) ? name : null
+ if (name.length < 2 || name.length > 60 || !/\p{L}/u.test(name) || NOT_A_NAME.test(name)) return null
+ if (/\d|[?!…:/⌘]|\.\.|\s[-–—|]\s/.test(name) || MEET_WORDS.has(low(name))) return null
+ const words = name.split(/\s+/)
+ // "Jr." and initials end with a period; a sentence does
+ if (/\.$/.test(name) && words.at(-1)!.replace(/\.$/, '').length > 2) return null
+ if (words.length > 5) return null
+ if (words.length > 1 && words.some((w) => /^\p{Ll}/u.test(w) && !PARTICLES.has(w))) return null
+ return name
}
+/** a toast, banner or other live area: Meet's messages, never a tile (a role on Linux and Windows, a subrole on a Mac) */
+const LIVE = new Set(['alert', 'notification', 'status bar', 'status', 'log', 'marquee', 'timer', 'AXApplicationAlert', 'AXApplicationStatus', 'AXApplicationLog', 'AXApplicationTimer', 'AXApplicationMarquee'])
+const isLive = (n: AxNode) => LIVE.has(n.r) || (!!n.s && LIVE.has(n.s))
+
function readMeet(windows: AxWindow[], o: { talkingClasses?: string[] }): CallReading {
const marks = new Set(o.talkingClasses ?? MEET_TALKING_CLASSES)
const groups = new Map<AxNode, string[]>()
@@ -171,7 +194,7 @@ function readMeet(windows: AxWindow[], o: { talkingClasses?: string[] }): CallRe
if (w.title && !/\bMeet\b/.test(w.title)) continue
const skip = new Set((w.title ?? '').split(/\s+[-–—]\s+/).map(low))
walk(w.tree, (n, up) => {
- if (!STATIC_TEXT.has(n.r) || up.length < TILE_UP) return
+ if (!STATIC_TEXT.has(n.r) || up.length < TILE_UP || up.some(isLive)) return
const text = n.v ?? n.t
if (!text) return
const name = meetName(text)
@@ -308,14 +331,29 @@ export function readCall(kind: CallKind, windows: AxWindow[], o: { talkingClasse
* A short picture of a window's tree for the log, so a real call shows what its app gives: element counts by role,
* and the first lines of text with their role (and DOM classes on Meet's tiles). Names stay on the Mac (the log does).
*/
+/** words the call apps write themselves: their status, roles, lists and controls. Anything else may be a name, a caption
+ * or a document title, and stays out of the log */
+const APP_WORDS = new Set([...ZOOM.flat().map(low), ...TALKING.map(low), 'zoom meeting', 'zoom webinar', 'meeting', 'meet', 'microsoft teams',
+ 'you', 'leave', 'leave call', 'hang up', 'end call', 'mute mic', 'unmute mic', 'mute my audio', 'unmute my audio', 'participants', 'attendees', 'people'])
+const appWord = (x: string) => APP_WORDS.has(low(x)) || OTHER_STATUS.test(x) || TEAMS_STATUS.test(x) || TEAMS_ROLE.test(x) || TEAMS_SAYS.test(x)
+
+/** Text for the log: the app's own words kept, every other piece shown only by its length ("‹10›, Active speaker") */
+export function redact(text: string): string {
+ return text.replace(/\s+/g, ' ').trim().split(/(\s*,\s*|\s+[-–—|]\s+)/).map((part, i) => (i % 2 || !part || appWord(part) ? part : `‹${part.length}›`)).join('').slice(0, 120)
+}
+
+/**
+ * A short picture of the call window for main.log: role counts, then each element's role, id, classes and words.
+ * main.log is pasted into public issues, so names, captions and titles never go in: only the app's own words do.
+ */
export function summarize(windows: AxWindow[], max = 60): string {
const roles = new Map<string, number>()
const lines: string[] = []
for (const w of windows) {
- lines.push(`window "${(w.title ?? '').slice(0, 60)}"${w.id ? ` id=${w.id}` : ''}`)
+ lines.push(`window "${redact(w.title ?? '')}"${w.id ? ` id=${w.id}` : ''}`)
walk(w.tree, (n, up) => {
roles.set(n.r, (roles.get(n.r) ?? 0) + 1)
- const said = texts(n).map((x) => x.replace(/\s+/g, ' ').slice(0, 80))
+ const said = texts(n).map(redact)
if ((said.length || n.i) && lines.length < max) lines.push(`${' '.repeat(Math.min(up.length, 12))}${n.r}${n.i ? `#${n.i}` : ''} ${said.map((x) => JSON.stringify(x)).join(' ')}${n.c?.length ? ` .${n.c.slice(0, 6).join('.')}` : ''}`)
})
}
diff --git a/app/src/main/index.ts b/app/src/main/index.ts
index 263221d6..c9f3e6a5 100644
--- a/app/src/main/index.ts
+++ b/app/src/main/index.ts
@@ -43,7 +43,7 @@ import { calendars, eventIds, matchesEvent, setCalendarSelection, calendarStatus
import { createSignals } from './detectSignals'
import { Watcher } from './watch'
import { createPrompts } from './prompts'
-import { activeMeeting, bindMeetingApp, getMeeting, initMeetings, onMeetingChange, onMeetingStart, onMeetingStop, onMeetingStopSaved, refreshEventSnapshots, linkEvent, unlinkEvent, prepareMeeting, startPreparedMeeting, resumeMeeting, pauseMeetingClock, renameMeeting, retryStopSave, setAttendees, startMeeting, stopMeeting, stopSavePending, withStopState } from './meeting'
+import { activeMeeting, bindMeetingApp, getMeeting, initMeetings, onMeetingBound, onMeetingChange, onMeetingStart, onMeetingStop, onMeetingStopSaved, refreshEventSnapshots, linkEvent, unlinkEvent, prepareMeeting, startPreparedMeeting, resumeMeeting, pauseMeetingClock, renameMeeting, retryStopSave, setAttendees, startMeeting, stopMeeting, stopSavePending, withStopState } from './meeting'
import { deleteMeeting } from './deleteMeeting'
import { emptyTrash, moveToTrash, purgeTrash } from './trash'
import { isId, text } from './ipcArgs'
@@ -521,7 +521,7 @@ app.whenReady().then(() => {
transcribed: async (id) => { await recordingFinished(id); await transcriptFinished(id) },
// people seen in the call joined the meeting: unedited notes already written get written again for them
changed: (id) => { win?.webContents.send('transcript:speakers', id); sendWidgetTranscript('transcript:speakers', id); win?.webContents.send('meetings:changed'); notes.applyPeople(id) },
- onStart: onMeetingStart, onStop: onMeetingStop, onCapture: onCaptureStart,
+ onStart: onMeetingStart, onStop: onMeetingStop, onCapture: onCaptureStart, onBind: onMeetingBound,
})
// Windows and Linux: whisper left the graphics card in a meeting, so the speed check (timed with it) runs again next start
onWhisperGpuOff(() => speedStore(speedFile()).forget())
diff --git a/app/src/main/meeting.ts b/app/src/main/meeting.ts
index 50d6d4e9..02b5d546 100644
--- a/app/src/main/meeting.ts
+++ b/app/src/main/meeting.ts
@@ -17,7 +17,7 @@ const pendingStops = new Map<string, Meeting>()
export type RecordingStart = Meeting & { resume?: { part: number; startMs: number; startedAt: number; capturedMs: number } }
type Hook = (m: RecordingStart) => void
let clock: { startedAt: number; before: number; pausedAt: number | null; pausedMs: number; measured: boolean } | null = null
-const starts: Hook[] = [], stops: Hook[] = [], savedStops: Hook[] = [], changes: Hook[] = []
+const starts: Hook[] = [], stops: Hook[] = [], savedStops: Hook[] = [], changes: Hook[] = [], binds: Hook[] = []
const on = (list: Hook[]) => (fn: Hook) => { list.push(fn); return () => { const i = list.indexOf(fn); if (i >= 0) list.splice(i, 1) } }
/** called after a meeting starts (capture hooks in here) */
export const onMeetingStart = on(starts)
@@ -27,6 +27,8 @@ export const onMeetingStop = on(stops)
export const onMeetingStopSaved = on(savedStops)
/** called after any change to a meeting, for the windows to refresh */
export const onMeetingChange = on(changes)
+/** called when a recording started without an app learns it from the mic (watch.ts) */
+export const onMeetingBound = on(binds)
// A hook that throws must never take the recording down with it
function run(list: Hook[], m: RecordingStart) {
@@ -76,7 +78,9 @@ export function startMeeting(p: { title: string; event: CalEvent | null; app: st
/** Bind only the current, unbound recording; persist it for recovery and diagnostics. */
export function bindMeetingApp(id: string, app: string): Meeting | undefined {
if (!active || active.id !== id || active.app) return undefined
- return update(id, { app })
+ const m = update(id, { app })
+ if (m) run(binds, m)
+ return m
}
/** Prepare an agenda without opening the microphone or joining the post-recording recovery queue. */
diff --git a/app/test/callNames.test.ts b/app/test/callNames.test.ts
index 2fa36576..6b365a20 100644
--- a/app/test/callNames.test.ts
+++ b/app/test/callNames.test.ts
@@ -48,7 +48,7 @@ function setup(o: { app?: string | null; attendees?: Meeting['attendees'] } = {}
const watched: string[][] = []
let emit!: (l: WatchLine) => void
let stopped = 0
- const starts: Array<(m: Meeting) => void> = [], stops: Array<(m: Meeting) => void> = []
+ const starts: Array<(m: Meeting) => void> = [], stops: Array<(m: Meeting) => void> = [], binds: Array<(m: Meeting) => void> = []
const captures: Array<(c: EventEmitter, id: string) => void> = []
const changed: string[] = [], logs: string[] = []
let transcribed!: () => void
@@ -56,7 +56,7 @@ function setup(o: { app?: string | null; attendees?: Meeting['attendees'] } = {}
const hook = hookCallNames({
store, myNames: () => ['Alex Morgan'], transcribed: () => done, changed: (id) => changed.push(id), log: (s) => logs.push(s), now: () => clock,
watch: (ids, onLine) => { watched.push(ids); emit = onLine; return { stop: () => { stopped++ } } },
- onStart: (fn) => starts.push(fn), onStop: (fn) => stops.push(fn), onCapture: (fn) => captures.push(fn),
+ onStart: (fn) => starts.push(fn), onStop: (fn) => stops.push(fn), onCapture: (fn) => captures.push(fn), onBind: (fn) => binds.push(fn),
})
const capture = new EventEmitter()
return {
@@ -65,6 +65,8 @@ function setup(o: { app?: string | null; attendees?: Meeting['attendees'] } = {}
/** audio heard: meeting time `ms`, arriving at wall clock `at` */
audio(ms: number, at: number) { clock = at; capture.emit('pcm', 'them', ms, new Float32Array(1600)) },
emit: (l: WatchLine) => emit(l),
+ /** the recording learned its call app (CALL bind) */
+ bind(app: string) { binds.forEach((f) => f({ ...store.meeting(m.id)!, app })) },
stop() { const s = { ...store.meeting(m.id)!, state: 'stopped' as const }; stops.forEach((f) => f(s)) },
}
}
@@ -104,6 +106,19 @@ describe('Webex accessibility roster', () => {
})
describe('hookCallNames', () => {
+ it('a recording started by hand watches every call app until its app is known, then only that one (a Teams chat window cannot hide a Meet call, #72)', () => {
+ const s = setup({ app: null })
+ s.start()
+ expect(s.watched[0]).toContain('com.microsoft.teams2')
+ s.bind('Chrome')
+ expect(s.stopped()).toBe(1)
+ expect(s.watched.at(-1)).toEqual(watchIds('Chrome'))
+ // a meeting that knew its app from the start is never watched again
+ const k = setup()
+ k.start(); k.bind('Chrome')
+ expect(k.watched).toHaveLength(1)
+ })
+
it('says what it read in main.log (info, which the log file keeps; console.log never reaches it)', () => {
const root = mkdtempSync(join(tmpdir(), 'yogurt-callnames-')); dirs.push(root)
const store = openStore(join(root, 'yogurt.db')); stores.push(store)
@@ -169,6 +184,9 @@ describe('hookCallNames', () => {
expect(s.changed).toEqual([s.m.id])
// the first reading is pictured in the log, for a real call's data
expect(s.logs.some((l) => l.includes('AXTabGroup'))).toBe(true)
+ // main.log is pasted into public issues: no one's name reaches it, only counts and shapes
+ for (const name of ['Alex Morgan', 'Dana Smith', 'Ann Lee']) expect(s.logs.join('\n')).not.toContain(name)
+ expect(s.logs.some((l) => /talking 1 of 3/.test(l))).toBe(true)
})
it('without Accessibility, or with nothing read, every line stays Them and nothing changes', async () => {
diff --git a/app/test/callParse.test.ts b/app/test/callParse.test.ts
index 20ab3836..003ea4dc 100644
--- a/app/test/callParse.test.ts
+++ b/app/test/callParse.test.ts
@@ -114,6 +114,27 @@ describe('Google Meet', () => {
expect(readCall('meet', [meetWindow([meetTile('Dana Smith', ['Abc12'])])], { talkingClasses: ['Abc12'] }).speaking).toEqual(['Dana Smith'])
})
+ it("Meet's own words are never people: lobby, toasts, sharing, leaving and controls (#71)", () => {
+ const ui = ['Ready to join?', 'In 2 mins', 'Looking for others in the call...', 'Mon, Nov 16', 'Your camera is on.', 'Background is now blurred',
+ 'Reducing noise', 'Continuous chat is turned off', 'Messages will not be saved', 'Presentation is starting...', 'Select a tab to share',
+ 'Share with tab audio', 'Quarterly plan - Google Docs', 'Alex Doe has left the meeting', 'No one else is in this meeting',
+ 'Returning to home screen in 60 seconds.', 'Meet', 'Reframe', 'Turn off camera (⌘ + e)', 'Learn more about Gemini in Meetings.', 'Chat / People panel is open']
+ const r = readCall('meet', [meetWindow([meetTile('Dana Smith'), ...ui.map((u) => meetTile(u))])])
+ expect(r.participants).toEqual(['Dana Smith'])
+ })
+
+ it('a name in a toast or status area is not a tile (#71)', () => {
+ const toast = node('AXGroup', { s: 'AXApplicationStatus' }, meetTile('Ann Lee'))
+ const alert = node('alert', {}, meetTile('Bo Park'))
+ expect(readCall('meet', [meetWindow([meetTile('Dana Smith'), toast, alert])]).participants).toEqual(['Dana Smith'])
+ })
+
+ it('real names of every shape still count', () => {
+ const names = ['Dana Smith', 'Ana María de la Cruz', 'Mary-Jane O\'Neil', 'J. R. Smith', 'Ludwig van Beethoven', '李雷', 'jiwon', 'Ann Lee (Presenting)']
+ expect(readCall('meet', [meetWindow(names.map((n) => meetTile(n)))]).participants)
+ .toEqual(['Dana Smith', 'Ana María de la Cruz', 'Mary-Jane O\'Neil', 'J. R. Smith', 'Ludwig van Beethoven', '李雷', 'jiwon', 'Ann Lee'])
+ })
+
it('only windows showing a Meet call are read', () => {
expect(readCall('meet', [meetWindow([meetTile('Dana Smith', ['v5h6Xc'])], 'Inbox - Gmail')]).participants).toEqual([])
})
@@ -192,10 +213,20 @@ describe('Microsoft Teams', () => {
})
describe('summarize: a short picture of the tree for the log', () => {
- it('counts roles and shows the first texts, with ids and classes', () => {
- const s = summarize([zoomWindow(['Dana Smith, Computer audio unmuted, Active speaker'])], 4)
- expect(s.split('\n')[0]).toMatch(/^roles: AXWindow=1 .*AXTabGroup=1/)
- expect(s).toContain('AXTabGroup "Dana Smith, Computer audio unmuted, Active speaker"')
- expect(s.split('\n')).toHaveLength(5)
+ it("counts roles and shows ids, classes and the app's own words, never a name or anything said", () => {
+ const captions = node('AXGroup', { i: 'captions' }, node('AXStaticText', { v: 'we can sign the renewal with Acme on Friday' }))
+ const s = summarize([zoomWindow(['Dana Smith, Computer audio unmuted, Active speaker'], ['Alex Morgan (me)'], [captions])], 40)
+ expect(s.split('\n')[0]).toMatch(/^roles: .*AXWindow=1 .*AXTabGroup=1/)
+ expect(s).toContain('AXTabGroup "‹10›, Computer audio unmuted, Active speaker"')
+ expect(s).toContain('AXButton#audio')
+ expect(s).toContain('AXOutline "Participants list"')
+ expect(s).toContain('AXGroup#captions')
+ for (const secret of ['Dana', 'Alex', 'renewal', 'Acme', 'Friday']) expect(s).not.toContain(secret)
+ })
+ it('keeps at most max lines, and a window title only as words the app owns', () => {
+ const s = summarize([win(node('AXWindow', {}, node('AXButton', { d: 'Leave' }), node('AXStaticText', { v: 'Budget review' })), 'Meet - abc-defg-hij')], 2)
+ expect(s.split('\n')).toHaveLength(3)
+ expect(s).toContain('window "Meet - ‹12›"')
+ expect(s).not.toContain('abc-defg-hij')
})
})