Skip to content

Commit abee7e0

Browse files
committed
fix(tui): transcript copy polish batch (#4142 #4143 #4144 #4145)
Low-risk transcript/setup copy and dedup polish for v0.8.68. #4143 — trim redundant mode picker body copy. The `ModePickerPrompt` ("Choose how CodeWhale should operate:") body line is no longer rendered by the mode picker view (the " Mode " title carries the intent), leaving the message as dead, duplicated copy across every locale plus a parity test. Remove the orphaned MessageId, its ALL_MESSAGE_IDS entry, its translation test row, and the string from all seven locale packs. #4144 — consolidate repeated setup hints. The six "Enter records this X snapshot" review hints now share one uniform pattern (stem first, then the step-specific action) so they read as one voice instead of six. Reword the Hotbar, Remote, and Runtime-posture hints in en.json and update the two detail-line tests that asserted the old order. #4145 — fix "read done / Searching" verb mismatch. A grep grouped under the Workspace exploration card rendered as `read done · Searching for …`. The card now picks the `find` verb when its entries are all searches, so the completed action agrees with the label; read/list or mixed cards keep the neutral `read` verb. Adds regression tests. #4142 skipped: making a normal screen show context percent "once" requires coordinated sidebar context-bar rendering logic (hide when the header already discloses percent), which overlaps the sidebar/transcript rendering workstream. Left untouched to avoid rendering conflicts. Assisted by an AI agent; authored and verified by the committer.
1 parent 504da4d commit abee7e0

11 files changed

Lines changed: 84 additions & 21 deletions

File tree

crates/tui/locales/en.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@
396396
"SetupOperateNeedsActionSaved": "Operate/Fleet still needs action; recorded for setup report.",
397397
"SetupHotbarBindingsLabel": "Hotbar bindings:",
398398
"SetupHotbarActionsLabel": "Bindable actions:",
399-
"SetupHotbarReviewHint": "Press H to customize slots; Enter records this Hotbar snapshot.",
399+
"SetupHotbarReviewHint": "Enter records this Hotbar snapshot. Press H to customize slots.",
400400
"SetupHotbarReviewed": "Hotbar setup state recorded.",
401401
"SetupToolsMcpServersLabel": "MCP servers:",
402402
"SetupToolsMcpSkillsLabel": "Skills:",
@@ -408,7 +408,7 @@
408408
"SetupRemoteBridgesLabel": "Chat bridges:",
409409
"SetupRemoteProvidersLabel": "Providers:",
410410
"SetupRemoteModeLabel": "Remote mode:",
411-
"SetupRemoteReviewHint": "Press R to preview; Enter records this Remote snapshot.",
411+
"SetupRemoteReviewHint": "Enter records this Remote snapshot. Press R to preview.",
412412
"SetupRemotePreviewTitle": "Remote runtime on-ramp",
413413
"SetupRemoteReviewed": "Remote runtime on-ramp recorded.",
414414
"SetupPersistenceHomeLabel": "Home:",
@@ -424,7 +424,7 @@
424424
"SetupProviderModelReviewed": "Provider/model readiness recorded.",
425425
"SetupProviderModelNeedsActionSaved": "Provider/model still needs action; recorded for setup report.",
426426
"SetupRuntimePostureBoundary": "Runtime posture is enforced config; constitution guidance never changes it silently.",
427-
"SetupRuntimePostureReviewHint": "Enter records this posture; press M for work mode or C for config.",
427+
"SetupRuntimePostureReviewHint": "Enter records this Runtime snapshot. Press M for work mode or C for config.",
428428
"SetupRuntimePostureReviewed": "Runtime posture reviewed; no config changed.",
429429
"SetupRuntimePresetSelectedLabel": "Selected preset:",
430430
"SetupRuntimePresetDiffLabel": "Config diff:",
@@ -486,7 +486,6 @@
486486
"CtxMenuHelp": "Help",
487487
"CtxMenuHelpDesc": "keybindings and commands",
488488
"FanoutCounts": "{done} done · {running} running · {failed} failed · {pending} pending",
489-
"ModePickerPrompt": "Choose how CodeWhale should operate:",
490489
"AppModeAgent": "Act",
491490
"AppModeAuto": "Auto",
492491
"AppModeYolo": "YOLO (deprecated)",

crates/tui/locales/es-419.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@
484484
"CtxMenuHelp": "Ayuda",
485485
"CtxMenuHelpDesc": "atajos de teclado y comandos",
486486
"FanoutCounts": "{done} completado · {running} ejecutando · {failed} falló · {pending} pendiente",
487-
"ModePickerPrompt": "Elige cómo debe funcionar CodeWhale:",
488487
"AppModeAgent": "Agente",
489488
"AppModeAuto": "Automático",
490489
"AppModeYolo": "YOLO",

crates/tui/locales/ja.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@
484484
"CtxMenuHelp": "ヘルプ",
485485
"CtxMenuHelpDesc": "キー操作とコマンド",
486486
"FanoutCounts": "{done} 完了 · {running} 実行中 · {failed} 失敗 · {pending} 保留",
487-
"ModePickerPrompt": "CodeWhale の動作方法を選択してください:",
488487
"AppModeAgent": "エージェント",
489488
"AppModeAuto": "自動",
490489
"AppModeYolo": "YOLO",

crates/tui/locales/pt-BR.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@
484484
"CtxMenuHelp": "Ajuda",
485485
"CtxMenuHelpDesc": "atalhos de teclado e comandos",
486486
"FanoutCounts": "{done} concluído · {running} em execução · {failed} falhou · {pending} pendente",
487-
"ModePickerPrompt": "Escolha como o CodeWhale deve operar:",
488487
"AppModeAgent": "Agente",
489488
"AppModeAuto": "Automático",
490489
"AppModeYolo": "YOLO",

crates/tui/locales/vi.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@
484484
"CtxMenuHelp": "Trợ giúp",
485485
"CtxMenuHelpDesc": "phím tắt và lệnh",
486486
"FanoutCounts": "{done} hoàn thành · {running} đang chạy · {failed} thất bại · {pending} chờ",
487-
"ModePickerPrompt": "Chọn cách CodeWhale hoạt động:",
488487
"AppModeAgent": "Tác nhân",
489488
"AppModeAuto": "Tự động",
490489
"AppModeYolo": "YOLO",

crates/tui/locales/zh-Hans.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@
484484
"CtxMenuHelp": "帮助",
485485
"CtxMenuHelpDesc": "快捷键和命令",
486486
"FanoutCounts": "{done} 已完成 · {running} 运行中 · {failed} 失败 · {pending} 等待中",
487-
"ModePickerPrompt": "选择 CodeWhale 的运行方式:",
488487
"AppModeAgent": "智能体",
489488
"AppModeAuto": "自动",
490489
"AppModeYolo": "YOLO",

crates/tui/locales/zh-Hant.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"TranslationFailed": "翻譯失敗",
99
"FooterBalancePrefix": "餘額",
1010
"FanoutCounts": "{done} 已完成 · {running} 運行中 · {failed} 失敗 · {pending} 等待中",
11-
"ModePickerPrompt": "選擇 CodeWhale 的運作方式:",
1211
"AppModeAgent": "智能體",
1312
"AppModeAuto": "自動",
1413
"AppModeYolo": "YOLO",

crates/tui/src/localization.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,7 @@ pub enum MessageId {
574574
// Agent fanout card.
575575
FanoutCounts,
576576

577-
// App mode picker (prompt, names, hints) and composer vim indicator.
578-
ModePickerPrompt,
577+
// App mode picker (names, hints) and composer vim indicator.
579578
AppModeAgent,
580579
AppModeAuto,
581580
AppModeYolo,
@@ -1201,7 +1200,6 @@ pub const ALL_MESSAGE_IDS: &[MessageId] = &[
12011200
MessageId::CtxMenuHelp,
12021201
MessageId::CtxMenuHelpDesc,
12031202
MessageId::FanoutCounts,
1204-
MessageId::ModePickerPrompt,
12051203
MessageId::AppModeAgent,
12061204
MessageId::AppModeAuto,
12071205
MessageId::AppModeYolo,
@@ -1624,11 +1622,10 @@ mod tests {
16241622

16251623
#[test]
16261624
fn mode_picker_strings_are_translated_in_non_english_locales() {
1627-
// The picker prompt and the three mode hints are full sentences; every
1628-
// shipped non-English locale must provide a real translation rather than
1629-
// leaking the English string through the fallback chain.
1625+
// The mode hints are full sentences; every shipped non-English locale
1626+
// must provide a real translation rather than leaking the English
1627+
// string through the fallback chain.
16301628
let sentences = [
1631-
MessageId::ModePickerPrompt,
16321629
MessageId::AppModeAgentHint,
16331630
MessageId::AppModeAutoHint,
16341631
MessageId::AppModePlanHint,

crates/tui/src/tui/history.rs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,8 +835,13 @@ impl ExploringCell {
835835
} else {
836836
"running"
837837
};
838-
lines.push(render_tool_header_with_summary(
839-
"Workspace",
838+
// Search-only exploration cards read with the `find` verb so a
839+
// completed grep renders `find done · Searching for …` instead of the
840+
// incoherent `read done · Searching …` (#4145). Read/list or mixed
841+
// cards keep the neutral `read` verb the Workspace card has always used.
842+
let family = exploring_card_family(&self.entries);
843+
lines.push(render_tool_header_with_family_and_summary(
844+
family,
840845
header_summary.as_deref(),
841846
header_state,
842847
status,
@@ -1710,6 +1715,24 @@ fn exploring_header_summary(entries: &[ExploringEntry]) -> Option<String> {
17101715
}
17111716
}
17121717

1718+
/// Choose the verb family for an exploring card's header. A card whose entries
1719+
/// are all searches reads with the `find` verb so the completed action agrees
1720+
/// with its `Searching for …` labels (#4145); every other exploration mix keeps
1721+
/// the neutral `read` verb the Workspace card uses. The search signal is the
1722+
/// English label prefix produced by `exploring_label` in `tool_routing`.
1723+
fn exploring_card_family(entries: &[ExploringEntry]) -> crate::tui::widgets::tool_card::ToolFamily {
1724+
use crate::tui::widgets::tool_card::ToolFamily;
1725+
let all_search = !entries.is_empty()
1726+
&& entries
1727+
.iter()
1728+
.all(|entry| entry.label.starts_with("Searching"));
1729+
if all_search {
1730+
ToolFamily::Find
1731+
} else {
1732+
ToolFamily::Read
1733+
}
1734+
}
1735+
17131736
fn render_compact_kv(label: &str, value: &str, style: Style, width: u16) -> Vec<Line<'static>> {
17141737
render_card_detail_line(Some(label.trim_end_matches(':')), value, style, width)
17151738
}

crates/tui/src/tui/history/tests.rs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,56 @@ fn generic_tool_cell_renders_rlm_with_rlm_label_not_swarm() {
13331333
);
13341334
}
13351335

1336+
#[test]
1337+
fn exploring_card_search_reads_as_find_not_read() {
1338+
// #4145: a completed grep grouped under the exploration card must not
1339+
// render `read done · Searching …`; the header verb has to agree with the
1340+
// `Searching for …` label.
1341+
let cell = super::ExploringCell {
1342+
entries: vec![super::ExploringEntry {
1343+
label: "Searching for `TranscriptScroll`".to_string(),
1344+
status: ToolStatus::Success,
1345+
}],
1346+
};
1347+
let header: String = cell.lines_with_motion(80, true)[0]
1348+
.spans
1349+
.iter()
1350+
.map(|s| s.content.as_ref())
1351+
.collect::<String>();
1352+
assert!(
1353+
header.contains("find done"),
1354+
"search card header should read `find done`: {header:?}"
1355+
);
1356+
assert!(
1357+
!header.contains("read done"),
1358+
"search card must not pair `read done` with a search label: {header:?}"
1359+
);
1360+
assert!(
1361+
header.contains("Searching for `TranscriptScroll`"),
1362+
"search label should remain intact: {header:?}"
1363+
);
1364+
}
1365+
1366+
#[test]
1367+
fn exploring_card_read_keeps_read_verb() {
1368+
// The fix only re-verbs search-only cards — a plain read stays `read`.
1369+
let cell = super::ExploringCell {
1370+
entries: vec![super::ExploringEntry {
1371+
label: "Reading src/foo.rs".to_string(),
1372+
status: ToolStatus::Success,
1373+
}],
1374+
};
1375+
let header: String = cell.lines_with_motion(80, true)[0]
1376+
.spans
1377+
.iter()
1378+
.map(|s| s.content.as_ref())
1379+
.collect::<String>();
1380+
assert!(
1381+
header.contains("read done"),
1382+
"read card header should read `read done`: {header:?}"
1383+
);
1384+
}
1385+
13361386
// === Reasoning treatment tests (v0.6.6 UI redesign) ===
13371387

13381388
#[test]

0 commit comments

Comments
 (0)