mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
fix: session rename functionality (#3840)
This commit is contained in:
parent
e5a651eef7
commit
9c82f1f5e9
1 changed files with 8 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ import { TextareaRenderable, TextAttributes } from "@opentui/core"
|
|||
import { useTheme } from "../context/theme"
|
||||
import { useDialog, type DialogContext } from "./dialog"
|
||||
import { onMount } from "solid-js"
|
||||
import { useKeyboard } from "@opentui/solid"
|
||||
|
||||
export type DialogPromptProps = {
|
||||
title: string
|
||||
|
|
@ -15,6 +16,13 @@ export function DialogPrompt(props: DialogPromptProps) {
|
|||
const { theme } = useTheme()
|
||||
let textarea: TextareaRenderable
|
||||
|
||||
useKeyboard((evt) => {
|
||||
if (evt.name === "return") {
|
||||
props.onConfirm?.(textarea.plainText)
|
||||
dialog.clear()
|
||||
}
|
||||
})
|
||||
|
||||
onMount(() => {
|
||||
dialog.setSize("large")
|
||||
setTimeout(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue