fix: reduce DOM update frequency and make code selectable
Co-authored-by: aider (openai//models/qwen2.5-coder-32b-instruct-q4_k_m.gguf) <aider@aider.chat>
This commit is contained in:
@@ -44,6 +44,7 @@
|
|||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
|
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
|
user-select: text;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-content pre {
|
.markdown-content pre {
|
||||||
@@ -54,6 +55,7 @@
|
|||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
border: 1px solid #30363d;
|
border: 1px solid #30363d;
|
||||||
|
user-select: text;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-content pre code {
|
.markdown-content pre code {
|
||||||
@@ -809,7 +811,7 @@ async function handleStreamingResponse(userMessage) {
|
|||||||
// Debounce DOM updates to reduce stutter
|
// Debounce DOM updates to reduce stutter
|
||||||
let updateScheduled = false
|
let updateScheduled = false
|
||||||
let lastUpdate = Date.now()
|
let lastUpdate = Date.now()
|
||||||
const MIN_UPDATE_INTERVAL = 50 // ms, update at most every 50ms
|
const MIN_UPDATE_INTERVAL = 100 // ms, update at most every 100ms
|
||||||
|
|
||||||
function scheduleUpdate() {
|
function scheduleUpdate() {
|
||||||
if (updateScheduled) return
|
if (updateScheduled) return
|
||||||
|
|||||||
Reference in New Issue
Block a user