mirror of
https://github.com/codewhale-hq/Codewhale.git
synced 2026-11-08 16:49:40 -10:00
fix(tui): help lists English aliases only and every summary fits one row
/help used to append pinyin aliases to English rows ("/clear (aliases:
/qingping)", /tuichu, /bangzhu, ...). Romanized and Han-script aliases
still dispatch and still match the filter in every locale, but the row
lists them only in the Chinese packs.
The fourteen English command summaries longer than 60 columns are
rewritten as one short sentence, so the list no longer sheds them into
fragments such as "Manage durable scheduled". The help title's subtitle
and /help's own summary stop promising a Concepts section that does not
exist yet: "Commands, skills, and keys".
Checks: cargo test -p codewhale-tui --lib tui::views::help +
tui::provider_picker: 186 passed, 0 failed (same run as two unrelated
failures in footer/frame files other lanes are editing).
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TvKGZz4LrKfrQiAXip48JS
This commit is contained in:
1 parent
4c6f180939
commit
6e7410be3b
2 files changed
+78
-18
No files matched your search
@@ -377,7 +377,7 @@
|
||||
"CmdAttachDescription": "Attach media (@path for text files or folders)",
|
||||
"CmdCacheDescription": "Show cache hit/miss stats for recent turns",
|
||||
"CmdPreviewRequestDescription": "Preview the next request (redacted) without sending it",
|
||||
"CmdToolsDescription": "Inspect a bounded projection of the latest prepared tool request (read-only)",
|
||||
"CmdToolsDescription": "Inspect the latest prepared tool request (read-only)",
|
||||
"CmdEffortDescription": "Set reasoning effort (also /thinking)",
|
||||
"CmdChangeDescription": "Show what's new",
|
||||
"CmdChangeHeader": "What's new",
|
||||
@@ -432,7 +432,7 @@
|
||||
"FeedbackHelp": "Ask the current agent to draft a Codewhale issue, review a saved draft, or request a revision. Bug drafts stay local; posting is unavailable.",
|
||||
"FeedbackDraftRequested": "Asking the current agent to draft or revise a local issue report. It exists only after the save succeeds. Posting is unavailable.",
|
||||
"CmdHfDescription": "Inspect Hugging Face MCP setup and concepts",
|
||||
"CmdHelpDescription": "Concepts, commands, and keybindings",
|
||||
"CmdHelpDescription": "Commands, skills, and keys",
|
||||
"CmdProfileDescription": "Switch to a named config profile",
|
||||
"CmdHomeDescription": "Open home without leaving the current conversation",
|
||||
"CmdOverviewDescription": "Show the home dashboard",
|
||||
@@ -449,7 +449,7 @@
|
||||
"CmdLinksDescription": "Show Codewhale, community, and provider links",
|
||||
"CmdLoadDescription": "Load a session from file",
|
||||
"CmdLogoutDescription": "Sign out and return to setup",
|
||||
"CmdMcpDescription": "Open or manage MCP servers — the init subcommand adds a server and doctor checks it",
|
||||
"CmdMcpDescription": "Open or manage MCP servers; init adds one, doctor checks it",
|
||||
"McpReloadAlreadyRunning": "MCP reload is already running; the status bar tracks it.",
|
||||
"McpRecommendedUnknownId": "Unknown MCP suggestion. Run {recommendations_command} to see the list.",
|
||||
"McpRecommendationsHeading": "Suggested MCP servers (nothing installs automatically)",
|
||||
@@ -565,8 +565,8 @@
|
||||
"CmdRemoteEnvSourceCustodyPolicy": "Codewhale does not upload, migrate, or sync local source into hosted Work. Use {command} to start from the branch tip available at GitHub or CNB. Unpushed commits, dirty or ignored files, secrets, and session state stay local.",
|
||||
"CmdRemoteEnvBrowserLabel": "Codewhale hosted Work",
|
||||
"CmdRenameDescription": "Rename this session",
|
||||
"CmdTitleDescription": "Set a tab/window title shown as [title] … in the terminal title",
|
||||
"CmdRestoreDescription": "Roll the workspace back to a turn snapshot. With no arg, lists recent ones.",
|
||||
"CmdTitleDescription": "Set the tab and window title shown in the terminal",
|
||||
"CmdRestoreDescription": "Roll the workspace back to a turn snapshot",
|
||||
"CmdRetryDescription": "Retry the last request",
|
||||
"CmdReviewDescription": "Run a structured code review on a file, diff, or PR",
|
||||
"CmdRlmDescription": "Open a persistent RLM context for a file or text",
|
||||
@@ -575,18 +575,18 @@
|
||||
"CmdInlineDescription": "Stay inline, keeping the terminal's scrollback",
|
||||
"CmdForkDescription": "Fork the active conversation into a sibling session",
|
||||
"CmdTreeDescription": "Show session history as a tree (leaf = active branch)",
|
||||
"CmdBranchDescription": "Point the active branch at an entry, without rewriting history",
|
||||
"CmdBranchDescription": "Point the branch at an entry without rewriting history",
|
||||
"CmdResumeDescription": "Resume a session, or import a session JSON file",
|
||||
"CmdNewDescription": "Start a fresh session",
|
||||
"CmdSessionsDescription": "Open session history picker — the archive and prune subcommands manage stored sessions",
|
||||
"CmdSessionsDescription": "Open session history; archive and prune manage old ones",
|
||||
"CmdSettingsDescription": "Open settings",
|
||||
"CmdSidebarDescription": "Place the workbar (bottom/top/left/right/off) or pick its panel",
|
||||
"CmdSidebarDescription": "Place the workbar (bottom/top/left/right/off)",
|
||||
"CmdSkillDescription": "Use, install, or trust a skill",
|
||||
"CmdSkillsDescription": "List local skills or browse the curated registry",
|
||||
"CmdStashDescription": "Park or restore a composer draft",
|
||||
"CmdStatusDescription": "Show session status",
|
||||
"CmdStatuslineDescription": "Choose footer items",
|
||||
"CmdStructcopyDescription": "Copy one bounded session object as redacted canonical JSON (human-only, never a model tool)",
|
||||
"CmdStructcopyDescription": "Copy one session object as redacted JSON; not a model tool",
|
||||
"CmdStructcopyKindTurn": "turn",
|
||||
"CmdStructcopyKindTool": "tool call",
|
||||
"CmdStructcopyKindPlan": "Plan",
|
||||
@@ -599,13 +599,13 @@
|
||||
"CmdStructcopyClipboardAccepted": "Structural copy ({kind}, {bytes} bytes) was handed to the clipboard; if no native clipboard was reachable, a terminal write was queued instead",
|
||||
"CmdStructcopyClipboardFailed": "Couldn't reach the clipboard ({error}). Nothing was written; re-run with `stdout` to see the text.",
|
||||
"CmdStructcopyReceiptTooLarge": "Structural-copy receipt metadata exceeds the {bytes}-byte output cap; refusing to emit it",
|
||||
"CmdFleetDescription": "Inspect and set up team members and orchestration state — the members subcommand opens the roster and setup authors a team",
|
||||
"CmdFleetDescription": "Inspect and set up your Fleet and its agents",
|
||||
"CmdLaneDescription": "Watch and control durable Lanes",
|
||||
"CmdWorkflowDescription": "Run a repeatable, ordered workflow",
|
||||
"CmdWorkflowsDescription": "List or cancel workflow runs here",
|
||||
"CmdHotbarDescription": "Set up the Hotbar",
|
||||
"CmdSetupDescription": "Open constitution-first setup",
|
||||
"CmdSubagentsDescription": "Compatibility shortcut for /fleet workers (current-session sub-agents)",
|
||||
"CmdSubagentsDescription": "Shortcut for /fleet workers: this session's agents",
|
||||
"CmdAdvisorDescription": "Toggle the background advisor for this session",
|
||||
"CmdSystemDescription": "Show the system prompt",
|
||||
"CmdTaskDescription": "Manage background tasks",
|
||||
@@ -617,7 +617,7 @@
|
||||
"TranslationComplete": "Translated.",
|
||||
"TranslationFailed": "Couldn't translate.",
|
||||
"CmdTrustDescription": "Manage workspace trust",
|
||||
"CmdWorkspaceDescription": "Show or switch the current workspace — the worktrees subcommand opens the git worktree manager",
|
||||
"CmdWorkspaceDescription": "Show or switch the workspace; worktrees opens the manager",
|
||||
"CmdUndoDescription": "Drop the last exchange",
|
||||
"CmdVerboseDescription": "Toggle live thinking in the transcript",
|
||||
"CmdCacheAdvice": "Hit/miss ratios over ~70% after the third turn indicate a stable cache prefix; \n lower than that on long sessions suggests prefix churn worth investigating (#263).",
|
||||
@@ -1206,8 +1206,8 @@
|
||||
"ToolReceiptLinesSingular": "1 line",
|
||||
"ToolReceiptLinesPlural": "{count} lines",
|
||||
"CmdVoiceDescription": "Dictate into the composer",
|
||||
"CmdVoiceSendDescription": "Toggle voice auto-send: submit when the transcript ends with \"send it\"",
|
||||
"CmdVoiceControlDescription": "Toggle voice control: AI-assisted dictation aware of the composer text",
|
||||
"CmdVoiceSendDescription": "Toggle voice auto-send: say \"send it\" to submit",
|
||||
"CmdVoiceControlDescription": "Toggle voice control: dictation that knows your draft",
|
||||
"VoiceEnabled": "Voice input enabled. Speak to record.",
|
||||
"VoiceDisabled": "Voice input disabled.",
|
||||
"VoiceSendEnabled": "Voice auto-send enabled.",
|
||||
@@ -1307,7 +1307,7 @@
|
||||
"HotbarActionModeOperateDescription": "Put your fleet to work in parallel.",
|
||||
"HomeOperateModeTip": "Operate — put your fleet to work in parallel",
|
||||
"HomeOperateModeFleetTip": " Roles borrow this session's model; /fleet setup customizes them",
|
||||
"HelpSubtitle": "Concepts, commands, and keybindings",
|
||||
"HelpSubtitle": "Commands, skills, and keys",
|
||||
"CommandPaletteTitle": "Command",
|
||||
"CommandPaletteSubtitle": "Find and run one action",
|
||||
"ConfigSubtitle": "Settings first; raw keys under advanced detail",
|
||||
@@ -1741,7 +1741,7 @@
|
||||
"KbReasoningDetail": "Open reasoning detail for the selected or current turn",
|
||||
"KbTurnInspector": "Open Turn Inspector",
|
||||
"CmdTurnInspectDescription": "Open the whole-turn inspector",
|
||||
"CmdAutomationDescription": "Manage durable scheduled automations — the list subcommand opens the automation manager",
|
||||
"CmdAutomationDescription": "Manage scheduled automations; list opens the manager",
|
||||
"AutomationUsage": "Usage: /automation [list|show <id>|print <id>|pause <id>|resume <id>|delete <id> [--confirm <token>]|run <id>]",
|
||||
"AutomationManagerUnavailable": "Automations aren't available this session.",
|
||||
"AutomationListFailed": "Could not list automations: {error}",
|
||||
|
||||
@@ -502,7 +502,15 @@ fn build_entries(
|
||||
.iter()
|
||||
.copied()
|
||||
.filter(|alias| registry.get(alias).is_none())
|
||||
.filter(|alias| alias_is_listed_for(locale, alias))
|
||||
.collect::<Vec<_>>();
|
||||
// Every alias stays findable by typing it, listed or not.
|
||||
let alias_terms = command
|
||||
.aliases
|
||||
.iter()
|
||||
.map(|alias| format!("/{alias}"))
|
||||
.collect::<Vec<_>>()
|
||||
.join(" ");
|
||||
let description = if visible_aliases.is_empty() {
|
||||
localized.to_string()
|
||||
} else {
|
||||
@@ -517,10 +525,11 @@ fn build_entries(
|
||||
)
|
||||
};
|
||||
let haystack = format!(
|
||||
"{} {} {}",
|
||||
"{} {} {} {}",
|
||||
label.to_ascii_lowercase(),
|
||||
description.to_ascii_lowercase(),
|
||||
command.usage.to_ascii_lowercase()
|
||||
command.usage.to_ascii_lowercase(),
|
||||
alias_terms.to_lowercase()
|
||||
);
|
||||
entries.push(HelpEntry {
|
||||
section: HelpSection::Command,
|
||||
@@ -619,6 +628,57 @@ fn build_entries(
|
||||
entries
|
||||
}
|
||||
|
||||
/// Romanized Chinese (pinyin) command aliases. They dispatch in every locale,
|
||||
/// but only the Chinese packs list them: an English reader sees `/clear`, not
|
||||
/// `/clear (aliases: /qingping)`.
|
||||
const ROMANIZED_ALIASES: &[&str] = &[
|
||||
"bangzhu",
|
||||
"chongmingming",
|
||||
"chongshi",
|
||||
"daili",
|
||||
"dangan",
|
||||
"daochu",
|
||||
"digui",
|
||||
"fujian",
|
||||
"gaiming",
|
||||
"gouzi",
|
||||
"jiazai",
|
||||
"jihua",
|
||||
"jineng",
|
||||
"jinengliebiao",
|
||||
"lianjie",
|
||||
"maodian",
|
||||
"moxing",
|
||||
"moxingliebiao",
|
||||
"qingchu",
|
||||
"qingping",
|
||||
"shencha",
|
||||
"shouye",
|
||||
"tuichu",
|
||||
"xinren",
|
||||
"xitong",
|
||||
"yasuo",
|
||||
"yuyin",
|
||||
"yuyincontrol",
|
||||
"yuyinsend",
|
||||
"zhinengti",
|
||||
"zhuye",
|
||||
"zidong",
|
||||
"zuoye",
|
||||
];
|
||||
|
||||
/// Whether `/help` lists `alias` beside its command for `locale`. Chinese
|
||||
/// aliases (Han script or pinyin) are listed only in the Chinese packs.
|
||||
fn alias_is_listed_for(locale: Locale, alias: &str) -> bool {
|
||||
if matches!(locale, Locale::ZhHans | Locale::ZhHant) {
|
||||
return true;
|
||||
}
|
||||
let han = alias
|
||||
.chars()
|
||||
.any(|ch| ('\u{4e00}'..='\u{9fff}').contains(&ch));
|
||||
!han && !ROMANIZED_ALIASES.contains(&alias)
|
||||
}
|
||||
|
||||
/// The usage line worth printing beside a row, or `None` when it only
|
||||
/// restates the label.
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user