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,15 +112,14 @@ 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 ? (
|
<>
|
||||||
<>
|
{visible.slice(0, split)}
|
||||||
{visible.slice(0, split)}
|
<span style={{ fg: theme.textMuted }}>{visible.slice(split)}</span>
|
||||||
<span style={{ fg: theme.textMuted }}>{visible.slice(split)}</span>
|
</>
|
||||||
</>
|
) : undefined,
|
||||||
) : undefined,
|
|
||||||
bg: deleting ? theme.error : undefined,
|
bg: deleting ? theme.error : undefined,
|
||||||
value: { type: "directory", directory: item.location, subdirectory: item.location !== item.root } as const,
|
value: { type: "directory", directory: item.location, subdirectory: item.location !== item.root } as const,
|
||||||
category: item.root === main ? "Project" : "Working copies",
|
category: item.root === main ? "Project" : "Working copies",
|
||||||
@@ -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>) {
|
||||||
|
|||||||
@@ -205,19 +205,19 @@ function View(props: { api: TuiPluginApi }) {
|
|||||||
current={cur()}
|
current={cur()}
|
||||||
onMove={(item) => setCur(item.value)}
|
onMove={(item) => setCur(item.value)}
|
||||||
actions={[
|
actions={[
|
||||||
{
|
{
|
||||||
title: "toggle",
|
title: "toggle",
|
||||||
command: "plugins.toggle",
|
command: "plugins.toggle",
|
||||||
hidden: lock(),
|
hidden: lock(),
|
||||||
onTrigger: (item) => {
|
onTrigger: (item) => {
|
||||||
setCur(item.value)
|
setCur(item.value)
|
||||||
flip(item.value)
|
flip(item.value)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "install",
|
title: "install",
|
||||||
command: "dialog.plugins.install",
|
command: "dialog.plugins.install",
|
||||||
hidden: lock(),
|
hidden: lock(),
|
||||||
onTrigger: () => {
|
onTrigger: () => {
|
||||||
showInstall(props.api)
|
showInstall(props.api)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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()
|
||||||
@@ -550,7 +554,7 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
|
|||||||
</Show>
|
</Show>
|
||||||
<For each={options}>
|
<For each={options}>
|
||||||
{(option) => {
|
{(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))
|
const current = createMemo(() => isDeepEqual(option.value, props.current))
|
||||||
return (
|
return (
|
||||||
<box
|
<box
|
||||||
|
|||||||
@@ -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