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
+33 -1
View File
@@ -49,7 +49,18 @@ export function createSettingsView(rt) {
function renderSettingsView() {
const pane = h("div", { class: "settings" });
pane.append(
h("h1", { class: "settings-page-title", id: "detailTitle", tabindex: "-1", text: "Settings" }),
h(
"div",
{ class: "settings-head" },
h("h1", { class: "settings-page-title", id: "detailTitle", tabindex: "-1", text: "Settings" }),
h("button", {
id: "settingsRefresh",
class: "ghost settings-refresh",
type: "button",
text: "Refresh",
onclick: () => refreshSettingsStatus(),
}),
),
renderSettingsConnection(),
renderSettingsWorkspace(),
renderSettingsNotifications(),
@@ -261,6 +272,27 @@ function serverUrlSupportingText() {
* aria-invalid and the error tint) so an invalid Connect never needs a full
* re-render and the field being typed in is never rebuilt.
*/
/**
* Refresh the Settings page's live server facts. The page has no list to reload
* (its fields are local and its cards derive from the connection), so this sends
* the same ping the first connection uses and repaints the status card with the
* server's current build/time. It never reconnects or mutates a setting.
*/
async function refreshSettingsStatus() {
if (state.connection.kind === "connected") {
try {
const reply = await repo.ping();
state.serverProtocol = reply?.protocol ?? null;
state.serverBuild = reply?.build ?? null;
state.serverTime = reply?.time ?? null;
} catch {
// The connection card already carries the honest socket state; a ping
// failure must not replace it with a second, stale error line.
}
}
renderContent();
}
function refreshServerUrlError() {
const field = document.getElementById("settingsServerUrl");
const helper = document.getElementById("settingsUrlHelper");