fix: apply the review items for #685 at merge

palette agent switch: aria-hidden on .command-palette-agent, arrows lose role="button" and aria-label (no nested buttons in the row)
i18n: zh-CN entry for the "Agent for the new session (Left/Right to change)" tooltip
docs: Keyboard-Shortcuts Ctrl+K row says Left/Right change the agent on the New session row
test: pin the aria-hidden switch and the zh-CN tooltip entry in command-palette-ui.test.ts

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-10-24 14:05:12 +02:00
1 parent c6a5995ac6
commit d16172c4b8
4 files changed
+24 -6

No files matched your search

+2
View File
@@ -94,6 +94,8 @@
'Move to Ungrouped': '移到未分组',
'Move to new group': '移到新分组',
'New session': '新建会话',
// The Cmd+K palette's new-session agent switch (panels-ui.js, its title tooltip).
'Agent for the new session (Left/Right to change)': '新会话使用的智能体(按左/右方向键切换)',
'A session is already starting.': '已有会话正在启动。',
'Follow parent again': '重新跟随父会话',
'Parent closed; placed on its own': '父会话已关闭;单独放置',
+7 -5
View File
@@ -694,19 +694,21 @@ Object.assign(CodemanApp.prototype, {
/**
* The new-session row's agent switch: arrows either side of the agent's logo
* and name. Spans, not buttons: the row itself is a <button>. Nothing is drawn
* when there is nothing to choose between.
* and name. Spans, not buttons: the row itself is a <button>. The switch is
* aria-hidden (no nested buttons; the row's subtitle already names the agent),
* and its arrows work by click through data-palette-agent-cycle. Nothing is
* drawn when there is nothing to choose between.
*/
_renderCommandPaletteAgentPicker(mode) {
const choices = this._commandPaletteAgentChoices();
if (choices.length < 2) return '';
const agent = choices.find((c) => c.id === mode) || choices[0];
return `
<span class="command-palette-agent" title="Agent for the new session (Left/Right to change)">
<span class="command-palette-agent-arrow" role="button" data-palette-agent-cycle="prev" aria-label="Previous agent">&lsaquo;</span>
<span class="command-palette-agent" aria-hidden="true" title="Agent for the new session (Left/Right to change)">
<span class="command-palette-agent-arrow" data-palette-agent-cycle="prev">&lsaquo;</span>
<span class="run-mode-dot ${escapeHtml(agent.id)}" aria-hidden="true"></span>
<span class="command-palette-agent-label">${escapeHtml(agent.label)}</span>
<span class="command-palette-agent-arrow" role="button" data-palette-agent-cycle="next" aria-label="Next agent">&rsaquo;</span>
<span class="command-palette-agent-arrow" data-palette-agent-cycle="next">&rsaquo;</span>
</span>`;
},