From 98c87a6325b192d933e16dcd0d7a1dd8a73f1a7e Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Wed, 12 Aug 2026 04:17:57 -0700 Subject: [PATCH] refactor(terminal): one i18n namespace per component, and two notes worth keeping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The disconnected banner was renamed but kept reading five keys under the old component's namespace while its new strings sat under the new one — a component translating from two namespaces at once. Keys moved across all five locales; values and behaviour unchanged. Two comments earn their place. durablyBoundPtyIdForPane deliberately does NOT require the tab to still exist, unlike findTerminalTabIdForLeaf which must — adding the "missing" check there would make arbitration retire shells more eagerly, which is the opposite of what this change is for. And the respawn after the proof check in the direct-SSH catch is unreachable today by construction; saying so stops it reading as forgotten code. --- src/main/persistence.ts | 4 ++++ .../TerminalPaneDisconnectedBanner.tsx | 10 +++++----- .../src/components/terminal-pane/pty-connection.ts | 3 +++ src/renderer/src/i18n/locales/en.json | 14 ++++++-------- src/renderer/src/i18n/locales/es.json | 2 +- src/renderer/src/i18n/locales/ja.json | 2 +- src/renderer/src/i18n/locales/ko.json | 2 +- src/renderer/src/i18n/locales/zh.json | 2 +- 8 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/main/persistence.ts b/src/main/persistence.ts index ee8378aef8e..26a1af1ba08 100644 --- a/src/main/persistence.ts +++ b/src/main/persistence.ts @@ -7359,6 +7359,10 @@ export class Store { tabId: string, leafId: string ): string | undefined { + // Deliberately does NOT require the tab to still exist, unlike findTerminalTabIdForLeaf, which + // must — binding a live shell to a deleted tab registers a ghost pane. Here the consequence + // runs the other way: a binding under a departed tab only ever keeps a lease alive, and not + // retiring is the safe direction when nothing has proved the shell dead. const findLeafBinding = (session: WorkspaceSessionState | undefined): string | undefined => { const layouts = session?.terminalLayoutsByTabId return ( diff --git a/src/renderer/src/components/terminal-pane/TerminalPaneDisconnectedBanner.tsx b/src/renderer/src/components/terminal-pane/TerminalPaneDisconnectedBanner.tsx index affdfe73137..ffde781b798 100644 --- a/src/renderer/src/components/terminal-pane/TerminalPaneDisconnectedBanner.tsx +++ b/src/renderer/src/components/terminal-pane/TerminalPaneDisconnectedBanner.tsx @@ -32,11 +32,11 @@ export function TerminalPaneDisconnectedBanner({ ) : retrying ? translate( - 'auto.components.terminal.pane.TerminalRemoteRuntimeReconnectBanner.retryingTitle', + 'auto.components.terminal.pane.TerminalPaneDisconnectedBanner.retryingTitle', 'Reconnecting to remote runtime' ) : translate( - 'auto.components.terminal.pane.TerminalRemoteRuntimeReconnectBanner.disconnectedTitle', + 'auto.components.terminal.pane.TerminalPaneDisconnectedBanner.disconnectedTitle', 'Remote runtime disconnected' ) @@ -47,11 +47,11 @@ export function TerminalPaneDisconnectedBanner({ ) : retrying ? translate( - 'auto.components.terminal.pane.TerminalRemoteRuntimeReconnectBanner.retryingBody', + 'auto.components.terminal.pane.TerminalPaneDisconnectedBanner.retryingBody', 'Orca will retry for up to one minute. This terminal will resume if the connection returns.' ) : translate( - 'auto.components.terminal.pane.TerminalRemoteRuntimeReconnectBanner.disconnectedBody', + 'auto.components.terminal.pane.TerminalPaneDisconnectedBanner.disconnectedBody', 'Automatic retries stopped. Reconnect to resume this terminal session.' ) @@ -86,7 +86,7 @@ export function TerminalPaneDisconnectedBanner({ 'Try again' ) : translate( - 'auto.components.terminal.pane.TerminalRemoteRuntimeReconnectBanner.reconnectButton', + 'auto.components.terminal.pane.TerminalPaneDisconnectedBanner.reconnectButton', 'Reconnect' )} diff --git a/src/renderer/src/components/terminal-pane/pty-connection.ts b/src/renderer/src/components/terminal-pane/pty-connection.ts index 0b7262e6235..cc70743a110 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection.ts @@ -8901,6 +8901,9 @@ export function connectPanePty( // Why: only proof that the session is gone may respawn. Anything // else leaves the shell running, because respawning with the // restored id resumes the same agent session a second time. + // Nothing proves it yet (see reattach-failure-classification), and this flow is + // nested under `connectionId`, so the respawn below is unreachable today. It is + // the shape the proof capability plugs into, not forgotten code. if (!isProvenSshSessionGoneError(err)) { divertToUnreachableCard(pendingSessionId) return diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index ab00f5d74d3..a3396762430 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -2998,13 +2998,6 @@ "removedBody": "The SSH host for this workspace was removed, so it can no longer connect. Remove the workspace to clear it — remote files are left untouched.", "removeWorkspaceButton": "Remove workspace" }, - "TerminalRemoteRuntimeReconnectBanner": { - "retryingTitle": "Reconnecting to remote runtime", - "disconnectedTitle": "Remote runtime disconnected", - "retryingBody": "Orca will retry for up to one minute. This terminal will resume if the connection returns.", - "disconnectedBody": "Automatic retries stopped. Reconnect to resume this terminal session.", - "reconnectButton": "Reconnect" - }, "TerminalQuickCommandsSubmenu": { "3ccc7981bb": "Host unavailable", "54f29b7c0d": "Loading host…" @@ -3013,7 +3006,12 @@ "sshPaneTitle": "Terminal disconnected", "sshPaneBody": "Orca cannot reach this terminal right now. The shell may still be running on the host, so starting a new one leaves it alone.", "tryAgainButton": "Try again", - "startNewTerminalButton": "Start a new terminal" + "startNewTerminalButton": "Start a new terminal", + "retryingTitle": "Reconnecting to remote runtime", + "disconnectedTitle": "Remote runtime disconnected", + "retryingBody": "Orca will retry for up to one minute. This terminal will resume if the connection returns.", + "disconnectedBody": "Automatic retries stopped. Reconnect to resume this terminal session.", + "reconnectButton": "Reconnect" } } }, diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index a14e64ec424..9637e22c5a9 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -2859,7 +2859,7 @@ "removedBody": "El host SSH de este espacio de trabajo fue eliminado, por lo que ya no puede conectarse. Elimina el espacio de trabajo para limpiarlo — los archivos remotos permanecen intactos.", "removeWorkspaceButton": "Eliminar espacio de trabajo" }, - "TerminalRemoteRuntimeReconnectBanner": { + "TerminalPaneDisconnectedBanner": { "retryingTitle": "Reconnecting to remote runtime", "disconnectedTitle": "Remote runtime disconnected", "retryingBody": "Orca will retry for up to one minute. This terminal will resume if the connection returns.", diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index 8e9b313dd4c..afde813f77a 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -2859,7 +2859,7 @@ "removedBody": "このワークスペースの SSH ホストが削除されたため、接続できません。ワークスペースを削除してクリアしてください — リモートファイルはそのまま残ります。", "removeWorkspaceButton": "ワークスペースを削除" }, - "TerminalRemoteRuntimeReconnectBanner": { + "TerminalPaneDisconnectedBanner": { "retryingTitle": "リモートランタイムに再接続中", "disconnectedTitle": "リモートランタイムが切断されました", "retryingBody": "Orca は最大1分間再試行します。接続が復元されると、このターミナルが再開されます。", diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index 364bc1860a0..cdddf432f08 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -2859,7 +2859,7 @@ "removedBody": "이 워크트리의 SSH 호스트가 제거되어 더 이상 연결할 수 없습니다. 워크트리를 제거하여 정리하세요 — 원격 파일은 그대로 남아 있습니다.", "removeWorkspaceButton": "워크트리 제거" }, - "TerminalRemoteRuntimeReconnectBanner": { + "TerminalPaneDisconnectedBanner": { "retryingTitle": "원격 런타임에 다시 연결 중", "disconnectedTitle": "원격 런타임 연결 끊김", "retryingBody": "Orca는 최대 1분간 재시도합니다. 연결이 복원되면 이 터미널이 재개됩니다.", diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index 2e85a5074b1..33c87d09ce3 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -2871,7 +2871,7 @@ "removedBody": "此工作区的 SSH 主机已被移除,无法再连接。请移除工作区以清理 — 远程文件不会受影响。", "removeWorkspaceButton": "移除工作区" }, - "TerminalRemoteRuntimeReconnectBanner": { + "TerminalPaneDisconnectedBanner": { "retryingTitle": "正在重新连接到远程运行时", "disconnectedTitle": "远程运行时已断开连接", "retryingBody": "Orca 将重试最多一分钟。如果连接恢复,此终端将恢复。",