feat(ui): add runtime logger and replace console usage

This commit is contained in:
Shantur Rathore
2025-12-05 15:07:49 +00:00
parent 49143bd049
commit 971abe24d7
44 changed files with 406 additions and 138 deletions

View File

@@ -10,6 +10,9 @@ import Kbd from "./kbd"
import { getActiveInstance } from "../stores/instances"
import { agents, getSessionDraftPrompt, setSessionDraftPrompt, clearSessionDraftPrompt } from "../stores/sessions"
import { showAlertDialog } from "../stores/alerts"
import { getLogger } from "../lib/logger"
const log = getLogger("actions")
interface PromptInputProps {
instanceId: string
@@ -563,7 +566,7 @@ export default function PromptInput(props: PromptInputProps) {
})
setHistoryIndex(-1)
} catch (historyError) {
console.error("Failed to update prompt history:", historyError)
log.error("Failed to update prompt history:", historyError)
}
}
@@ -586,7 +589,7 @@ export default function PromptInput(props: PromptInputProps) {
}
void refreshHistory()
} catch (error) {
console.error("Failed to send message:", error)
log.error("Failed to send message:", error)
showAlertDialog("Failed to send message", {
title: "Send failed",
detail: error instanceof Error ? error.message : String(error),