fix(app): move reload agent away from close action

This commit is contained in:
Mohamed Boudra
2026-04-07 12:20:15 +07:00
parent 29b6f2a86f
commit 1900f43049
2 changed files with 16 additions and 13 deletions
@@ -39,10 +39,10 @@ describe("buildWorkspaceTabMenuEntries", () => {
expect(entries.filter((entry) => entry.kind === "item").map((entry) => entry.label)).toEqual([
"Copy resume command",
"Copy agent id",
"Reload agent",
"Close to the left",
"Close to the right",
"Close other tabs",
"Reload agent",
"Close",
]);
});
@@ -66,10 +66,10 @@ describe("buildWorkspaceTabMenuEntries", () => {
expect(entries.filter((entry) => entry.kind === "item").map((entry) => entry.label)).toEqual([
"Copy resume command",
"Copy agent id",
"Reload agent",
"Close tabs above",
"Close tabs below",
"Close other tabs",
"Reload agent",
"Close",
]);
});
@@ -135,17 +135,6 @@ export function buildWorkspaceTabMenuEntries(
void onCopyAgentId(agentId);
},
});
entries.push({
kind: "item",
key: "reload-agent",
label: "Reload agent",
icon: "rotate-cw",
tooltip: "Reload agent to update skills, MCPs or login status.",
testID: `${menuTestIDBase}-reload-agent`,
onSelect: () => {
void onReloadAgent(agentId);
},
});
entries.push({
kind: "separator",
key: "copy-separator",
@@ -185,6 +174,20 @@ export function buildWorkspaceTabMenuEntries(
void onCloseOtherTabs(tab.tabId);
},
});
if (tab.target.kind === "agent") {
const { agentId } = tab.target;
entries.push({
kind: "item",
key: "reload-agent",
label: "Reload agent",
icon: "rotate-cw",
tooltip: "Reload agent to update skills, MCPs or login status.",
testID: `${menuTestIDBase}-reload-agent`,
onSelect: () => {
void onReloadAgent(agentId);
},
});
}
entries.push({
kind: "item",
key: "close",