fix(mobile): localize the folder and uncertain-create messages in the workspace composer

This commit is contained in:
Brennan Benson
2026-11-09 03:02:05 -08:00
parent bbc8d5f23a
commit 5642e4e84e
4 changed files with 35 additions and 14 deletions
@@ -0,0 +1,22 @@
import { translate } from '../i18n/mobile-i18n'
/** A create whose reply was lost, or whose resend was refused: it may exist, so another could be a second one. */
export function uncertainCreateMessage(inFolder: boolean): string {
return inFolder
? translate(
'components.newWorkspaceCreateSubmit.uncertainFolderCreate',
'This worktree may have been created. Check the folder before creating another.'
)
: translate(
'components.newWorkspaceCreateSubmit.uncertainCreate',
'This workspace may have been created. Check your workspaces before creating another.'
)
}
/** The folder screen still owns a create for this repository. */
export function folderCreateBusyMessage(): string {
return translate(
'components.newWorkspaceCreateSubmit.folderCreateBusy',
'A worktree in this repository is still being created or checked. It shows in the folder once it lands.'
)
}
@@ -3,6 +3,7 @@ import { useRef, useState, type Dispatch, type SetStateAction } from 'react'
import type { PersistedTrustedOrcaHooks } from '../../../src/shared/orca-yaml-hook-types'
import type { RetiredNameRegistry } from '../../../src/shared/worktree/retired-name-registry'
import type { RpcClient } from '../transport/rpc/rpc-client-contract'
import { folderCreateBusyMessage, uncertainCreateMessage } from './new-workspace-create-copy'
import { triggerError, triggerSuccess } from '../platform/haptics'
import type { WorktreeCreateParent } from '../tasks/worktree-create-retry'
import { createBlankWorkspace } from '../tasks/blank-workspace-create'
@@ -44,11 +45,6 @@ type CreateOptions = {
type Composer = ReturnType<typeof useMobileComposerSource>
const UNCERTAIN_FOLDER_CREATE =
'This worktree may have been created. Check the folder before creating another.'
const UNCERTAIN_CREATE =
'This workspace may have been created. Check your workspaces before creating another.'
export function useNewWorkspaceCreateSubmit(args: {
client: RpcClient | null
repos: readonly MobileWorkspaceRepo[]
@@ -115,9 +111,7 @@ export function useNewWorkspaceCreateSubmit(args: {
let outcome: Parameters<NewWorktreeFolderSubmission['settle']>[0] = 'cancelled'
try {
if (admission === null) {
args.setError(
'A worktree in this repository is still being created or checked. It shows in the folder once it lands.'
)
args.setError(folderCreateBusyMessage())
return
}
if (args.sshGate.requiresConnection) {
@@ -231,7 +225,7 @@ export function useNewWorkspaceCreateSubmit(args: {
outcome = result.replayed ? 'uncertain' : 'failed'
if (outcome === 'uncertain') {
// Not a failure to retry: creating again could make a second one.
args.setError(folder ? UNCERTAIN_FOLDER_CREATE : UNCERTAIN_CREATE)
args.setError(uncertainCreateMessage(folder !== undefined))
return
}
if (presenting()) {
@@ -251,7 +245,7 @@ export function useNewWorkspaceCreateSubmit(args: {
outcome = isRpcDeliveryUnknown(error) ? 'uncertain' : 'failed'
if (folder && outcome === 'uncertain') {
// The folder screen refreshes and holds it until its list shows it; sending again could create a second one.
args.setError(UNCERTAIN_FOLDER_CREATE)
args.setError(uncertainCreateMessage(true))
return
}
if (presenting()) {
+4 -4
View File
@@ -303,12 +303,12 @@
"uncommittedFiles_other": "{{count}} uncommitted"
},
"failure": {
"forkOriginalMissing": "{{agent}} could not find this response in the original chat. Open it and fork from there.",
"forkOriginalUnavailable": "{{agent}} cannot fork this response in the original chat. Open it and fork from there.",
"forkOriginalMissingNamed": "{{agent}} could not find this response in \"{{detail}}\". Open that chat and fork from there.",
"forkOriginalUnavailableNamed": "{{agent}} cannot fork this response in \"{{detail}}\". Open that chat and fork from there.",
"forkOriginalLatestOnly": "{{agent}} can only fork the latest response in the original chat. Open that chat and fork its latest response once it has finished.",
"forkOriginalLatestOnlyNamed": "{{agent}} can only fork the latest response in \"{{detail}}\". Open that chat and fork its latest response once it has finished.",
"forkOriginalMissing": "{{agent}} could not find this response in the original chat. Open it and fork from there.",
"forkOriginalMissingNamed": "{{agent}} could not find this response in \"{{detail}}\". Open that chat and fork from there.",
"forkOriginalUnavailable": "{{agent}} cannot fork this response in the original chat. Open it and fork from there.",
"forkOriginalUnavailableNamed": "{{agent}} cannot fork this response in \"{{detail}}\". Open that chat and fork from there.",
"pluginInputRequired": "{{agent}} stopped because the \"{{plugin}}\" plugin is waiting for input in a terminal pane. Disable the plugin for chat sessions, or run the task in a {{agent}} terminal."
},
"fileReader": {
+5
View File
@@ -1430,6 +1430,11 @@
},
"offlineAsOfTime": {
"yesterday": "yesterday, {{time}}"
},
"newWorkspaceCreateSubmit": {
"uncertainFolderCreate": "This worktree may have been created. Check the folder before creating another.",
"uncertainCreate": "This workspace may have been created. Check your workspaces before creating another.",
"folderCreateBusy": "A worktree in this repository is still being created or checked. It shows in the folder once it lands."
}
},
"pullRequest": {