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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user