Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
usrnk1
6682720111 feat(desktop): add terminal toggle to review header 2026-07-09 11:46:13 +02:00
usrnk1
f2af90573b feat(ui): add outline terminal icon 2026-07-09 11:46:13 +02:00
2 changed files with 57 additions and 23 deletions

View file

@ -4,7 +4,11 @@ import { createMediaQuery } from "@solid-primitives/media"
import { Tabs } from "@opencode-ai/ui/tabs" import { Tabs } from "@opencode-ai/ui/tabs"
import { IconButton } from "@opencode-ai/ui/icon-button" import { IconButton } from "@opencode-ai/ui/icon-button"
import { Icon } from "@opencode-ai/ui/icon" import { Icon } from "@opencode-ai/ui/icon"
import { Icon as IconV2 } from "@opencode-ai/ui/v2/icon"
import { IconButtonV2 } from "@opencode-ai/ui/v2/icon-button-v2"
import { KeybindV2 } from "@opencode-ai/ui/v2/keybind-v2"
import { TooltipKeybind } from "@opencode-ai/ui/tooltip" import { TooltipKeybind } from "@opencode-ai/ui/tooltip"
import { TooltipV2 } from "@opencode-ai/ui/v2/tooltip-v2"
import { ResizeHandle } from "@opencode-ai/ui/resize-handle" import { ResizeHandle } from "@opencode-ai/ui/resize-handle"
import { Mark } from "@opencode-ai/ui/logo" import { Mark } from "@opencode-ai/ui/logo"
import { DragDropProvider, DragDropSensors, DragOverlay, SortableProvider, closestCenter } from "@thisbeyond/solid-dnd" import { DragDropProvider, DragDropSensors, DragOverlay, SortableProvider, closestCenter } from "@thisbeyond/solid-dnd"
@ -193,6 +197,30 @@ export function SessionSidePanel(props: {
previewTab(SESSION_OPEN_FILE_TAB) previewTab(SESSION_OPEN_FILE_TAB)
queueMicrotask(() => fileFilter?.focus()) queueMicrotask(() => fileFilter?.focus())
} }
const openFileButton = () => (
<TooltipKeybind
title={language.t("command.file.open")}
keybind={command.keybind("file.open")}
class="flex items-center"
>
<IconButton
icon="plus-small"
variant="ghost"
iconSize="large"
class="!rounded-md"
onClick={() => {
if (props.fileBrowserState) {
openFileBrowser()
return
}
void import("@/components/dialog-select-file").then((x) => {
dialog.show(() => <x.DialogSelectFile mode="files" onOpenFile={showAllFiles} />)
})
}}
aria-label={language.t("command.file.open")}
/>
</TooltipKeybind>
)
const activateTab = (value: string) => { const activateTab = (value: string) => {
const next = normalizeTab(value) const next = normalizeTab(value)
const path = file.pathFromTab(next) const path = file.pathFromTab(next)
@ -307,6 +335,7 @@ export function SessionSidePanel(props: {
</div> </div>
</Tabs.Trigger> </Tabs.Trigger>
</Show> </Show>
<Show when={settings.general.newLayoutDesigns()}>{openFileButton()}</Show>
<Show when={contextOpen()}> <Show when={contextOpen()}>
<Tabs.Trigger <Tabs.Trigger
value="context" value="context"
@ -379,29 +408,30 @@ export function SessionSidePanel(props: {
)} )}
</For> </For>
</SortableProvider> </SortableProvider>
<div class="bg-background-stronger h-full shrink-0 sticky right-0 z-10 flex items-center justify-center pr-3"> <div class="bg-background-stronger h-full shrink-0 sticky right-0 z-10 ml-auto flex items-center pr-3">
<TooltipKeybind <Show when={!settings.general.newLayoutDesigns()}>{openFileButton()}</Show>
title={language.t("command.file.open")} <Show when={settings.general.newLayoutDesigns()}>
keybind={command.keybind("file.open")} <TooltipV2
class="flex items-center" openDelay={1000}
> value={
<IconButton <>
icon="plus-small" {language.t("command.terminal.toggle")}
variant="ghost" <KeybindV2 keys={command.keybindParts("terminal.toggle")} variant="neutral" />
iconSize="large" </>
class="!rounded-md" }
onClick={() => { >
if (props.fileBrowserState) { <IconButtonV2
openFileBrowser() variant="ghost-muted"
return size="large"
} state={view().terminal.opened() ? "pressed" : undefined}
void import("@/components/dialog-select-file").then((x) => { aria-label={language.t("command.terminal.toggle")}
dialog.show(() => <x.DialogSelectFile mode="files" onOpenFile={showAllFiles} />) aria-pressed={view().terminal.opened()}
}) aria-controls="terminal-panel"
}} onClick={() => view().terminal.toggle()}
aria-label={language.t("command.file.open")} icon={<IconV2 name="outline-terminal" />}
/> />
</TooltipKeybind> </TooltipV2>
</Show>
</div> </div>
</Tabs.List> </Tabs.List>
</div> </div>

View file

@ -89,6 +89,10 @@ const icons = {
viewBox: "0 0 16 16", viewBox: "0 0 16 16",
body: `<path d="M4.25 11.75L11.75 4.25M11.75 11.75L4.25 4.25" stroke="currentColor"/>`, body: `<path d="M4.25 11.75L11.75 4.25M11.75 11.75L4.25 4.25" stroke="currentColor"/>`,
}, },
"outline-terminal": {
viewBox: "0 0 16 16",
body: `<g transform="translate(2.223 2.773)"><path d="M7.55355 9.95355H11.5536" stroke="currentColor" stroke-linejoin="round"/><path d="M0.353553 0.353553L5.15355 5.15355L0.353553 9.95355" stroke="currentColor" stroke-linejoin="round"/></g>`,
},
"outline-chevron-down": { "outline-chevron-down": {
viewBox: "0 0 16 16", viewBox: "0 0 16 16",
body: `<path d="M5 6.5L8 9.5L11 6.5" stroke="currentColor"/>`, body: `<path d="M5 6.5L8 9.5L11 6.5" stroke="currentColor"/>`,