mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-10 03:18:31 +00:00
chore: generate
This commit is contained in:
parent
f591bf5f93
commit
969bb90f69
5 changed files with 34 additions and 39 deletions
|
|
@ -16,9 +16,7 @@ import { useProject } from "@tui/context/project"
|
|||
import { Spinner } from "./spinner"
|
||||
import { DialogWorkspaceFileChanges } from "./dialog-workspace-file-changes"
|
||||
|
||||
export type MoveSessionSelection =
|
||||
| { type: "directory"; directory: string; subdirectory: boolean }
|
||||
| { type: "new" }
|
||||
export type MoveSessionSelection = { type: "directory"; directory: string; subdirectory: boolean } | { type: "new" }
|
||||
|
||||
export function DialogMoveSession(props: {
|
||||
projectID: string
|
||||
|
|
@ -114,15 +112,14 @@ export function DialogMoveSession(props: {
|
|||
const isRemoving = removing() === item.location
|
||||
return {
|
||||
title: isRemoving ? `Deleting ${item.location}` : deleting ? `Press ${deleteHint()} again to confirm` : title,
|
||||
titleView:
|
||||
isRemoving ? (
|
||||
<span style={{ fg: theme.error }}>Deleting {item.location}</span>
|
||||
) : !deleting && suffix ? (
|
||||
<>
|
||||
{visible.slice(0, split)}
|
||||
<span style={{ fg: theme.textMuted }}>{visible.slice(split)}</span>
|
||||
</>
|
||||
) : undefined,
|
||||
titleView: isRemoving ? (
|
||||
<span style={{ fg: theme.error }}>Deleting {item.location}</span>
|
||||
) : !deleting && suffix ? (
|
||||
<>
|
||||
{visible.slice(0, split)}
|
||||
<span style={{ fg: theme.textMuted }}>{visible.slice(split)}</span>
|
||||
</>
|
||||
) : undefined,
|
||||
bg: deleting ? theme.error : undefined,
|
||||
value: { type: "directory", directory: item.location, subdirectory: item.location !== item.root } as const,
|
||||
category: item.root === main ? "Project" : "Working copies",
|
||||
|
|
@ -136,9 +133,7 @@ export function DialogMoveSession(props: {
|
|||
if (directories.loading || loadedProject.loading || !props.current) return
|
||||
if (props.current.type === "new") return props.current
|
||||
const directory = props.current.directory
|
||||
return options().find(
|
||||
(option) => option.value?.type === "directory" && option.value.directory === directory,
|
||||
)?.value
|
||||
return options().find((option) => option.value?.type === "directory" && option.value.directory === directory)?.value
|
||||
})
|
||||
|
||||
async function remove(option: DialogSelectOption<MoveSessionSelection | undefined>) {
|
||||
|
|
|
|||
|
|
@ -205,19 +205,19 @@ function View(props: { api: TuiPluginApi }) {
|
|||
current={cur()}
|
||||
onMove={(item) => setCur(item.value)}
|
||||
actions={[
|
||||
{
|
||||
title: "toggle",
|
||||
command: "plugins.toggle",
|
||||
hidden: lock(),
|
||||
{
|
||||
title: "toggle",
|
||||
command: "plugins.toggle",
|
||||
hidden: lock(),
|
||||
onTrigger: (item) => {
|
||||
setCur(item.value)
|
||||
flip(item.value)
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "install",
|
||||
command: "dialog.plugins.install",
|
||||
hidden: lock(),
|
||||
{
|
||||
title: "install",
|
||||
command: "dialog.plugins.install",
|
||||
hidden: lock(),
|
||||
onTrigger: () => {
|
||||
showInstall(props.api)
|
||||
},
|
||||
|
|
|
|||
|
|
@ -9,9 +9,7 @@ import {
|
|||
} from "solid-js"
|
||||
import { useSync } from "../../context/sync"
|
||||
|
||||
export type HomeSessionDestination =
|
||||
| { type: "directory"; directory: string; subdirectory: boolean }
|
||||
| { type: "new" }
|
||||
export type HomeSessionDestination = { type: "directory"; directory: string; subdirectory: boolean } | { type: "new" }
|
||||
|
||||
type Context = {
|
||||
destination: Accessor<HomeSessionDestination | undefined>
|
||||
|
|
@ -24,8 +22,8 @@ const HomeSessionDestinationContext = createContext<Context>()
|
|||
export function HomeSessionDestinationProvider(props: ParentProps) {
|
||||
const sync = useSync()
|
||||
const [selected, setDestination] = createSignal<HomeSessionDestination>()
|
||||
const destination = createMemo<HomeSessionDestination>(() =>
|
||||
selected() ?? { type: "directory", directory: sync.path.directory || process.cwd(), subdirectory: false },
|
||||
const destination = createMemo<HomeSessionDestination>(
|
||||
() => selected() ?? { type: "directory", directory: sync.path.directory || process.cwd(), subdirectory: false },
|
||||
)
|
||||
return (
|
||||
<HomeSessionDestinationContext.Provider
|
||||
|
|
|
|||
|
|
@ -135,7 +135,11 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
|
|||
.filter((item) => item.label),
|
||||
...(props.footerHints ?? []),
|
||||
])
|
||||
const actionItems = createMemo(() => visibleActions().filter(isActionItem).filter((item) => !isActionDisabled(item)))
|
||||
const actionItems = createMemo(() =>
|
||||
visibleActions()
|
||||
.filter(isActionItem)
|
||||
.filter((item) => !isActionDisabled(item)),
|
||||
)
|
||||
|
||||
createEffect(() => {
|
||||
const index = focusedAction()
|
||||
|
|
@ -550,7 +554,7 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
|
|||
</Show>
|
||||
<For each={options}>
|
||||
{(option) => {
|
||||
const active = createMemo(() => !props.locked && isDeepEqual(option.value, selected()?.value))
|
||||
const active = createMemo(() => !props.locked && isDeepEqual(option.value, selected()?.value))
|
||||
const current = createMemo(() => isDeepEqual(option.value, props.current))
|
||||
return (
|
||||
<box
|
||||
|
|
|
|||
|
|
@ -3990,14 +3990,6 @@
|
|||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "directory",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "workspace",
|
||||
"in": "query",
|
||||
|
|
@ -4039,9 +4031,12 @@
|
|||
"properties": {
|
||||
"directory": {
|
||||
"type": "string"
|
||||
},
|
||||
"force": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": ["directory"],
|
||||
"required": ["directory", "force"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
|
|
@ -19626,6 +19621,9 @@
|
|||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"forceRequired": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": ["message"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue