fix(app): improve tab handling (#30669)

This commit is contained in:
Brendan Allan
2026-06-05 11:41:30 +08:00
committed by GitHub
parent 3003867c25
commit 5426478e46
12 changed files with 238 additions and 203 deletions
@@ -418,23 +418,26 @@ export const useSessionCommands = (actions: SessionCommandContext) => {
}),
]
const fileCmds = () => [
fileCommand({
id: "file.open",
title: language.t("command.file.open"),
description: language.t("palette.search.placeholder"),
keybind: "mod+k,mod+p",
slash: "open",
onSelect: openFile,
}),
fileCommand({
id: "tab.close",
title: language.t("command.tab.close"),
keybind: "mod+w",
disabled: !closableTab(),
onSelect: closeTab,
}),
]
const fileCmds = () => {
const tab = closableTab()
return [
fileCommand({
id: "file.open",
title: language.t("command.file.open"),
description: language.t("palette.search.placeholder"),
keybind: "mod+k,mod+p",
slash: "open",
onSelect: openFile,
}),
tab &&
fileCommand({
id: "tab.close",
title: language.t("command.tab.close"),
keybind: "mod+w",
onSelect: closeTab,
}),
].filter((v) => !!v)
}
const contextCmds = () => [
contextCommand({