From c3e73e263c73600bca414bb74faf129712e678e9 Mon Sep 17 00:00:00 2001 From: Kaede Akino Date: Sun, 30 Aug 2026 13:12:34 +0800 Subject: [PATCH] Simplify command generator feedback --- .../Workspaces/WorkspaceContentView.swift | 34 ++++---- Termind/Resources/Localizable.xcstrings | 78 ++++++------------- 2 files changed, 37 insertions(+), 75 deletions(-) diff --git a/Termind/Features/Workspaces/WorkspaceContentView.swift b/Termind/Features/Workspaces/WorkspaceContentView.swift index 33c5b941..27745821 100644 --- a/Termind/Features/Workspaces/WorkspaceContentView.swift +++ b/Termind/Features/Workspaces/WorkspaceContentView.swift @@ -119,11 +119,13 @@ private struct CommandGeneratorOverlay: View { VStack(spacing: Metrics.Space.s) { symbol Text(title).font(.headline) - Text(detail) - .font(.caption) - .foregroundStyle(.secondary) - .lineLimit(2) - .multilineTextAlignment(.center) + if let detail { + Text(detail) + .font(.caption) + .foregroundStyle(.secondary) + .lineLimit(2) + .multilineTextAlignment(.center) + } } .padding(.horizontal, Metrics.Space.xl) .padding(.vertical, Metrics.Space.l) @@ -158,27 +160,17 @@ private struct CommandGeneratorOverlay: View { private var title: String { switch state { case .idle: "" - case .readingDraft: String(localized: "Reading current input…") - case .generating: String(localized: "Generating command…") - case .inserted: String(localized: "Command inserted — press Return to run") + case .readingDraft, .generating: String(localized: "Generating Command") + case .inserted: String(localized: "Command Inserted") case .failed: String(localized: "Couldn't generate command") } } - private var detail: String { + private var detail: String? { switch state { - case .idle: "" - case .readingDraft: - String(localized: "Reading the focused shell's edit buffer.") - case .generating: - String( - localized: - "Only the current input, shell, working directory, and available system details are sent." - ) - case .inserted(let targetCount): - targetCount == 1 - ? String(localized: "Review the command before running it.") - : String(localized: "Inserted into \(targetCount) broadcast terminals.") + case .idle: nil + case .readingDraft, .generating: String(localized: "This May Take a Moment") + case .inserted: String(localized: "Press Return to Run") case .failed(let message): message } } diff --git a/Termind/Resources/Localizable.xcstrings b/Termind/Resources/Localizable.xcstrings index a281f5b1..4e9ab17f 100644 --- a/Termind/Resources/Localizable.xcstrings +++ b/Termind/Resources/Localizable.xcstrings @@ -2766,12 +2766,12 @@ } } }, - "Command inserted — press Return to run" : { + "Command Inserted" : { "localizations" : { "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "命令已插入——按回车键运行" + "value" : "命令已插入" } } } @@ -5294,12 +5294,12 @@ } } }, - "Generating command…" : { + "Generating Command" : { "localizations" : { "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "正在生成命令…" + "value" : "正在生成命令" } } } @@ -5924,16 +5924,6 @@ } } }, - "Inserted into %lld broadcast terminals." : { - "localizations" : { - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "插入到%lld广播终端。" - } - } - } - }, "Inside" : { "localizations" : { "zh-Hans" : { @@ -7692,16 +7682,6 @@ } } }, - "Only the current input, shell, working directory, and available system details are sent." : { - "localizations" : { - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "仅发送当前输入、shell、工作目录和可用的系统信息。" - } - } - } - }, "Open" : { "localizations" : { "zh-Hans" : { @@ -8465,6 +8445,16 @@ } } }, + "Press Return to Run" : { + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "按回车键运行" + } + } + } + }, "Previous Workspace" : { "localizations" : { "zh-Hans" : { @@ -8899,26 +8889,6 @@ } } }, - "Reading current input…" : { - "localizations" : { - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "正在读取当前输入…" - } - } - } - }, - "Reading the focused shell's edit buffer." : { - "localizations" : { - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "正在读取当前shell的编辑缓冲区。" - } - } - } - }, "Reasoning" : { "localizations" : { "zh-Hans" : { @@ -9535,16 +9505,6 @@ } } }, - "Review the command before running it." : { - "localizations" : { - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "运行前检查命令。" - } - } - } - }, "Reviews commands before automatic approval. Choose a fast model different from Chat; Same as Chat is not an independent second opinion." : { "localizations" : { "zh-Hans" : { @@ -13022,6 +12982,16 @@ } } }, + "This May Take a Moment" : { + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "可能需要一点时间" + } + } + } + }, "This package contains 1 snippet." : { "localizations" : { "zh-Hans" : {