From 8d93f2f1f9aefd1d273e0b838088c26bdf4e02e2 Mon Sep 17 00:00:00 2001 From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com> Date: Sat, 27 Jun 2026 09:26:37 -0400 Subject: [PATCH] fix: follow up prompt preservation changes (#292) * fix: remove unused disabled prop, throttle SW update checks, precache icon * fix: retract transient send error and restored prompt once server confirms send When a long-running prompt request drops (gateway timeout or network error) while the agent is actually working, the send error banner and the restored prompt text were left in place. Tag send errors as 'network' and clear them when the server confirms session activity (message.updated / session.idle), also clearing the restored input text. Genuine server-reported session errors (kind 'session') are preserved. * style: restyle ErrorBanner with neutral card fill and destructive accent bar Replace the all-red destructive Alert variant (transparent background, full red text) with a neutral card-filled banner, a left destructive accent bar, red icon, foreground title, and muted body/detail text. Improves the send-error and git-error banners on the dark theme. --- frontend/plugins/sw-precache-manifest.ts | 7 +- .../src/components/agent/AgentQuickSelect.tsx | 5 +- .../message/PromptInput.stt.test.tsx | 38 +++++- .../src/components/message/PromptInput.tsx | 32 ++--- frontend/src/components/ui/error-banner.tsx | 13 +- frontend/src/hooks/useOpenCode.ts | 2 +- frontend/src/hooks/useSSE.test.tsx | 117 ++++++++++++++++++ frontend/src/hooks/useSSE.ts | 2 + frontend/src/lib/serviceWorker.ts | 4 + frontend/src/stores/sendErrorStore.test.ts | 14 +++ frontend/src/stores/sendErrorStore.ts | 12 +- 11 files changed, 215 insertions(+), 31 deletions(-) diff --git a/frontend/plugins/sw-precache-manifest.ts b/frontend/plugins/sw-precache-manifest.ts index 31cac5ff..c41d7f26 100644 --- a/frontend/plugins/sw-precache-manifest.ts +++ b/frontend/plugins/sw-precache-manifest.ts @@ -5,7 +5,12 @@ import type { Plugin } from "vite"; const SW_FILENAME = "sw.js"; const PRECACHE_DIR_PREFIXES = ["assets/"]; -const PRECACHE_ROOT_FILES = ["index.html", "manifest.json", "favicon.svg"]; +const PRECACHE_ROOT_FILES = [ + "index.html", + "manifest.json", + "favicon.svg", + "icons/icon-192x192.png", +]; async function collectFiles(dir: string, base = dir): Promise { const entries = await readdir(dir, { withFileTypes: true }); diff --git a/frontend/src/components/agent/AgentQuickSelect.tsx b/frontend/src/components/agent/AgentQuickSelect.tsx index 2943fe67..26fcc2b3 100644 --- a/frontend/src/components/agent/AgentQuickSelect.tsx +++ b/frontend/src/components/agent/AgentQuickSelect.tsx @@ -17,7 +17,6 @@ interface AgentQuickSelectProps { currentAgent: string onAgentChange: (agent: string) => void isBashMode?: boolean - disabled?: boolean } interface AgentInfo { @@ -55,7 +54,6 @@ export function AgentQuickSelect({ currentAgent, onAgentChange, isBashMode = false, - disabled = false, }: AgentQuickSelectProps) { const { data: agents = [] } = useAgents(opcodeUrl, directory) @@ -79,7 +77,6 @@ export function AgentQuickSelect({ const buttonContent = (