chore: generate
This commit is contained in:
@@ -16,9 +16,7 @@ import { useProject } from "@tui/context/project"
|
|||||||
import { Spinner } from "./spinner"
|
import { Spinner } from "./spinner"
|
||||||
import { DialogWorkspaceFileChanges } from "./dialog-workspace-file-changes"
|
import { DialogWorkspaceFileChanges } from "./dialog-workspace-file-changes"
|
||||||
|
|
||||||
export type MoveSessionSelection =
|
export type MoveSessionSelection = { type: "directory"; directory: string; subdirectory: boolean } | { type: "new" }
|
||||||
| { type: "directory"; directory: string; subdirectory: boolean }
|
|
||||||
| { type: "new" }
|
|
||||||
|
|
||||||
export function DialogMoveSession(props: {
|
export function DialogMoveSession(props: {
|
||||||
projectID: string
|
projectID: string
|
||||||
@@ -114,8 +112,7 @@ export function DialogMoveSession(props: {
|
|||||||
const isRemoving = removing() === item.location
|
const isRemoving = removing() === item.location
|
||||||
return {
|
return {
|
||||||
title: isRemoving ? `Deleting ${item.location}` : deleting ? `Press ${deleteHint()} again to confirm` : title,
|
title: isRemoving ? `Deleting ${item.location}` : deleting ? `Press ${deleteHint()} again to confirm` : title,
|
||||||
titleView:
|
titleView: isRemoving ? (
|
||||||
isRemoving ? (
|
|
||||||
<span style={{ fg: theme.error }}>Deleting {item.location}</span>
|
<span style={{ fg: theme.error }}>Deleting {item.location}</span>
|
||||||
) : !deleting && suffix ? (
|
) : !deleting && suffix ? (
|
||||||
<>
|
<>
|
||||||
@@ -136,9 +133,7 @@ export function DialogMoveSession(props: {
|
|||||||
if (directories.loading || loadedProject.loading || !props.current) return
|
if (directories.loading || loadedProject.loading || !props.current) return
|
||||||
if (props.current.type === "new") return props.current
|
if (props.current.type === "new") return props.current
|
||||||
const directory = props.current.directory
|
const directory = props.current.directory
|
||||||
return options().find(
|
return options().find((option) => option.value?.type === "directory" && option.value.directory === directory)?.value
|
||||||
(option) => option.value?.type === "directory" && option.value.directory === directory,
|
|
||||||
)?.value
|
|
||||||
})
|
})
|
||||||
|
|
||||||
async function remove(option: DialogSelectOption<MoveSessionSelection | undefined>) {
|
async function remove(option: DialogSelectOption<MoveSessionSelection | undefined>) {
|
||||||
|
|||||||
@@ -9,9 +9,7 @@ import {
|
|||||||
} from "solid-js"
|
} from "solid-js"
|
||||||
import { useSync } from "../../context/sync"
|
import { useSync } from "../../context/sync"
|
||||||
|
|
||||||
export type HomeSessionDestination =
|
export type HomeSessionDestination = { type: "directory"; directory: string; subdirectory: boolean } | { type: "new" }
|
||||||
| { type: "directory"; directory: string; subdirectory: boolean }
|
|
||||||
| { type: "new" }
|
|
||||||
|
|
||||||
type Context = {
|
type Context = {
|
||||||
destination: Accessor<HomeSessionDestination | undefined>
|
destination: Accessor<HomeSessionDestination | undefined>
|
||||||
@@ -24,8 +22,8 @@ const HomeSessionDestinationContext = createContext<Context>()
|
|||||||
export function HomeSessionDestinationProvider(props: ParentProps) {
|
export function HomeSessionDestinationProvider(props: ParentProps) {
|
||||||
const sync = useSync()
|
const sync = useSync()
|
||||||
const [selected, setDestination] = createSignal<HomeSessionDestination>()
|
const [selected, setDestination] = createSignal<HomeSessionDestination>()
|
||||||
const destination = createMemo<HomeSessionDestination>(() =>
|
const destination = createMemo<HomeSessionDestination>(
|
||||||
selected() ?? { type: "directory", directory: sync.path.directory || process.cwd(), subdirectory: false },
|
() => selected() ?? { type: "directory", directory: sync.path.directory || process.cwd(), subdirectory: false },
|
||||||
)
|
)
|
||||||
return (
|
return (
|
||||||
<HomeSessionDestinationContext.Provider
|
<HomeSessionDestinationContext.Provider
|
||||||
|
|||||||
@@ -135,7 +135,11 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
|
|||||||
.filter((item) => item.label),
|
.filter((item) => item.label),
|
||||||
...(props.footerHints ?? []),
|
...(props.footerHints ?? []),
|
||||||
])
|
])
|
||||||
const actionItems = createMemo(() => visibleActions().filter(isActionItem).filter((item) => !isActionDisabled(item)))
|
const actionItems = createMemo(() =>
|
||||||
|
visibleActions()
|
||||||
|
.filter(isActionItem)
|
||||||
|
.filter((item) => !isActionDisabled(item)),
|
||||||
|
)
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
const index = focusedAction()
|
const index = focusedAction()
|
||||||
|
|||||||
@@ -3990,14 +3990,6 @@
|
|||||||
},
|
},
|
||||||
"required": true
|
"required": true
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "directory",
|
|
||||||
"in": "query",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"required": false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "workspace",
|
"name": "workspace",
|
||||||
"in": "query",
|
"in": "query",
|
||||||
@@ -4039,9 +4031,12 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"directory": {
|
"directory": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"force": {
|
||||||
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["directory"],
|
"required": ["directory", "force"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19626,6 +19621,9 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"message": {
|
"message": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"forceRequired": {
|
||||||
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["message"],
|
"required": ["message"],
|
||||||
|
|||||||
Reference in New Issue
Block a user