Compare commits

...
Author SHA1 Message Date
l0ng-ai d9b6c86576 fix(agents): shorten task context menu labels 2026-11-23 15:28:35 +08:00
6 changed files with 22 additions and 14 deletions

No files matched your search

+4 -4
View File
@@ -502,17 +502,17 @@ describe("Agents pinned and grouped tasks", () => {
expect(rows.some((text) => text.includes("one"))).toBe(true);
});
it("offers the groups, a new one and a way out in Move to Group", () => {
it("offers the groups, a new one and a way out in the Group submenu", () => {
useAgents.setState({ organize: { groups: [frontend], groupOf: { two: "g1" }, pinned: [] } });
const menu = taskMenu([useAgents.getState().tasks.get("two")!]);
const move = menu.find((item) => "label" in item && item.label === "Move to Group");
const move = menu.find((item) => "label" in item && item.label === "Group");
expect(move).toBeDefined();
const submenu = (move as { submenu: { label?: string; checked?: boolean }[] }).submenu;
expect(submenu.map((item) => item.label ?? "separator")).toEqual([
"Frontend",
"separator",
"New Group…",
"Remove from Group",
"No Group",
]);
expect(submenu[0]).toMatchObject({ checked: true });
});
@@ -520,7 +520,7 @@ describe("Agents pinned and grouped tasks", () => {
it("moves a pinned task into a group, out of the pinned section", () => {
useAgents.setState({ organize: { groups: [frontend], groupOf: {}, pinned: ["two"] } });
const menu = taskMenu([useAgents.getState().tasks.get("two")!]);
const move = menu.find((item) => "label" in item && item.label === "Move to Group") as {
const move = menu.find((item) => "label" in item && item.label === "Group") as {
submenu: { label?: string; run?: () => void }[];
};
act(() => move.submenu.find((item) => item.label === "Frontend")!.run!());
+11 -4
View File
@@ -1,6 +1,6 @@
import type { AgentTask } from "@/bindings";
import type { Action } from "@/platform/actions";
import { tx } from "@/platform/i18n";
import { t, tx } from "@/platform/i18n";
import { auxiliaryWindow } from "@/platform/auxWindow";
import { useProject } from "@/platform/project";
import type { MenuItem } from "@/ui";
@@ -165,7 +165,7 @@ function arrangeMenu(tasks: AgentTask[], ids: string[]): MenuItem[] {
{
kind: "item",
id: "move-to-group",
label: "Move to Group",
label: "Group",
icon: "folder",
submenu: groupSubmenu(
ids,
@@ -194,7 +194,7 @@ function groupSubmenu(ids: string[], groups: OrganizeGroup[], current: Array<str
{
kind: "item",
id: "group:none",
label: "Remove from Group",
label: "No Group",
run: () => moveTasksToGroup(ids, null),
},
] satisfies MenuItem[])
@@ -398,7 +398,14 @@ export function taskMenu(tasks: AgentTask[]): MenuItem[] {
? ([
{ kind: "action", action: "agents.renameTask", label: "Rename…", icon: "edit", arg: task.id },
...(!auxiliaryWindow()
? ([{ kind: "action", action: "agents.moveToNewWindow", arg: task.id }] satisfies MenuItem[])
? ([
{
kind: "action",
action: "agents.moveToNewWindow",
label: t("app.window.askNew"),
arg: task.id,
},
] satisfies MenuItem[])
: []),
...(hasTaskTerminal(task, projectRoot)
? ([
+2 -1
View File
@@ -507,7 +507,8 @@
"Unpin ({count})": "Unpin ({count})",
"New Group": "New Group",
"Rename Group": "Rename Group",
"Remove from Group": "Remove from Group",
"Group": "Group",
"No Group": "No Group",
"Remove “{name}”? Its tasks move back to their status groups.": "Remove “{name}”? Its tasks move back to their status groups.",
"Copy Link Address": "Copy Link Address",
"Pin Agent Tasks": "Pin Agent Tasks",
+1 -1
View File
@@ -161,7 +161,7 @@
"Unpin ({count})": "Sabitlemeyi Kaldır ({count})",
"New Group": "Yeni Grup",
"Rename Group": "Grubu Yeniden Adlandır",
"Remove from Group": "Gruptan Kaldır",
"No Group": "Grup Yok",
"Remove “{name}”? Its tasks move back to their status groups.": "“{name}” kaldırılsın mı? Görevleri durum gruplarına geri taşınacaktır.",
"Copy Link Address": "Bağlantı Adresini Kopyala",
"Pin Agent Tasks": "Ajan Görevlerini Sabitle",
+1 -1
View File
@@ -143,7 +143,7 @@
"Unpin ({count})": "取消固定({count})",
"New Group": "新增群組",
"Rename Group": "重新命名群組",
"Remove from Group": "從群組中移除",
"No Group": "不分組",
"Remove “{name}”? Its tasks move back to their status groups.": "移除「{name}」?其中的任務將回到各自的狀態分組。",
"Copy Link Address": "複製連結地址",
"Pin Agent Tasks": "固定 Agent 任務",
+3 -3
View File
@@ -420,7 +420,7 @@
"Unpin ({count})": "取消固定({count})",
"New Group": "新建组",
"Rename Group": "重命名组",
"Remove from Group": "从组中移除",
"No Group": "不分组",
"Remove “{name}”? Its tasks move back to their status groups.": "移除“{name}”?其中的任务将回到各自的状态分组。",
"Copy Link Address": "复制链接地址",
"Pin Agent Tasks": "固定 Agent 任务",
@@ -817,7 +817,7 @@
"Group actions": "分组操作",
"New Project Group": "新建项目组",
"Group name:": "组名称:",
"New Group…": "新建组…",
"New Group…": "新建分组…",
"Remove from '{current}'": "从“{current}”移除",
"Move to Group": "移动到组",
"Rename Group…": "重命名组…",
@@ -1989,7 +1989,7 @@
"Green": "绿色",
"Grey": "灰色",
"Greyscale": "灰度",
"Group": "组",
"Group": "分组",
"Group by Severity": "按严重性分组",
"Groups": "组",
"Gutter Icons": "装订区域图标",