feat(app): bring v2 visibility settings to web (#32174)

This commit is contained in:
Luke Parker 2026-06-13 21:13:12 +10:00 committed by GitHub
commit 45e4606fa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 86 additions and 147 deletions

View file

@ -1372,7 +1372,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
if (!search) return projects() if (!search) return projects()
return projects().filter((project) => displayName(project).toLowerCase().includes(search)) return projects().filter((project) => displayName(project).toLowerCase().includes(search))
}) })
const showAgentControl = createMemo(() => settings.general.showCustomAgents() && agentNames().length > 0) const showAgentControl = createMemo(() => settings.visibility.customAgents() && agentNames().length > 0)
const selectProject = (worktree: string) => { const selectProject = (worktree: string) => {
setPicker({ setPicker({
projectOpen: false, projectOpen: false,

View file

@ -155,11 +155,9 @@ export function SessionHeader() {
}) })
const hotkey = createMemo(() => command.keybind("file.open")) const hotkey = createMemo(() => command.keybind("file.open"))
const os = createMemo(() => detectOS(platform)) const os = createMemo(() => detectOS(platform))
const isDesktopV2 = createMemo(() => platform.platform === "desktop" && settings.general.newLayoutDesigns()) const isV2 = settings.general.newLayoutDesigns
const search = createMemo(() => (isDesktopV2() ? settings.general.showSearch() : true)) const search = settings.visibility.search
const tree = createMemo(() => (isDesktopV2() ? settings.general.showFileTree() : true)) const status = settings.visibility.status
const term = createMemo(() => (isDesktopV2() ? settings.general.showTerminal() : true))
const status = createMemo(() => (isDesktopV2() ? settings.general.showStatus() : true))
const [exists, setExists] = createStore<Partial<Record<OpenApp, boolean>>>({ const [exists, setExists] = createStore<Partial<Record<OpenApp, boolean>>>({
finder: true, finder: true,
@ -322,7 +320,7 @@ export function SessionHeader() {
{(mount) => ( {(mount) => (
<Portal mount={mount()}> <Portal mount={mount()}>
<Show <Show
when={isDesktopV2} when={isV2}
fallback={ fallback={
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<Show when={projectDirectory()}> <Show when={projectDirectory()}>
@ -444,23 +442,21 @@ export function SessionHeader() {
<StatusPopover /> <StatusPopover />
</Tooltip> </Tooltip>
</Show> </Show>
<Show when={term()}> <TooltipKeybind
<TooltipKeybind title={language.t("command.terminal.toggle")}
title={language.t("command.terminal.toggle")} keybind={command.keybind("terminal.toggle")}
keybind={command.keybind("terminal.toggle")} >
<Button
variant="ghost"
class="group/terminal-toggle titlebar-icon w-8 h-6 p-0 box-border shrink-0"
onClick={toggleTerminal}
aria-label={language.t("command.terminal.toggle")}
aria-expanded={view().terminal.opened()}
aria-controls="terminal-panel"
> >
<Button <Icon size="small" name={view().terminal.opened() ? "terminal-active" : "terminal"} />
variant="ghost" </Button>
class="group/terminal-toggle titlebar-icon w-8 h-6 p-0 box-border shrink-0" </TooltipKeybind>
onClick={toggleTerminal}
aria-label={language.t("command.terminal.toggle")}
aria-expanded={view().terminal.opened()}
aria-controls="terminal-panel"
>
<Icon size="small" name={view().terminal.opened() ? "terminal-active" : "terminal"} />
</Button>
</TooltipKeybind>
</Show>
<div class="hidden md:flex items-center gap-1 shrink-0"> <div class="hidden md:flex items-center gap-1 shrink-0">
<TooltipKeybind <TooltipKeybind
@ -479,32 +475,30 @@ export function SessionHeader() {
</Button> </Button>
</TooltipKeybind> </TooltipKeybind>
<Show when={tree()}> <TooltipKeybind
<TooltipKeybind title={language.t("command.fileTree.toggle")}
title={language.t("command.fileTree.toggle")} keybind={command.keybind("fileTree.toggle")}
keybind={command.keybind("fileTree.toggle")} >
<Button
variant="ghost"
class="titlebar-icon w-8 h-6 p-0 box-border"
onClick={() => layout.fileTree.toggle()}
aria-label={language.t("command.fileTree.toggle")}
aria-expanded={layout.fileTree.opened()}
aria-controls="file-tree-panel"
> >
<Button <div class="relative flex items-center justify-center size-4">
variant="ghost" <Icon
class="titlebar-icon w-8 h-6 p-0 box-border" size="small"
onClick={() => layout.fileTree.toggle()} name={layout.fileTree.opened() ? "file-tree-active" : "file-tree"}
aria-label={language.t("command.fileTree.toggle")} classList={{
aria-expanded={layout.fileTree.opened()} "text-icon-strong": layout.fileTree.opened(),
aria-controls="file-tree-panel" "text-icon-weak": !layout.fileTree.opened(),
> }}
<div class="relative flex items-center justify-center size-4"> />
<Icon </div>
size="small" </Button>
name={layout.fileTree.opened() ? "file-tree-active" : "file-tree"} </TooltipKeybind>
classList={{
"text-icon-strong": layout.fileTree.opened(),
"text-icon-weak": !layout.fileTree.opened(),
}}
/>
</div>
</Button>
</TooltipKeybind>
</Show>
</div> </div>
</div> </div>
</div> </div>

View file

@ -1,16 +1,14 @@
import { Component, Show, createMemo, createResource, onMount } from "solid-js" import { Component, Show, createMemo, createResource, onMount } from "solid-js"
import { ButtonV2 } from "@opencode-ai/ui/v2/button-v2" import { ButtonV2 } from "@opencode-ai/ui/v2/button-v2"
import { Icon } from "@opencode-ai/ui/icon"
import { SelectV2 } from "@opencode-ai/ui/v2/select-v2" import { SelectV2 } from "@opencode-ai/ui/v2/select-v2"
import { Switch } from "@opencode-ai/ui/v2/switch-v2" import { Switch } from "@opencode-ai/ui/v2/switch-v2"
import { TextInputV2 } from "@opencode-ai/ui/v2/text-input-v2" import { TextInputV2 } from "@opencode-ai/ui/v2/text-input-v2"
import { Tooltip } from "@opencode-ai/ui/tooltip"
import { useTheme, type ColorScheme } from "@opencode-ai/ui/theme/context" import { useTheme, type ColorScheme } from "@opencode-ai/ui/theme/context"
import { useDialog } from "@opencode-ai/ui/context/dialog" import { useDialog } from "@opencode-ai/ui/context/dialog"
import { useParams } from "@solidjs/router" import { useParams } from "@solidjs/router"
import { useLanguage } from "@/context/language" import { useLanguage } from "@/context/language"
import { usePermission } from "@/context/permission" import { usePermission } from "@/context/permission"
import { usePlatform, type DisplayBackend } from "@/context/platform" import { usePlatform } from "@/context/platform"
import { useServerSync } from "@/context/server-sync" import { useServerSync } from "@/context/server-sync"
import { useServerSDK } from "@/context/server-sdk" import { useServerSDK } from "@/context/server-sdk"
import { useUpdaterAction } from "../updater-action" import { useUpdaterAction } from "../updater-action"
@ -94,7 +92,6 @@ export const SettingsGeneralV2: Component = () => {
const updater = useUpdaterAction() const updater = useUpdaterAction()
const linux = createMemo(() => platform.platform === "desktop" && platform.os === "linux")
const dir = createMemo(() => decode64(params.dir)) const dir = createMemo(() => decode64(params.dir))
const accepting = createMemo(() => { const accepting = createMemo(() => {
const value = dir() const value = dir()
@ -136,12 +133,6 @@ export const SettingsGeneralV2: Component = () => {
{ initialValue: [] as ShellOption[] }, { initialValue: [] as ShellOption[] },
) )
const [displayBackend, { refetch: refetchDisplayBackend }] = createResource(
() => (linux() && platform.getDisplayBackend ? true : false),
() => Promise.resolve(platform.getDisplayBackend?.() ?? null).catch(() => null as DisplayBackend | null),
{ initialValue: null as DisplayBackend | null },
)
const [pinchZoom, { mutate: setPinchZoom }] = createResource( const [pinchZoom, { mutate: setPinchZoom }] = createResource(
() => (desktop() && platform.getPinchZoomEnabled ? true : false), () => (desktop() && platform.getPinchZoomEnabled ? true : false),
() => Promise.resolve(platform.getPinchZoomEnabled?.() ?? false).catch(() => false), () => Promise.resolve(platform.getPinchZoomEnabled?.() ?? false).catch(() => false),
@ -186,14 +177,6 @@ export const SettingsGeneralV2: Component = () => {
return options return options
}) })
const onDisplayBackendChange = (checked: boolean) => {
const update = platform.setDisplayBackend?.(checked ? "wayland" : "auto")
if (!update) return
void update.finally(() => {
void refetchDisplayBackend()
})
}
const onPinchZoomChange = (checked: boolean) => { const onPinchZoomChange = (checked: boolean) => {
setPinchZoom(checked) setPinchZoom(checked)
const update = platform.setPinchZoomEnabled?.(checked) const update = platform.setPinchZoomEnabled?.(checked)
@ -383,18 +366,6 @@ export const SettingsGeneralV2: Component = () => {
</div> </div>
</SettingsRowV2> </SettingsRowV2>
<SettingsRowV2
title={language.t("settings.general.row.showNavigation.title")}
description={language.t("settings.general.row.showNavigation.description")}
>
<div data-action="settings-show-navigation">
<Switch
checked={settings.general.showNavigation()}
onChange={(checked) => settings.general.setShowNavigation(checked)}
/>
</div>
</SettingsRowV2>
<SettingsRowV2 <SettingsRowV2
title={language.t("settings.general.row.showSearch.title")} title={language.t("settings.general.row.showSearch.title")}
description={language.t("settings.general.row.showSearch.description")} description={language.t("settings.general.row.showSearch.description")}
@ -407,18 +378,6 @@ export const SettingsGeneralV2: Component = () => {
</div> </div>
</SettingsRowV2> </SettingsRowV2>
<SettingsRowV2
title={language.t("settings.general.row.showTerminal.title")}
description={language.t("settings.general.row.showTerminal.description")}
>
<div data-action="settings-show-terminal">
<Switch
checked={settings.general.showTerminal()}
onChange={(checked) => settings.general.setShowTerminal(checked)}
/>
</div>
</SettingsRowV2>
<SettingsRowV2 <SettingsRowV2
title={language.t("settings.general.row.showStatus.title")} title={language.t("settings.general.row.showStatus.title")}
description={language.t("settings.general.row.showStatus.description")} description={language.t("settings.general.row.showStatus.description")}
@ -709,6 +668,7 @@ export const SettingsGeneralV2: Component = () => {
</div> </div>
) )
// We can probably remove this, right?
const DisplaySection = () => ( const DisplaySection = () => (
<Show when={desktop()}> <Show when={desktop()}>
<div class="settings-v2-section"> <div class="settings-v2-section">
@ -723,26 +683,6 @@ export const SettingsGeneralV2: Component = () => {
<Switch checked={pinchZoom.latest} onChange={onPinchZoomChange} /> <Switch checked={pinchZoom.latest} onChange={onPinchZoomChange} />
</div> </div>
</SettingsRowV2> </SettingsRowV2>
<Show when={linux()}>
<SettingsRowV2
title={
<div class="flex items-center gap-2">
<span>{language.t("settings.general.row.wayland.title")}</span>
<Tooltip value={language.t("settings.general.row.wayland.tooltip")} placement="top">
<span class="text-text-weak">
<Icon name="help" size="small" />
</span>
</Tooltip>
</div>
}
description={language.t("settings.general.row.wayland.description")}
>
<div data-action="settings-wayland">
<Switch checked={displayBackend.latest === "wayland"} onChange={onDisplayBackendChange} />
</div>
</SettingsRowV2>
</Show>
</SettingsListV2> </SettingsListV2>
</div> </div>
</Show> </Show>
@ -763,13 +703,13 @@ export const SettingsGeneralV2: Component = () => {
<SoundsSection /> <SoundsSection />
<UpdatesSection /> <Show when={desktop()}>
<UpdatesSection />
</Show>
<DisplaySection /> <DisplaySection />
<Show when={desktop()}> <AdvancedSection />
<AdvancedSection />
</Show>
</div> </div>
</> </>
) )

View file

@ -153,6 +153,15 @@ export const { use: useSettings, provider: SettingsProvider } = createSimpleCont
gate: false, gate: false,
init: () => { init: () => {
const [store, setStore, _, ready] = persisted("settings.v3", createStore<Settings>(defaultSettings)) const [store, setStore, _, ready] = persisted("settings.v3", createStore<Settings>(defaultSettings))
const showFileTree = withFallback(() => store.general?.showFileTree, defaultSettings.general.showFileTree)
const showSearch = withFallback(() => store.general?.showSearch, defaultSettings.general.showSearch)
const showStatus = withFallback(() => store.general?.showStatus, defaultSettings.general.showStatus)
const showCustomAgents = withFallback(
() => store.general?.showCustomAgents,
defaultSettings.general.showCustomAgents,
)
const newLayoutDesigns = withFallback(() => store.general?.newLayoutDesigns, newLayoutDesignsDefault)
const visible = (preference: () => boolean) => createMemo(() => !newLayoutDesigns() || preference())
createEffect(() => { createEffect(() => {
if (typeof document === "undefined") return if (typeof document === "undefined") return
@ -187,7 +196,7 @@ export const { use: useSettings, provider: SettingsProvider } = createSimpleCont
setFollowup(value: "queue" | "steer") { setFollowup(value: "queue" | "steer") {
setStore("general", "followup", value === "queue" ? "steer" : value) setStore("general", "followup", value === "queue" ? "steer" : value)
}, },
showFileTree: withFallback(() => store.general?.showFileTree, defaultSettings.general.showFileTree), showFileTree,
setShowFileTree(value: boolean) { setShowFileTree(value: boolean) {
setStore("general", "showFileTree", value) setStore("general", "showFileTree", value)
}, },
@ -195,11 +204,11 @@ export const { use: useSettings, provider: SettingsProvider } = createSimpleCont
setShowNavigation(value: boolean) { setShowNavigation(value: boolean) {
setStore("general", "showNavigation", value) setStore("general", "showNavigation", value)
}, },
showSearch: withFallback(() => store.general?.showSearch, defaultSettings.general.showSearch), showSearch,
setShowSearch(value: boolean) { setShowSearch(value: boolean) {
setStore("general", "showSearch", value) setStore("general", "showSearch", value)
}, },
showStatus: withFallback(() => store.general?.showStatus, defaultSettings.general.showStatus), showStatus,
setShowStatus(value: boolean) { setShowStatus(value: boolean) {
setStore("general", "showStatus", value) setStore("general", "showStatus", value)
}, },
@ -235,15 +244,21 @@ export const { use: useSettings, provider: SettingsProvider } = createSimpleCont
setShowSessionProgressBar(value: boolean) { setShowSessionProgressBar(value: boolean) {
setStore("general", "showSessionProgressBar", value) setStore("general", "showSessionProgressBar", value)
}, },
showCustomAgents: withFallback(() => store.general?.showCustomAgents, defaultSettings.general.showCustomAgents), showCustomAgents,
setShowCustomAgents(value: boolean) { setShowCustomAgents(value: boolean) {
setStore("general", "showCustomAgents", value) setStore("general", "showCustomAgents", value)
}, },
newLayoutDesigns: withFallback(() => store.general?.newLayoutDesigns, newLayoutDesignsDefault), newLayoutDesigns,
setNewLayoutDesigns(value: boolean) { setNewLayoutDesigns(value: boolean) {
setStore("general", "newLayoutDesigns", value) setStore("general", "newLayoutDesigns", value)
}, },
}, },
visibility: {
fileTree: visible(showFileTree),
search: visible(showSearch),
status: visible(showStatus),
customAgents: visible(showCustomAgents),
},
appearance: { appearance: {
fontSize: withFallback(() => store.appearance?.fontSize, defaultSettings.appearance.fontSize), fontSize: withFallback(() => store.appearance?.fontSize, defaultSettings.appearance.fontSize),
setFontSize(value: number) { setFontSize(value: number) {

View file

@ -825,17 +825,17 @@ export const dict = {
"settings.general.row.followup.option.queue": "Queue", "settings.general.row.followup.option.queue": "Queue",
"settings.general.row.followup.option.steer": "Steer", "settings.general.row.followup.option.steer": "Steer",
"settings.general.row.showFileTree.title": "File tree", "settings.general.row.showFileTree.title": "File tree",
"settings.general.row.showFileTree.description": "Show the file tree panel in desktop sessions", "settings.general.row.showFileTree.description": "Show the file tree panel in sessions",
"settings.general.row.showNavigation.title": "Navigation controls", "settings.general.row.showNavigation.title": "Navigation controls",
"settings.general.row.showNavigation.description": "Show the back and forward buttons in the desktop title bar", "settings.general.row.showNavigation.description": "Show the back and forward buttons in the desktop title bar",
"settings.general.row.showSearch.title": "Command palette", "settings.general.row.showSearch.title": "Command palette",
"settings.general.row.showSearch.description": "Show the search and command palette button in the desktop title bar", "settings.general.row.showSearch.description": "Show the search and command palette button in the title bar",
"settings.general.row.showTerminal.title": "Terminal", "settings.general.row.showTerminal.title": "Terminal",
"settings.general.row.showTerminal.description": "Show the terminal button in the desktop title bar", "settings.general.row.showTerminal.description": "Show the terminal button in the desktop title bar",
"settings.general.row.showStatus.title": "Server status", "settings.general.row.showStatus.title": "Server status",
"settings.general.row.showStatus.description": "Show the server status button in the desktop title bar", "settings.general.row.showStatus.description": "Show the server status button in the title bar",
"settings.general.row.showCustomAgents.title": "Custom agents", "settings.general.row.showCustomAgents.title": "Custom agents",
"settings.general.row.showCustomAgents.description": "Show the agent picker in the v2 desktop composer", "settings.general.row.showCustomAgents.description": "Show the agent picker in the composer",
"settings.general.row.reasoningSummaries.title": "Show reasoning summaries", "settings.general.row.reasoningSummaries.title": "Show reasoning summaries",
"settings.general.row.reasoningSummaries.description": "Display model reasoning summaries in the timeline", "settings.general.row.reasoningSummaries.description": "Display model reasoning summaries in the timeline",
"settings.general.row.shellToolPartsExpanded.title": "Expand shell tool parts", "settings.general.row.shellToolPartsExpanded.title": "Expand shell tool parts",

View file

@ -759,16 +759,15 @@ export const dict = {
"settings.general.row.followup.option.queue": "Черга", "settings.general.row.followup.option.queue": "Черга",
"settings.general.row.followup.option.steer": "Керування", "settings.general.row.followup.option.steer": "Керування",
"settings.general.row.showFileTree.title": "Дерево файлів", "settings.general.row.showFileTree.title": "Дерево файлів",
"settings.general.row.showFileTree.description": "Показувати панель дерева файлів у сесіях на робочому столі", "settings.general.row.showFileTree.description": "Показувати панель дерева файлів у сесіях",
"settings.general.row.showNavigation.title": "Елементи навігації", "settings.general.row.showNavigation.title": "Елементи навігації",
"settings.general.row.showNavigation.description": "Показувати кнопки назад і вперед у заголовку робочого столу", "settings.general.row.showNavigation.description": "Показувати кнопки назад і вперед у заголовку робочого столу",
"settings.general.row.showSearch.title": "Палітра команд", "settings.general.row.showSearch.title": "Палітра команд",
"settings.general.row.showSearch.description": "settings.general.row.showSearch.description": "Показувати кнопку пошуку та палітри команд у заголовку",
"Показувати кнопку пошуку та палітри команд у заголовку робочого столу",
"settings.general.row.showTerminal.title": "Термінал", "settings.general.row.showTerminal.title": "Термінал",
"settings.general.row.showTerminal.description": "Показувати кнопку термінала в заголовку робочого столу", "settings.general.row.showTerminal.description": "Показувати кнопку термінала в заголовку робочого столу",
"settings.general.row.showStatus.title": "Статус сервера", "settings.general.row.showStatus.title": "Статус сервера",
"settings.general.row.showStatus.description": "Показувати кнопку статусу сервера в заголовку робочого столу", "settings.general.row.showStatus.description": "Показувати кнопку статусу сервера в заголовку",
"settings.general.row.reasoningSummaries.title": "Показувати підсумки мислення", "settings.general.row.reasoningSummaries.title": "Показувати підсумки мислення",
"settings.general.row.reasoningSummaries.description": "Відображати підсумки мислення моделі на часовій шкалі", "settings.general.row.reasoningSummaries.description": "Відображати підсумки мислення моделі на часовій шкалі",
"settings.general.row.shellToolPartsExpanded.title": "Розгортати частини інструменту оболонки", "settings.general.row.shellToolPartsExpanded.title": "Розгортати частини інструменту оболонки",

View file

@ -275,8 +275,7 @@ export default function Page() {
() => () =>
isDesktop() && isDesktop() &&
shouldShowFileTree({ shouldShowFileTree({
desktopV2: platform.platform === "desktop" && settings.general.newLayoutDesigns(), visible: settings.visibility.fileTree(),
showFileTree: settings.general.showFileTree(),
opened: layout.fileTree.opened(), opened: layout.fileTree.opened(),
}), }),
) )

View file

@ -12,10 +12,9 @@ import {
} from "./helpers" } from "./helpers"
describe("shouldShowFileTree", () => { describe("shouldShowFileTree", () => {
test("does not reserve space for a disabled v2 file tree", () => { test("does not reserve space for a disabled file tree", () => {
expect(shouldShowFileTree({ desktopV2: true, showFileTree: false, opened: true })).toBe(false) expect(shouldShowFileTree({ visible: false, opened: true })).toBe(false)
expect(shouldShowFileTree({ desktopV2: false, showFileTree: false, opened: true })).toBe(true) expect(shouldShowFileTree({ visible: true, opened: true })).toBe(true)
expect(shouldShowFileTree({ desktopV2: true, showFileTree: true, opened: true })).toBe(true)
}) })
}) })

View file

@ -20,8 +20,8 @@ type TabsInput = {
export const getSessionKey = (dir: string | undefined, id: string | undefined) => `${dir ?? ""}${id ? `/${id}` : ""}` export const getSessionKey = (dir: string | undefined, id: string | undefined) => `${dir ?? ""}${id ? `/${id}` : ""}`
export function shouldShowFileTree(input: { desktopV2: boolean; showFileTree: boolean; opened: boolean }) { export function shouldShowFileTree(input: { visible: boolean; opened: boolean }) {
return input.opened && (!input.desktopV2 || input.showFileTree) return input.opened && input.visible
} }
export const createSessionTabs = (input: TabsInput) => { export const createSessionTabs = (input: TabsInput) => {

View file

@ -19,7 +19,6 @@ import { useCommand } from "@/context/command"
import { useFile, type SelectedLineRange } from "@/context/file" import { useFile, type SelectedLineRange } from "@/context/file"
import { useLanguage } from "@/context/language" import { useLanguage } from "@/context/language"
import { useLayout } from "@/context/layout" import { useLayout } from "@/context/layout"
import { usePlatform } from "@/context/platform"
import { useSettings } from "@/context/settings" import { useSettings } from "@/context/settings"
import { useSync } from "@/context/sync" import { useSync } from "@/context/sync"
import { createFileTabListSync } from "@/pages/session/file-tab-scroll" import { createFileTabListSync } from "@/pages/session/file-tab-scroll"
@ -54,7 +53,6 @@ export function SessionSidePanel(props: {
size: Sizing size: Sizing
}) { }) {
const layout = useLayout() const layout = useLayout()
const platform = usePlatform()
const settings = useSettings() const settings = useSettings()
const sync = useSync() const sync = useSync()
const file = useFile() const file = useFile()
@ -64,16 +62,14 @@ export function SessionSidePanel(props: {
const { sessionKey, tabs, view, params } = useSessionLayout() const { sessionKey, tabs, view, params } = useSessionLayout()
const isDesktop = createMediaQuery("(min-width: 768px)") const isDesktop = createMediaQuery("(min-width: 768px)")
const desktopV2 = () => platform.platform === "desktop" && settings.general.newLayoutDesigns() const shown = settings.visibility.fileTree
const shown = createMemo(() => !desktopV2() || settings.general.showFileTree())
const reviewOpen = createMemo(() => isDesktop() && view().reviewPanel.opened()) const reviewOpen = createMemo(() => isDesktop() && view().reviewPanel.opened())
const fileOpen = createMemo( const fileOpen = createMemo(
() => () =>
isDesktop() && isDesktop() &&
shouldShowFileTree({ shouldShowFileTree({
desktopV2: desktopV2(), visible: shown(),
showFileTree: settings.general.showFileTree(),
opened: layout.fileTree.opened(), opened: layout.fileTree.opened(),
}), }),
) )

View file

@ -7,7 +7,6 @@ import { useLanguage } from "@/context/language"
import { useLayout } from "@/context/layout" import { useLayout } from "@/context/layout"
import { useLocal } from "@/context/local" import { useLocal } from "@/context/local"
import { usePermission } from "@/context/permission" import { usePermission } from "@/context/permission"
import { usePlatform } from "@/context/platform"
import { usePrompt } from "@/context/prompt" import { usePrompt } from "@/context/prompt"
import { useSDK } from "@/context/sdk" import { useSDK } from "@/context/sdk"
import { useSettings } from "@/context/settings" import { useSettings } from "@/context/settings"
@ -41,7 +40,6 @@ export const useSessionCommands = (actions: SessionCommandContext) => {
const language = useLanguage() const language = useLanguage()
const local = useLocal() const local = useLocal()
const permission = usePermission() const permission = usePermission()
const platform = usePlatform()
const prompt = usePrompt() const prompt = usePrompt()
const sdk = useSDK() const sdk = useSDK()
const settings = useSettings() const settings = useSettings()
@ -70,8 +68,7 @@ export const useSessionCommands = (actions: SessionCommandContext) => {
}) })
const activeFileTab = tabState.activeFileTab const activeFileTab = tabState.activeFileTab
const closableTab = tabState.closableTab const closableTab = tabState.closableTab
const desktopV2 = () => platform.platform === "desktop" && settings.general.newLayoutDesigns() const shown = settings.visibility.fileTree
const shown = () => (desktopV2() ? settings.general.showFileTree() : true)
const messages = () => { const messages = () => {
const id = params.id const id = params.id
@ -547,7 +544,7 @@ export const useSessionCommands = (actions: SessionCommandContext) => {
description: language.t("command.agent.cycle.description"), description: language.t("command.agent.cycle.description"),
keybind: "mod+.", keybind: "mod+.",
slash: "agent", slash: "agent",
disabled: desktopV2() && !settings.general.showCustomAgents(), disabled: !settings.visibility.customAgents(),
onSelect: () => local.agent.move(1), onSelect: () => local.agent.move(1),
}), }),
agentCommand({ agentCommand({
@ -555,7 +552,7 @@ export const useSessionCommands = (actions: SessionCommandContext) => {
title: language.t("command.agent.cycle.reverse"), title: language.t("command.agent.cycle.reverse"),
description: language.t("command.agent.cycle.reverse.description"), description: language.t("command.agent.cycle.reverse.description"),
keybind: "shift+mod+.", keybind: "shift+mod+.",
disabled: desktopV2() && !settings.general.showCustomAgents(), disabled: !settings.visibility.customAgents(),
onSelect: () => local.agent.move(-1), onSelect: () => local.agent.move(-1),
}), }),
] ]