graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
Python
fix(native): shorten the saved-conversation footer
justrach6fd0526e6b65
diff --git a/apps/native/components/site/SavedCacheCheck.tsx b/apps/native/components/site/SavedCacheCheck.tsxindex e8002755..4fca1845 100644--- a/apps/native/components/site/SavedCacheCheck.tsx+++ b/apps/native/components/site/SavedCacheCheck.tsx@@ -2,8 +2,9 @@import { useCallback, useEffect, useRef, useState } from "react";import { checkSavedCache, formatSaveSize, type CacheCheck } from "@/lib/saved-cache-check";-export default function SavedCacheCheck({ name, cwd, model, disabled, onContinue }: {+export default function SavedCacheCheck({ name, cwd, model, disabled, onContinue, onRefresh, refreshing }: {name: string; cwd?: string; model?: string; disabled: boolean; onContinue: () => void;+ onRefresh?: () => void; refreshing?: boolean;}) {const key = JSON.stringify([name, cwd, model]);const pending = useRef<AbortController | null>(null);@@ -18,7 +19,7 @@ export default function SavedCacheCheck({ name, cwd, model, disabled, onContinueconst same = JSON.stringify(result) === JSON.stringify(previous);setState({key, result, busy: false,- note: previous ? (same ? "Rechecked — same as before." : "Rechecked — this changed.") : undefined,+ note: previous ? "Rechecked" : undefined,});if (continueAfter && same) onContinue();} catch {@@ -32,16 +33,14 @@ export default function SavedCacheCheck({ name, cwd, model, disabled, onContinue}, [key]);const current = state.key === key ? state : { key, busy: true };const size = formatSaveSize(current.result?.bytes);- return <div data-saved-cache-check className="mt-1">- <p role="status" className="font-medium text-ink">{current.busy ? (current.note ?? "Checking saved cache compatibility…") : current.error ? "Prompt cache check unavailable" : current.result?.summary}</p>- {current.note && !current.busy && <p className="mt-1">{current.note}</p>}- {current.result && !current.busy && <p className="mt-1">{current.result.next}</p>}- {current.result && <details className="mt-1">- <summary className="cursor-pointer">Check details</summary>- <ul className="mt-1 list-disc pl-4">{current.result.reasons.map(reason => <li key={reason}>{reason}</li>)}</ul>- </details>}- {current.error && <p role="alert" className="mt-1 text-red">Could not read the save. Retry before continuing.</p>}- <div className="mt-2 flex gap-2">+ const line = current.busy ? (current.note ?? "Checking…")+ : current.error ? "Could not check cache"+ : current.note ?? (current.result?.status === "changed" ? "Cache at risk" : "Cache unverified");+ return <div data-saved-cache-check className="mt-2">+ <p role="status">{line}</p>+ {current.error && <p role="alert" className="mt-1 text-red">Retry before continuing.</p>}+ <div className="mt-2 flex flex-wrap gap-2">+ {onRefresh && <button type="button" data-refresh-snapshot disabled={disabled || refreshing} onClick={onRefresh} className="rounded-control px-3 py-1.5 hover:bg-hover disabled:opacity-50">{refreshing ? "Refreshing…" : "Refresh snapshot"}</button>}<button type="button" disabled={disabled || current.busy} onClick={() => void run(false, current.result)} className="rounded-control px-3 py-1.5 hover:bg-hover disabled:opacity-50">Recheck cache</button><button type="button" data-continue-snapshot disabled={disabled || current.busy || !current.result} onClick={() => void run(true, current.result)} className="rounded-control bg-hover-2 px-3 py-1.5 text-ink disabled:opacity-50">{size ? `Continue here · ${size}` : "Continue here"}diff --git a/apps/native/components/site/SavedSnapshot.tsx b/apps/native/components/site/SavedSnapshot.tsxindex c8d1fd8b..60c16da7 100644--- a/apps/native/components/site/SavedSnapshot.tsx+++ b/apps/native/components/site/SavedSnapshot.tsx@@ -27,11 +27,7 @@ export default function SavedSnapshot({ name, cwd, model, onRefresh, onContinue};return <section data-saved-snapshot data-session-snapshot aria-label="Saved conversation snapshot" className="border-t border-line px-1 py-2 text-[12px] text-ink-2"><p role="status" className="font-medium text-ink">Saved conversation · Live REPL status unknown</p>- <p className="mt-1">This view is not attached to a live REPL. Continue here uses this save without stopping it.</p>- {error && <p role="alert" className="mt-2 text-red">Could not refresh the snapshot. Try again.</p>}- <div className="mt-1 flex flex-wrap gap-2">- <button type="button" data-refresh-snapshot disabled={refreshing} onClick={() => void refresh()} className="rounded-control px-3 py-1.5 hover:bg-hover disabled:opacity-50">{refreshing ? "Refreshing…" : "Refresh snapshot"}</button>- </div>- <SavedCacheCheck name={name} cwd={cwd} model={model} disabled={refreshing} onContinue={onContinue} />+ {error && <p role="alert" className="mt-1 text-red">Could not refresh.</p>}+ <SavedCacheCheck name={name} cwd={cwd} model={model} disabled={refreshing} onContinue={onContinue} onRefresh={() => void refresh()} refreshing={refreshing} /></section>;}