Skip to content

The agent that grows with you

fmt(js): `npm run fix` on merge (#118563)

hermes-seaeye[bot]87ff1c2f7739
diff --git a/apps/desktop/electron/hud-modifier-monitor.test.ts b/apps/desktop/electron/hud-modifier-monitor.test.ts
index c0f6f57af47..5bf24258886 100644
--- a/apps/desktop/electron/hud-modifier-monitor.test.ts
+++ b/apps/desktop/electron/hud-modifier-monitor.test.ts
@@ -78,7 +78,10 @@ test('a missing helper is distinguished from a helper that cannot start', () =>
const child = new Child()
const statuses: NativeGestureStatus[] = []
const monitor = new NativeGestureMonitor({ path: '/helper', parseGesture: () => null, spawn: () => child })
- monitor.start(() => {}, status => statuses.push(status))
+ monitor.start(
+ () => {},
+ status => statuses.push(status)
+ )
child.emit('error', Object.assign(new Error('spawn failed'), { code }))
child.emit('close', -1, null)
assert.deepEqual(statuses.at(-1), {
diff --git a/apps/desktop/electron/hud-modifier.test.ts b/apps/desktop/electron/hud-modifier.test.ts
index 6ae10093d73..2b636f3ece5 100644
--- a/apps/desktop/electron/hud-modifier.test.ts
+++ b/apps/desktop/electron/hud-modifier.test.ts
@@ -96,10 +96,12 @@ it('persists opt-in, fences stale native callbacks and re-arms after lock withou
install()
expect(native.start.mock.calls.at(-1)![2]).toBe(false)
const [restartTap, restartStatus] = native.start.mock.calls.at(-1)!
+
for (const reason of ['missing-helper', 'unsupported-session']) {
restartStatus({ type: 'error', code: 'unavailable', reason })
expect(await call('settings:get')).toEqual({ enabled: true, state: 'unavailable', reason })
}
+
restartStatus({ type: 'ready' })
expect(await call('settings:get')).toEqual({ enabled: true, state: 'ready' })
app.emit('will-quit')
diff --git a/apps/desktop/electron/minimize-to-tray.ts b/apps/desktop/electron/minimize-to-tray.ts
index 3dbb1ed6ba9..7fa99f3943f 100644
--- a/apps/desktop/electron/minimize-to-tray.ts
+++ b/apps/desktop/electron/minimize-to-tray.ts
@@ -194,10 +194,12 @@ export function createMinimizeToTray(options: Options) {
win.hide()
syncDock()
+
return true
}
win.on('minimize', hide)
+
if (closeToTray) {
win.on('close', event => {
if (hide()) {
diff --git a/apps/desktop/src/app/settings/hud-modifier-settings.test.tsx b/apps/desktop/src/app/settings/hud-modifier-settings.test.tsx
index ab6024429c5..3832a1a34a2 100644
--- a/apps/desktop/src/app/settings/hud-modifier-settings.test.tsx
+++ b/apps/desktop/src/app/settings/hud-modifier-settings.test.tsx
@@ -88,6 +88,7 @@ it('rereads after an unconfirmed write and keeps failed reads recoverable', asyn
await act(async () => fireEvent.click(screen.getByRole('button', { name: common.retry })))
expect(api.setEnabled).toHaveBeenCalledOnce()
expect(screen.getByText(copy.unavailable)).toBeTruthy()
+
for (const [reason, message] of [
['missing-helper', copy.missingHelper],
['unsupported-session', copy.unsupportedSession]
@@ -96,6 +97,7 @@ it('rereads after an unconfirmed write and keeps failed reads recoverable', asyn
expect(screen.getByText(message)).toBeTruthy()
expect(screen.queryByText(copy.unavailable)).toBeNull()
}
+
await act(async () => emit({ enabled: true, state: 'ready' }))
expect(screen.queryByRole('alert')).toBeNull()
})
diff --git a/apps/desktop/src/app/settings/hud-modifier-settings.tsx b/apps/desktop/src/app/settings/hud-modifier-settings.tsx
index da9659ecf6b..29c765b9fe1 100644
--- a/apps/desktop/src/app/settings/hud-modifier-settings.tsx
+++ b/apps/desktop/src/app/settings/hud-modifier-settings.tsx
@@ -89,6 +89,7 @@ export function HudModifierSettings() {
const unavailableNotice = status?.reason
? { 'missing-helper': copy.missingHelper, 'unsupported-session': copy.unsupportedSession }[status.reason]
: copy.unavailable
+
const notice =
error ??
(status?.enabled && status.state === 'input-permission' ? copy.permission : null) ??
diff --git a/apps/desktop/src/i18n/ar.ts b/apps/desktop/src/i18n/ar.ts
index 55eace006d0..eb66c96af27 100644
--- a/apps/desktop/src/i18n/ar.ts
+++ b/apps/desktop/src/i18n/ar.ts
@@ -908,8 +908,7 @@ export const ar = defineLocale({
'اسمح لـ Hermes في إعدادات النظام ← الخصوصية والأمان ← مراقبة الإدخال، ثم أعد المحاولة. لا تسجّل هذه الإيماءة ضغطات المفاتيح ولا تلتقط الشاشة.',
unavailable:
'تعذّر تشغيل مساعد إيماءة HUD أو توقف بشكل غير متوقع. أعد المحاولة أو أعد تشغيل Hermes. يظل اختصار HUD الحالي يعمل داخل Hermes.',
- missingHelper:
- 'مساعد إيماءة HUD غير موجود في تثبيت Hermes هذا. حدّث Hermes أو أعد تثبيته، ثم أعد المحاولة.',
+ missingHelper: 'مساعد إيماءة HUD غير موجود في تثبيت Hermes هذا. حدّث Hermes أو أعد تثبيته، ثم أعد المحاولة.',
unsupportedSession:
'جلسة سطح المكتب هذه لا تدعم ضغطات مفاتيح التعديل على مستوى النظام. يتطلب Linux جلسة X11؛ Wayland غير مدعوم.'
},
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index 529436e54a4..9b3153d61e5 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -1038,7 +1038,8 @@ export const en: Translations = {
'Allow Hermes in System Settings → Privacy & Security → Input Monitoring, then retry. This gesture does not record keystrokes or capture your screen.',
unavailable:
'The HUD gesture helper could not start or stopped unexpectedly. Retry, or restart Hermes. The existing HUD shortcut still works inside Hermes.',
- missingHelper: 'This Hermes installation is missing the HUD gesture helper. Update or reinstall Hermes, then retry.',
+ missingHelper:
+ 'This Hermes installation is missing the HUD gesture helper. Update or reinstall Hermes, then retry.',
unsupportedSession:
'This desktop session does not support global modifier taps. Linux requires X11; Wayland is not supported.'
},
diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts
index 63bc7cb4a62..220d3820b58 100644
--- a/apps/desktop/src/i18n/zh-hant.ts
+++ b/apps/desktop/src/i18n/zh-hant.ts
@@ -1027,8 +1027,7 @@ export const zhHant = defineLocale({
description:
'在 Mac 上按下並放開 ⌘ + Option,在 Windows/Linux 上按下並放開 Ctrl + Alt,即可從任何應用程式將 HUD 帶到前景。預設關閉,僅適用於此裝置。',
permission: '請在系統設定 → 隱私權與安全性 → 輸入監控中允許 Hermes,然後重試。此手勢不會記錄按鍵或擷取畫面。',
- unavailable:
- 'HUD 手勢輔助程式無法啟動或意外停止。請重試或重新啟動 Hermes。Hermes 內原有的 HUD 快速鍵仍可使用。',
+ unavailable: 'HUD 手勢輔助程式無法啟動或意外停止。請重試或重新啟動 Hermes。Hermes 內原有的 HUD 快速鍵仍可使用。',
missingHelper: '此 Hermes 安裝缺少 HUD 手勢輔助程式。請更新或重新安裝 Hermes,然後重試。',
unsupportedSession: '此桌面工作階段不支援全域修飾鍵輕按事件。Linux 需要 X11;不支援 Wayland。'
},
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index 45974d59ca7..6d988ed2f3f 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -1246,8 +1246,7 @@ export const zh = defineLocale({
description:
'在 Mac 上按下并松开 ⌘ + Option,在 Windows/Linux 上按下并松开 Ctrl + Alt,即可从任意应用将 HUD 置于前台。默认关闭,仅适用于此设备。',
permission: '请在系统设置 → 隐私与安全性 → 输入监控中允许 Hermes,然后重试。此手势不会记录按键或截取屏幕。',
- unavailable:
- 'HUD 手势辅助程序无法启动或意外停止。请重试或重启 Hermes。Hermes 内原有的 HUD 快捷键仍可使用。',
+ unavailable: 'HUD 手势辅助程序无法启动或意外停止。请重试或重启 Hermes。Hermes 内原有的 HUD 快捷键仍可使用。',
missingHelper: '此 Hermes 安装缺少 HUD 手势辅助程序。请更新或重新安装 Hermes,然后重试。',
unsupportedSession: '此桌面会话不支持全局修饰键轻按事件。Linux 需要 X11;不支持 Wayland。'
},