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.

Settings: Manage shows only where it opens something; names from calls on Windows, and every permission on Linux, have no page (#70)

christianmat4e9215b6e347
diff --git a/app/e2e/platform.spec.ts b/app/e2e/platform.spec.ts
index fda104b8..fd23f5b1 100644
--- a/app/e2e/platform.spec.ts
+++ b/app/e2e/platform.spec.ts
@@ -23,6 +23,9 @@ for (const platform of ['win32', 'linux']) {
await expect(page.getByTestId('permission-row')).toHaveCount(names ? 4 : 3)
await expect(page.locator('[data-testid="permission-row"][data-kind="calendar"]')).toHaveCount(0)
await expect(page.locator('[data-testid="permission-row"][data-kind="accessibility"]')).toHaveCount(names ? 1 : 0)
+ // Manage only where there is a page to open (#70): never on names from calls here, and on Linux nowhere
+ await expect(page.locator('[data-testid="permission-row"][data-kind="accessibility"] [data-testid="permission-open"]')).toHaveCount(0)
+ await expect(page.locator('[data-testid="permission-row"] [data-testid="permission-open"]')).toHaveCount(platform === 'win32' ? 3 : 0)
await expect(page.getByTestId('calendar-settings')).toHaveCount(0)
} finally { await app.close() }
})
diff --git a/app/src/main/permissions.ts b/app/src/main/permissions.ts
index d36ff500..1150662d 100644
--- a/app/src/main/permissions.ts
+++ b/app/src/main/permissions.ts
@@ -35,7 +35,7 @@ export function parseStatus(raw: unknown, o: { axAsked?: boolean } = {}): Omit<P
}
/** Windows' own pages for these (Linux has none): a mic blocked under Privacy & security is turned on there */
-const WINDOWS_SETTINGS: Partial<Record<PermissionKind, string>> = { mic: 'ms-settings:privacy-microphone', systemAudio: 'ms-settings:sound', notifications: 'ms-settings:notifications' }
+export const WINDOWS_SETTINGS: Partial<Record<PermissionKind, string>> = { mic: 'ms-settings:privacy-microphone', systemAudio: 'ms-settings:sound', notifications: 'ms-settings:notifications' }
const ASK: Record<Exclude<PermissionKind, 'notifications'>, string> = { mic: 'mic-auth', systemAudio: 'audio-auth', calendar: 'calendar-auth', accessibility: 'ax-auth' }
diff --git a/app/src/renderer/src/screens/Settings.tsx b/app/src/renderer/src/screens/Settings.tsx
index 7bddf69e..8e10f865 100644
--- a/app/src/renderer/src/screens/Settings.tsx
+++ b/app/src/renderer/src/screens/Settings.tsx
@@ -13,7 +13,7 @@ import { SpokenSetting } from '../components/SpokenSetting'
import { useScrollMemory } from '../useScrollMemory'
import { appShortcuts } from '../components/Shortcuts'
import { CalendarSettings } from '../components/CalendarSettings'
-import { supportedKinds } from '../../../shared/platform'
+import { supportedKinds, settingsPage } from '../../../shared/platform'
import { Swap, SwapText } from '../components/Swap'
const THEMES = () => [['system', osWords({ mac: t('Match my Mac'), windows: t('Match Windows'), linux: t('Match my system') })], ['light', t('Light')], ['dark', t('Dark')]] as const
@@ -294,7 +294,7 @@ export function PermissionRow({ kind, status, onAsk }: { kind: PermissionKind; s
</p>
<p className="settings-description">{c.reason}</p>
</div>
- {status !== 'restricted' ? (
+ {status !== 'restricted' && (ask || settingsPage(window.yogurt.os, kind)) ? (
<button data-testid={ask ? 'permission-ask' : 'permission-open'} onClick={ask ? onAsk : () => void window.yogurt.permissions.open(kind)}
className={`workspace-button settings-action${granted ? '' : ' primary'}`}>
<span>{!status || granted ? t('Manage') : turnOn ? t('Turn on') : osWords({ mac: t('Open System Settings'), other: t('Open Settings') })}</span>
diff --git a/app/src/shared/platform.ts b/app/src/shared/platform.ts
index 57bffffa..a954b64e 100644
--- a/app/src/shared/platform.ts
+++ b/app/src/shared/platform.ts
@@ -28,6 +28,14 @@ export function capabilities(platform: string): Capabilities {
return { calendar: mac, callNames: mac || platform === 'linux' || platform === 'win32', permissionPrompts: mac, mediaPause: mac }
}
+/** permission kinds Windows has a Settings page for (main/permissions.ts WINDOWS_SETTINGS has their links) */
+const WINDOWS_PAGES: ReadonlySet<PermissionKind> = new Set(['mic', 'systemAudio', 'notifications'])
+/** Whether a permission has a settings page to open here, so its row can offer Manage: every one on a Mac, the mic,
+ * sound and notifications on Windows, none on Linux (#70: Manage on names from calls did nothing on Windows) */
+export function settingsPage(platform: string, kind: PermissionKind): boolean {
+ return platform === 'darwin' || (platform === 'win32' && WINDOWS_PAGES.has(kind))
+}
+
/** The computer Yogurt runs on. Only fake mode may pretend to be another one (YOGURT_FAKE_PLATFORM), so Mac tests can try the others' screens. */
export function platformOf(real: string, env: Record<string, string | undefined>): string {
const fake = env.YOGURT_FAKE === '1' ? env.YOGURT_FAKE_PLATFORM : undefined
diff --git a/app/test/platform.test.ts b/app/test/platform.test.ts
index 9c97de63..74352b68 100644
--- a/app/test/platform.test.ts
+++ b/app/test/platform.test.ts
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest'
-import { capabilities, commandKey, helperFile, micListHelper, platformOf, shortcutLabel, supportedKinds } from '../src/shared/platform'
+import { capabilities, commandKey, helperFile, micListHelper, platformOf, shortcutLabel, supportedKinds, settingsPage } from '../src/shared/platform'
import { PERMISSION_KINDS } from '../src/main/permissions'
describe('what each computer can do', () => {
@@ -66,3 +66,25 @@ describe('shortcuts', () => {
expect([key(true, false), key(false, true), key(true, true)].map((e) => commandKey(e, 'win32'))).toEqual([false, true, false])
})
})
+
+describe('settingsPage: a permission row offers Manage only where the computer has a page to open (#70)', () => {
+ it('a Mac opens System Settings for every one', () => {
+ for (const k of ['mic', 'systemAudio', 'calendar', 'notifications', 'accessibility'] as const) expect(settingsPage('darwin', k)).toBe(true)
+ })
+ it('Windows has pages for the mic, sound and notifications, none for names from calls', () => {
+ expect(settingsPage('win32', 'mic')).toBe(true)
+ expect(settingsPage('win32', 'systemAudio')).toBe(true)
+ expect(settingsPage('win32', 'notifications')).toBe(true)
+ expect(settingsPage('win32', 'accessibility')).toBe(false)
+ })
+ it('Linux has none to open', () => {
+ for (const k of ['mic', 'systemAudio', 'notifications', 'accessibility'] as const) expect(settingsPage('linux', k)).toBe(false)
+ })
+})
+
+describe('settingsPage agrees with the links main opens', () => {
+ it('Windows rows offer Manage exactly where main has a link', async () => {
+ const { WINDOWS_SETTINGS } = await import('../src/main/permissions')
+ for (const k of PERMISSION_KINDS) expect(settingsPage('win32', k)).toBe(!!WINDOWS_SETTINGS[k])
+ })
+})