mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 01:34:22 +01:00
fix: session rename functionality (#3840)
This commit is contained in:
@@ -2,6 +2,7 @@ import { TextareaRenderable, TextAttributes } from "@opentui/core"
|
|||||||
import { useTheme } from "../context/theme"
|
import { useTheme } from "../context/theme"
|
||||||
import { useDialog, type DialogContext } from "./dialog"
|
import { useDialog, type DialogContext } from "./dialog"
|
||||||
import { onMount } from "solid-js"
|
import { onMount } from "solid-js"
|
||||||
|
import { useKeyboard } from "@opentui/solid"
|
||||||
|
|
||||||
export type DialogPromptProps = {
|
export type DialogPromptProps = {
|
||||||
title: string
|
title: string
|
||||||
@@ -15,6 +16,13 @@ export function DialogPrompt(props: DialogPromptProps) {
|
|||||||
const { theme } = useTheme()
|
const { theme } = useTheme()
|
||||||
let textarea: TextareaRenderable
|
let textarea: TextareaRenderable
|
||||||
|
|
||||||
|
useKeyboard((evt) => {
|
||||||
|
if (evt.name === "return") {
|
||||||
|
props.onConfirm?.(textarea.plainText)
|
||||||
|
dialog.clear()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
dialog.setSize("large")
|
dialog.setSize("large")
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user