Clarify keep-awake tooltip behavior by platform (#25323)

* fix: make keep-awake tooltip lid behavior platform-aware

Extracted platform-specific lid behavior notes into a reusable function and
updated the keep-awake tooltip to show accurate descriptions for each OS:
macOS explains that closing the lid may still sleep the device, Windows
references device power settings, and Linux clarifies Orca's lid-close request
behavior. Updated copy to be device-agnostic instead of Caffeinate/MacBook
specific.

* fix: clarify macOS keep-awake tooltip copy and add translations

Update agent keep-awake descriptions on macOS to accurately explain that the feature prevents idle sleep (not all sleep modes) and only works with the lid open. Add translations for Spanish, French, Japanese, Korean, and Chinese.
This commit is contained in:
Jinjing
2026-10-04 16:05:00 -07:00
committed by GitHub
parent 0c761a7610
commit 52b3766f48
11 changed files with 90 additions and 22 deletions
@@ -12,7 +12,11 @@ import {
getAgentWorkspaceTrustDescription,
getAgentWorkspaceTrustTitle
} from './agent-workspace-trust-copy'
import { getAgentAwakeDescription, getAgentAwakeTitle } from './agent-awake-copy'
import {
getAgentAwakeDescription,
getAgentAwakeLidNote,
getAgentAwakeTitle
} from './agent-awake-copy'
import { getCodexTerminalServerIsolationTitle } from './codex-terminal-server-isolation-copy'
import { AgentAwakeSetting } from './AgentAwakeSetting'
import { AgentRuntimeSetting } from './AgentRuntimeSetting'
@@ -251,7 +255,7 @@ describe('AgentsPane', () => {
expect(markup).not.toContain('aria-label="Agent runtime"')
expect(markup).toContain('Keep computer awake')
expect(markup).toContain(
'Choose On, Agent, or Off. Agent mode stays awake while agents are working. Caffeinate prevents idle sleep while active, but closing a MacBook lid may still put it to sleep.'
'Choose On, Agent, or Off. Agent mode stays awake while agents are working. Orca also asks this device to stay awake when the lid is closed, subject to its power policy.'
)
expect(markup).toContain('role="radiogroup"')
expect(markup).toContain('>Agent<')
@@ -353,6 +357,24 @@ describe('AgentsPane', () => {
)
})
it('describes macOS lid behavior without promising lid-closed wake', () => {
expect(getAgentAwakeDescription('Macintosh')).toBe(
'Choose On, Agent, or Off. Agent mode prevents idle sleep while agents work, so long runs finish with the lid open. Closing the lid still puts this Mac to sleep.'
)
})
it('picks the lid note for each platform', () => {
expect(getAgentAwakeLidNote('Macintosh')).toBe(
'Prevents idle sleep with the lid open; closing the lid still puts this Mac to sleep.'
)
expect(getAgentAwakeLidNote('Windows')).toBe(
"Lid-close behavior follows this device's power settings."
)
expect(getAgentAwakeLidNote('X11; Linux x86_64')).toBe(
'Orca also asks this device to stay awake when the lid is closed, subject to its power policy.'
)
})
it('updates the keep-awake mode with its legacy fallback', () => {
const updateSettings = vi.fn()
const element = AgentAwakeSetting({
@@ -5,6 +5,8 @@ import { searchKeywords } from './settings-search-keywords'
const AGENT_AWAKE_TITLE_KEY = 'auto.components.settings.agent-awake-copy.modeTitle'
const AGENT_AWAKE_DESCRIPTION_WINDOWS_KEY =
'auto.components.settings.agent-awake-copy.modeDescriptionWindows'
const AGENT_AWAKE_DESCRIPTION_MAC_KEY =
'auto.components.settings.agent-awake-copy.modeDescriptionMac'
const AGENT_AWAKE_DESCRIPTION_DEFAULT_KEY =
'auto.components.settings.agent-awake-copy.modeDescriptionDefault'
@@ -31,6 +33,13 @@ export function getAgentAwakeDescription(
"Choose On, Agent, or Off. Agent mode stays awake while agents are working; lid-close behavior follows this device's power settings."
)
}
// macOS caffeinate can't hold a closed lid awake; Linux blocks logind's lid switch.
if (userAgent.includes('Mac')) {
return translate(
AGENT_AWAKE_DESCRIPTION_MAC_KEY,
'Choose On, Agent, or Off. Agent mode prevents idle sleep while agents work, so long runs finish with the lid open. Closing the lid still puts this Mac to sleep.'
)
}
return translate(
AGENT_AWAKE_DESCRIPTION_DEFAULT_KEY,
@@ -38,6 +47,27 @@ export function getAgentAwakeDescription(
)
}
export function getAgentAwakeLidNote(
userAgent = typeof navigator === 'undefined' ? '' : navigator.userAgent
): string {
if (userAgent.includes('Windows')) {
return translate(
'auto.components.settings.agent-awake-copy.lidNoteWindows',
"Lid-close behavior follows this device's power settings."
)
}
if (userAgent.includes('Mac')) {
return translate(
'auto.components.settings.agent-awake-copy.lidNoteMac',
'Prevents idle sleep with the lid open; closing the lid still puts this Mac to sleep.'
)
}
return translate(
'auto.components.settings.agent-awake-copy.lidNoteDefault',
'Orca also asks this device to stay awake when the lid is closed, subject to its power policy.'
)
}
export function getAgentAwakeSearchKeywords(
userAgent = typeof navigator === 'undefined' ? '' : navigator.userAgent
): string[] {
@@ -4,7 +4,11 @@ import type { ReactNode } from 'react'
import { cleanup, render, screen, waitFor, within } from '@testing-library/react'
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'
import { i18n, translate } from '@/i18n/i18n'
import { getAgentAwakeModeLabel, getAgentAwakeTitle } from '../settings/agent-awake-copy'
import {
getAgentAwakeLidNote,
getAgentAwakeModeLabel,
getAgentAwakeTitle
} from '../settings/agent-awake-copy'
import { CaffeinateStatusSegment } from './CaffeinateStatusSegment'
const storeMocks = vi.hoisted(() => ({
@@ -197,9 +201,7 @@ describe('keep-awake copy under non-English UI languages', () => {
name: '防止电脑休眠,智能体 · 生效中'
})
expect(trigger.textContent).toContain('智能体')
expect(screen.getByRole('tooltip').textContent).toContain(
'Caffeinate prevents idle sleep while active. Closing a MacBook lid may still put it to sleep.'
)
expect(screen.getByRole('tooltip').textContent).toContain(getAgentAwakeLidNote())
const menu = screen.getByRole('menu')
await waitFor(() => expect(menu.textContent).toContain('防止电脑休眠'))
@@ -13,7 +13,11 @@ import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip
import { useAppStore } from '@/store'
import { isPairedWebClientWindow } from '@/lib/desktop-window-chrome'
import { translate } from '@/i18n/i18n'
import { getAgentAwakeModeLabel, getAgentAwakeTitle } from '../settings/agent-awake-copy'
import {
getAgentAwakeLidNote,
getAgentAwakeModeLabel,
getAgentAwakeTitle
} from '../settings/agent-awake-copy'
import {
computerAwakeSettingsForMode,
normalizeComputerAwakeMode,
@@ -110,11 +114,7 @@ export function CaffeinateStatusSegment({
</DropdownMenuTrigger>
</TooltipTrigger>
<TooltipContent side="top" sideOffset={6}>
{ariaLabel}.{' '}
{translate(
'auto.components.status.bar.CaffeinateStatusSegment.tooltipDescription',
'Caffeinate prevents idle sleep while active. Closing a MacBook lid may still put it to sleep.'
)}
{ariaLabel}. {getAgentAwakeLidNote()}
</TooltipContent>
</Tooltip>
<DropdownMenuContent
+3 -2
View File
@@ -1577,9 +1577,10 @@
},
"agent-awake-copy": {
"95d3031db2": "Keeps this computer and display awake while agents are working. Lid-close behavior follows this device's power settings.",
"a42f6fbdd8": "Keeps this computer and display awake while agents are working. Caffeinate prevents idle sleep while active, but closing a MacBook lid may still put it to sleep.",
"a42f6fbdd8": "Keeps this computer and display awake while agents are working. Orca also asks this device to stay awake when the lid is closed, subject to its power policy.",
"e5995ce268": "Keep computer awake while agents are working",
"modeDescriptionDefault": "Choose On, Agent, or Off. Agent mode stays awake while agents are working. Caffeinate prevents idle sleep while active, but closing a MacBook lid may still put it to sleep.",
"modeDescriptionDefault": "Choose On, Agent, or Off. Agent mode stays awake while agents are working. Orca also asks this device to stay awake when the lid is closed, subject to its power policy.",
"modeDescriptionMac": "Choose On, Agent, or Off. Agent mode prevents idle sleep while agents work, so long runs finish with the lid open. Closing the lid still puts this Mac to sleep.",
"modeDescriptionWindows": "Choose On, Agent, or Off. Agent mode stays awake while agents are working; lid-close behavior follows this device's power settings.",
"modeTitle": "Keep computer awake"
},
+6 -3
View File
@@ -4146,7 +4146,6 @@
"active": "Active",
"inactive": "Inactive",
"ariaLabel": "{{title}}, {{status}}",
"tooltipDescription": "Caffeinate prevents idle sleep while active. Closing a MacBook lid may still put it to sleep.",
"onDescription": "Keep this computer awake continuously",
"autoDescription": "Stay awake while an agent is working",
"offDescription": "Allow normal system sleep behavior"
@@ -10987,10 +10986,14 @@
"agent-awake-copy": {
"e5995ce268": "Keep computer awake while agents are working",
"95d3031db2": "Keeps this computer and display awake while agents are working. Lid-close behavior follows this device's power settings.",
"a42f6fbdd8": "Keeps this computer and display awake while agents are working. Caffeinate prevents idle sleep while active, but closing a MacBook lid may still put it to sleep.",
"a42f6fbdd8": "Keeps this computer and display awake while agents are working. Orca also asks this device to stay awake when the lid is closed, subject to its power policy.",
"modeTitle": "Keep computer awake",
"modeDescriptionWindows": "Choose On, Agent, or Off. Agent mode stays awake while agents are working; lid-close behavior follows this device's power settings.",
"modeDescriptionDefault": "Choose On, Agent, or Off. Agent mode stays awake while agents are working. Caffeinate prevents idle sleep while active, but closing a MacBook lid may still put it to sleep."
"modeDescriptionMac": "Choose On, Agent, or Off. Agent mode prevents idle sleep while agents work, so long runs finish with the lid open. Closing the lid still puts this Mac to sleep.",
"modeDescriptionDefault": "Choose On, Agent, or Off. Agent mode stays awake while agents are working. Orca also asks this device to stay awake when the lid is closed, subject to its power policy.",
"lidNoteWindows": "Lid-close behavior follows this device's power settings.",
"lidNoteMac": "Prevents idle sleep with the lid open; closing the lid still puts this Mac to sleep.",
"lidNoteDefault": "Orca also asks this device to stay awake when the lid is closed, subject to its power policy."
},
"agent-status-hooks-copy": {
"7707c15abb": "Agent status hooks",
+3 -1
View File
@@ -9466,7 +9466,9 @@
"e5995ce268": "Mantener la computadora activa mientras los agentes están trabajando",
"95d3031db2": "Mantiene esta computadora y la pantalla activas mientras los agentes están trabajando. El comportamiento al cerrar la tapa sigue la configuración de energía de este dispositivo.",
"a42f6fbdd8": "Mantiene esta computadora y la pantalla activas mientras los agentes están trabajando. Orca también le pide a este dispositivo que permanezca activo cuando la tapa está cerrada, sujeto a su política de energía.",
"modeTitle": "Mantener la computadora activa"
"modeTitle": "Mantener la computadora activa",
"modeDescriptionMac": "Elige Activado, Agente o Desactivado. El modo Agente evita la suspensión por inactividad mientras los agentes trabajan, para que las tareas largas terminen con la tapa abierta. Cerrar la tapa sigue poniendo este Mac en suspensión.",
"lidNoteMac": "Evita la suspensión por inactividad con la tapa abierta; cerrar la tapa sigue poniendo este Mac en suspensión."
},
"AgentAwakeSetting": {
"on": "Activado",
+3 -1
View File
@@ -10855,7 +10855,9 @@
"a42f6fbdd8": "Maintient cet ordinateur et cet écran éveillés pendant que les agents travaillent. Orca demande également à cet appareil de rester éveillé lorsque le capot est fermé, sous réserve de sa politique d'alimentation.",
"modeTitle": "Empêcher la mise en veille de l'ordinateur",
"modeDescriptionWindows": "Choisissez Activé, Agent ou Désactivé. Le mode Agent reste éveillé tant que des agents travaillent ; le comportement à la fermeture du capot suit les paramètres d'alimentation de cet appareil.",
"modeDescriptionDefault": "Choisissez Activé, Agent ou Désactivé. Le mode Agent reste éveillé tant que des agents travaillent. Orca demande également à cet appareil de rester éveillé lorsque le capot est fermé, sous réserve de sa politique d'alimentation."
"modeDescriptionMac": "Choisissez Activé, Agent ou Désactivé. Le mode Agent empêche la mise en veille pendant que des agents travaillent, pour que les longues tâches se terminent avec le capot ouvert. Fermer le capot met quand même ce Mac en veille.",
"modeDescriptionDefault": "Choisissez Activé, Agent ou Désactivé. Le mode Agent reste éveillé tant que des agents travaillent. Orca demande également à cet appareil de rester éveillé lorsque le capot est fermé, sous réserve de sa politique d'alimentation.",
"lidNoteMac": "Empêche la mise en veille avec le capot ouvert ; fermer le capot met quand même ce Mac en veille."
},
"agent-status-hooks-copy": {
"7707c15abb": "Hooks de statut des agents",
+3 -1
View File
@@ -10728,7 +10728,9 @@
"a42f6fbdd8": "Agent が作業している間、このコンピュータとディスプレイを起きたままにします。Orca は電源ポリシーに従い、蓋が閉じているときもこのデバイスを起きたままにするよう要求します。",
"modeTitle": "コンピュータをスリープさせない",
"modeDescriptionWindows": "[オン]、[Agent]、または [オフ] を選択します。Agent モードは、Agent が動作している間は起動したままになります。蓋を閉じる動作は、このデバイスの電源設定に従います。",
"modeDescriptionDefault": "[オン]、[Agent]、または [オフ] を選択します。Agent が動作している間、Agent モードは起動したままになります。 Orca はまた、電源ポリシーに従って、蓋が閉じられているときにこのデバイスが起動したままになるように要求します。"
"modeDescriptionMac": "[オン]、[Agent]、または [オフ] を選択します。Agent モードは Agent の作業中のアイドルスリープを防止するため、蓋を開けたまま長時間の実行を完了できます。蓋を閉じると、この Mac はスリープします。",
"modeDescriptionDefault": "[オン]、[Agent]、または [オフ] を選択します。Agent が動作している間、Agent モードは起動したままになります。 Orca はまた、電源ポリシーに従って、蓋が閉じられているときにこのデバイスが起動したままになるように要求します。",
"lidNoteMac": "蓋を開けたままアイドルスリープを防止します。蓋を閉じると、この Mac はスリープします。"
},
"AgentAwakeSetting": {
"on": "オン",
+3 -1
View File
@@ -10691,7 +10691,9 @@
"a42f6fbdd8": "agents가 작업하는 동안 이 컴퓨터와 디스플레이를 깨어 있게 유지합니다. Orca는 전원 정책에 따라 뚜껑이 닫혀 있을 때도 이 기기를 깨어 있게 유지하도록 요청합니다.",
"modeTitle": "컴퓨터 절전 방지",
"modeDescriptionWindows": "켜짐, 에이전트 또는 꺼짐을 선택합니다. 에이전트 모드는 에이전트가 작업하는 동안 활성 상태를 유지합니다. 덮개 닫힘 동작은 이 기기의 전원 설정을 따릅니다.",
"modeDescriptionDefault": "켜짐, 에이전트 또는 꺼짐을 선택합니다. 에이전트 모드는 에이전트가 작업하는 동안 활성 상태를 유지합니다. Orca는 또한 전원 정책에 따라 덮개가 닫혀 있을 때 이 기기가 활성 상태를 유지하도록 요청합니다."
"modeDescriptionMac": "켜짐, 에이전트 또는 꺼짐을 선택합니다. 에이전트 모드는 에이전트가 작업하는 동안 유휴 절전을 방지하므로 덮개를 연 상태로 긴 작업을 완료할 수 있습니다. 덮개를 닫으면 이 Mac이 절전 모드로 전환됩니다.",
"modeDescriptionDefault": "켜짐, 에이전트 또는 꺼짐을 선택합니다. 에이전트 모드는 에이전트가 작업하는 동안 활성 상태를 유지합니다. Orca는 또한 전원 정책에 따라 덮개가 닫혀 있을 때 이 기기가 활성 상태를 유지하도록 요청합니다.",
"lidNoteMac": "덮개를 연 상태에서는 유휴 절전을 방지합니다. 덮개를 닫으면 이 Mac이 절전 모드로 전환됩니다."
},
"AgentAwakeSetting": {
"on": "켜짐",
+3 -1
View File
@@ -10703,7 +10703,9 @@
"a42f6fbdd8": "在智能体工作时保持此电脑和显示器唤醒。Orca 还会根据电源策略,在合盖时请求此设备保持唤醒。",
"modeTitle": "防止电脑休眠",
"modeDescriptionWindows": "选择“打开”、“代理”或“关闭”。代理工作时代理模式保持唤醒状态;盖子关闭行为遵循该设备的电源设置。",
"modeDescriptionDefault": "选择“打开”、“代理”或“关闭”。当代理工作时,代理模式保持唤醒状态。 Orca 还要求该设备在盖子关闭时保持唤醒状态,具体取决于其电源策略。"
"modeDescriptionMac": "选择“打开”、“代理”或“关闭”。代理模式会在代理工作时防止空闲休眠,因此开盖即可完成长时间任务。合上盖子仍会使此 Mac 进入睡眠状态。",
"modeDescriptionDefault": "选择“打开”、“代理”或“关闭”。当代理工作时,代理模式保持唤醒状态。 Orca 还要求该设备在盖子关闭时保持唤醒状态,具体取决于其电源策略。",
"lidNoteMac": "开盖时防止空闲休眠;合上盖子仍会使此 Mac 进入睡眠状态。"
},
"AgentAwakeSetting": {
"on": "开启",