feat(desktop): Shift+click the status-bar zap to toggle YOLO globally (#41666)
The status-bar zap currently toggles per-session approval bypass (the same scope as the TUI's Shift+Tab). This adds a global escape hatch: Shift+clicking the zap flips the persistent approvals.mode in config.yaml between "off" (bypass on) and "manual" (bypass off), affecting every session, the CLI, the TUI, and cron — and it survives restarts. - statusbar-controls: thread the click's shiftKey through onSelect via a new StatusbarSelectModifiers arg. - yolo-session: add setGlobalYolo() that calls config.set with scope="global". - use-statusbar-items: branch toggleYolo on modifiers.shiftKey; plain click stays per-session, Shift+click goes global. - tui_gateway config.set "yolo" key: add scope="global" that reads/writes approvals.mode through the gateway's own (mtime-cached) config view, honors an explicit value, and re-emits session.info to every live session so each window's zap reflects the flip immediately. - i18n: tooltip copy in en/ja/zh/zh-hant notes Shift+click toggles globally. Tests: two new tui_gateway tests cover the global toggle and explicit-value paths; existing session/process-scope yolo tests still pass.
This commit is contained in:
@@ -1463,8 +1463,8 @@ export const en: Translations = {
|
||||
contextUsage: 'Context usage',
|
||||
session: 'Session',
|
||||
runtimeSessionElapsed: 'Runtime session elapsed',
|
||||
yoloOn: 'YOLO on — auto-approving dangerous commands. Click to turn off.',
|
||||
yoloOff: 'YOLO off — click to auto-approve dangerous commands.',
|
||||
yoloOn: 'YOLO on — auto-approving dangerous commands. Click to turn off. Shift+click toggles it globally.',
|
||||
yoloOff: 'YOLO off — click to auto-approve dangerous commands. Shift+click toggles it globally.',
|
||||
modelNone: 'none',
|
||||
noModel: 'no model',
|
||||
switchModel: 'Switch model',
|
||||
|
||||
@@ -1606,8 +1606,8 @@ export const ja = defineLocale({
|
||||
contextUsage: 'コンテキスト使用状況',
|
||||
session: 'セッション',
|
||||
runtimeSessionElapsed: 'ランタイムセッション経過時間',
|
||||
yoloOn: 'YOLO オン — 危険なコマンドを自動承認中。クリックでオフに。',
|
||||
yoloOff: 'YOLO オフ — クリックで危険なコマンドを自動承認。',
|
||||
yoloOn: 'YOLO オン — 危険なコマンドを自動承認中。クリックでオフに。Shift+クリックで全体に切り替え。',
|
||||
yoloOff: 'YOLO オフ — クリックで危険なコマンドを自動承認。Shift+クリックで全体に切り替え。',
|
||||
modelNone: 'なし',
|
||||
noModel: 'モデルなし',
|
||||
switchModel: 'モデルを切り替え',
|
||||
|
||||
@@ -1567,8 +1567,8 @@ export const zhHant = defineLocale({
|
||||
contextUsage: '上下文使用量',
|
||||
session: '工作階段',
|
||||
runtimeSessionElapsed: '執行時工作階段已用時間',
|
||||
yoloOn: 'YOLO 已開啟 — 自動核准危險指令。點擊關閉。',
|
||||
yoloOff: 'YOLO 已關閉 — 點擊自動核准危險指令。',
|
||||
yoloOn: 'YOLO 已開啟 — 自動核准危險指令。點擊關閉。Shift+點擊可全域切換。',
|
||||
yoloOff: 'YOLO 已關閉 — 點擊自動核准危險指令。Shift+點擊可全域切換。',
|
||||
modelNone: '無',
|
||||
noModel: '無模型',
|
||||
switchModel: '切換模型',
|
||||
|
||||
@@ -1644,8 +1644,8 @@ export const zh: Translations = {
|
||||
contextUsage: '上下文用量',
|
||||
session: '会话',
|
||||
runtimeSessionElapsed: '运行时会话已用时间',
|
||||
yoloOn: 'YOLO 已开启 - 自动批准危险命令。点击关闭。',
|
||||
yoloOff: 'YOLO 已关闭 - 点击自动批准危险命令。',
|
||||
yoloOn: 'YOLO 已开启 - 自动批准危险命令。点击关闭。Shift+点击可全局切换。',
|
||||
yoloOff: 'YOLO 已关闭 - 点击自动批准危险命令。Shift+点击可全局切换。',
|
||||
modelNone: '无',
|
||||
noModel: '无模型',
|
||||
switchModel: '切换模型',
|
||||
|
||||
Reference in New Issue
Block a user