feat: add quote mode options

This commit is contained in:
Shantur Rathore
2025-12-08 10:45:12 +00:00
parent 710938eef8
commit 67ff00d83e
4 changed files with 77 additions and 35 deletions

View File

@@ -38,7 +38,7 @@ export const SessionView: Component<SessionViewProps> = (props) => {
return getSessionBusyStatus(props.instanceId, currentSession.id)
})
let scrollToBottomHandle: (() => void) | undefined
let quoteHandler: ((text: string) => void) | null = null
let quoteHandler: ((text: string, mode: "quote" | "code") => void) | null = null
createEffect(() => {
const currentSession = session()
@@ -47,7 +47,7 @@ export const SessionView: Component<SessionViewProps> = (props) => {
}
})
function registerQuoteHandler(handler: (text: string) => void) {
function registerQuoteHandler(handler: (text: string, mode: "quote" | "code") => void) {
quoteHandler = handler
return () => {
if (quoteHandler === handler) {
@@ -56,9 +56,9 @@ export const SessionView: Component<SessionViewProps> = (props) => {
}
}
function handleQuoteSelection(text: string) {
function handleQuoteSelection(text: string, mode: "quote" | "code") {
if (quoteHandler) {
quoteHandler(text)
quoteHandler(text, mode)
}
}