Compare commits

...

1 Commits

Author SHA1 Message Date
Kit Langton aad938ae3d fix(desktop): add standard Mac tab shortcuts 2026-09-14 20:28:39 -07:00
2 changed files with 17 additions and 8 deletions
+2
View File
@@ -109,6 +109,8 @@ export const dict = {
"command.browser.open": "Open browser",
"command.browser.reload": "Reload browser page",
"command.tab.close": "Close tab",
"command.tab.previous": "Previous tab",
"command.tab.next": "Next tab",
"command.tab.reopenClosed": "Reopen closed tab",
"command.context.addSelection": "Add selection to context",
"command.context.addSelection.description": "Add selected lines from the current file",
+15 -8
View File
@@ -11,6 +11,7 @@ import { ServerConnection } from "@/runtime/server/registry"
import { DraftTabItem, TabNavItem } from "@/shell/titlebar/tab-nav"
import { useGlobal, useServerCtx, type ServerCtx } from "@/runtime/server/runtime"
import { useLanguage } from "@/runtime/i18n/language"
import { usePlatform } from "@/runtime/platform/platform"
import { useCommand } from "@/shell/commands/command"
import { useTabs } from "@/shell/tabs/tabs"
import { createTabComposerState } from "@/composer/persistence"
@@ -242,6 +243,7 @@ export function TitlebarTabStrip(props: {
const global = useGlobal()
const language = useLanguage()
const command = useCommand()
const platform = usePlatform()
const vertical = () => props.orientation === "vertical"
let listRef!: HTMLDivElement
const [visibility, setVisibility] = createStore<Record<string, boolean>>({})
@@ -251,18 +253,23 @@ export function TitlebarTabStrip(props: {
command.register("titlebar-tab-cycle", () => [
{
id: `tab.prev`,
category: "tab",
title: "",
keybind: `mod+option+ArrowLeft,ctrl+shift+tab`,
hidden: true,
category: language.t("command.category.view"),
title: language.t("command.tab.previous"),
// Shift+[ produces "{" in macOS keyboard events.
keybind:
platform.os === "macos"
? "cmd+shift+[,cmd+shift+{,mod+option+ArrowLeft,ctrl+shift+tab"
: "mod+option+ArrowLeft,ctrl+shift+tab",
onSelect: () => selectAdjacentTab(-1),
},
{
id: `tab.next`,
category: "tab",
title: "",
keybind: `mod+option+ArrowRight,ctrl+tab`,
hidden: true,
category: language.t("command.category.view"),
title: language.t("command.tab.next"),
keybind:
platform.os === "macos"
? "cmd+shift+],cmd+shift+},mod+option+ArrowRight,ctrl+tab"
: "mod+option+ArrowRight,ctrl+tab",
onSelect: () => selectAdjacentTab(1),
},
])