web: make the Settings Refresh reload the page
This commit is contained in:
+1
-1
@@ -168,7 +168,7 @@ to it, but the server never lists it and a reload drops it.
|
||||
| B12 | One detail header, optimistic sends, thinking above the bubble | — | done — every non-chat detail (pipeline, run, template) now extracts its own `#detailTitle` into a shared `.detail-head` with the same 44px chevron Back control; on phones the button and title are vertically centred, and on wide screens the back control is hidden while the title stays in the header. Chat/create already use the same control. Sending now appends the operator's optimistic user turn immediately (using the native message id OpenCode persists), so the running placeholder cannot appear before their message. While a turn runs, Send stays present beside Stop; a follow-up is queued. The reasoning/thinking block moved outside and above the answer bubble, like the tool summary below it. |
|
||||
| B11 | Enter composes; live shell bars stay in place | — | done — Enter now inserts a newline (a real CDP Enter produced `first\n` and no prompt), while Ctrl/Cmd+Enter sends; a slash draft still runs its command on Enter. The chat star reserves a 26px corner in the row head, so it no longer covers Streaming/New/Idle. Background-shell frames patch the tasks bar in place instead of full-rendering the pane, keeping the composer mounted. The shell cache was bumped to v2 so an installed PWA picks up these client changes. |
|
||||
| B10 | Chat titles are shared across devices | `chat_rename` | done — the rename dialog writes the title to the server's operator-session registry (`SetOperatorSessionTitle`) instead of a device-local override. `chat_sessions` already prefers that title, so a second browser opened with a fresh profile showed `Shared rename probe` without any local storage; restoring it to `New chat` did the same. Old local titles are uploaded once on the next list load and then removed. The helper now reads `This name is shared with every device.` |
|
||||
| B9 | Scroll intent, stable overlays and a Settings refresh | — | done — a touch/pointer scroll now marks operator intent, so scrolling up during streaming is not snapped back by the next frame (verified: scrollTop stayed at the top while a synthetic text frame arrived). Open rename/close dialogs are marked `data-modal-stable`; the modal controller keeps the mounted panel, focus, typed value and selection across streaming re-renders, so the rename no longer blinks/reappears and its `modal-in` animation runs once. Bursts of chat frames are coalesced to one paint per animation frame. Settings gained a `Refresh` action that pings the server and repaints the build/time card. |
|
||||
| B9 | Scroll intent, stable overlays and a Settings refresh | — | done — a touch/pointer scroll now marks operator intent, so scrolling up during streaming is not snapped back by the next frame (verified: scrollTop stayed at the top while a synthetic text frame arrived). Open rename/close dialogs are marked `data-modal-stable`; the modal controller keeps the mounted panel, focus, typed value and selection across streaming re-renders, so the rename no longer blinks/reappears and its `modal-in` animation runs once. Bursts of chat frames are coalesced to one paint per animation frame. Settings gained a `Refresh` action that reloads the web page. |
|
||||
| B8 | Composer keeps focus and the running line stays stable | — | done — a live frame re-renders the transcript, so the composer now captures and restores its focus, value and selection (verified in a real browser: a synthetic `chat_event` arrived while the caret sat at 8–14 and the input stayed focused with the same value/selection). The running indicator is one ellipsised line that updates in place for the longest-running tool instead of adding/removing a line per call; measured height stayed 52px across tool start/finish until the step ended. Pipeline-list miniatures are right-aligned at the row's trailing edge. |
|
||||
| B7 | Chat detail is a real history entry with a compact Back | `/chat/:id` | done — opening a session pushes `/chat/:id`, so Android's back gesture/browser Back returns to the chat list instead of the previous destination. The conversation header now owns a 32px back control matching the create pane (the full-width "Back to list" row is gone for chat; it remains on the other detail panes). Verified at 390×844: the header control reads `Back to chats`, the URL changes to `/chat/ses_…`, pressing it returns to `/chat` with the list restored, and `history.back()` from a reopened chat does the same. |
|
||||
| B6 | Agent questions are answerable in the browser | `chat_event` (`form`), `chat_answer` | done — OpenCode's question tool pauses inside a `form.created` event; the broker now maps `form.created` / `form.replied` / `form.cancelled` to a `form` chat_event, the browser renders a question card with the form's options and free-text fields, and `chat_answer` posts the field-keyed answer to `/api/session/{id}/form/{id}/reply`. A question for a backgrounded chat also raises the existing browser notification. Verified end to end with a real model turn: the card appeared with a `Demo colour` field, selecting Red and pressing `Send answer` cleared it and the same turn completed with "You chose Red for the demo."; the OpenCode form normalizer is unit-tested. |
|
||||
|
||||
@@ -58,7 +58,7 @@ function renderSettingsView() {
|
||||
class: "ghost settings-refresh",
|
||||
type: "button",
|
||||
text: "Refresh",
|
||||
onclick: () => refreshSettingsStatus(),
|
||||
onclick: () => window.location.reload(),
|
||||
}),
|
||||
),
|
||||
renderSettingsConnection(),
|
||||
@@ -272,27 +272,6 @@ 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");
|
||||
|
||||
Reference in New Issue
Block a user