web: keep chat stable while streaming and refresh Settings

Preserve scroll intent for touch scrolling, coalesce live frames into one paint,
keep stable dialogs mounted across re-renders, and add a Settings refresh that
pings the server for a fresh build/time card.
This commit is contained in:
2026-10-20 03:35:45 +01:00
parent d5cda887ee
commit 4072698731
5 changed files with 82 additions and 4 deletions
+10
View File
@@ -389,6 +389,16 @@ export function createModalController(options = {}) {
entry.options = { ...entry.options, ...staged.options };
if (entry.trigger == null && staged.trigger) entry.trigger = staged.trigger;
if (entry.panel === staged.panel) return false;
// A stable dialog keeps its mounted panel across streaming re-renders. A
// rebuild would restart the modal-in animation (the rename dialog visibly
// blinked/reappeared on every chat frame) and discard whatever the operator
// had typed into it.
if (
entry.panel?.getAttribute?.("data-modal-stable") === "true" &&
staged.panel?.getAttribute?.("data-modal-stable") === "true"
) {
return false;
}
const remembered = rememberFocus(entry.panel);
const oldPanel = entry.panel;
if (typeof oldPanel.replaceWith === "function" && oldPanel.parentElement) {