@@ -4,7 +4,7 @@ import { useRoute } from "@tui/context/route"
44import { useSync } from "@tui/context/sync"
55import { createMemo , createSignal , createResource , onMount , Show } from "solid-js"
66import { Locale } from "@/util/locale"
7- import { Keybind } from "@/util /keybind"
7+ import { useKeybind } from "../context /keybind"
88import { useTheme } from "../context/theme"
99import { useSDK } from "../context/sdk"
1010import { DialogSessionRename } from "./dialog-session-rename"
@@ -14,9 +14,10 @@ import "opentui-spinner/solid"
1414
1515export function DialogSessionList ( ) {
1616 const dialog = useDialog ( )
17+ const route = useRoute ( )
1718 const sync = useSync ( )
19+ const keybind = useKeybind ( )
1820 const { theme } = useTheme ( )
19- const route = useRoute ( )
2021 const sdk = useSDK ( )
2122 const kv = useKV ( )
2223
@@ -29,8 +30,6 @@ export function DialogSessionList() {
2930 return result . data ?? [ ]
3031 } )
3132
32- const deleteKeybind = "ctrl+d"
33-
3433 const currentSessionID = createMemo ( ( ) => ( route . data . type === "session" ? route . data . sessionID : undefined ) )
3534
3635 const spinnerFrames = [ "⠋" , "⠙" , "⠹" , "⠸" , "⠼" , "⠴" , "⠦" , "⠧" , "⠇" , "⠏" ]
@@ -52,7 +51,7 @@ export function DialogSessionList() {
5251 const status = sync . data . session_status ?. [ x . id ]
5352 const isWorking = status ?. type === "busy"
5453 return {
55- title : isDeleting ? `Press ${ deleteKeybind } again to confirm` : x . title ,
54+ title : isDeleting ? `Press ${ keybind . print ( "session_delete" ) } again to confirm` : x . title ,
5655 bg : isDeleting ? theme . error : undefined ,
5756 value : x . id ,
5857 category,
@@ -89,7 +88,7 @@ export function DialogSessionList() {
8988 } }
9089 keybind = { [
9190 {
92- keybind : Keybind . parse ( deleteKeybind ) [ 0 ] ,
91+ keybind : keybind . all . session_delete ?. [ 0 ] ,
9392 title : "delete" ,
9493 onTrigger : async ( option ) => {
9594 if ( toDelete ( ) === option . value ) {
@@ -103,7 +102,7 @@ export function DialogSessionList() {
103102 } ,
104103 } ,
105104 {
106- keybind : Keybind . parse ( "ctrl+r" ) [ 0 ] ,
105+ keybind : keybind . all . session_rename ?. [ 0 ] ,
107106 title : "rename" ,
108107 onTrigger : async ( option ) => {
109108 dialog . replace ( ( ) => < DialogSessionRename session = { option . value } /> )
0 commit comments