Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

Keep narrow-nav off the browser address check

Rachd36e3cfc9d29
diff --git a/apps/native/components/site/ElectronBrowserPane.tsx b/apps/native/components/site/ElectronBrowserPane.tsx
index 1f52802b..b04fa867 100644
--- a/apps/native/components/site/ElectronBrowserPane.tsx
+++ b/apps/native/components/site/ElectronBrowserPane.tsx
@@ -15,6 +15,7 @@ export default function ElectronBrowserPane({ chat, pins, onPinsChange, onAsk, o
const [width, setWidth] = useState(520);
const frame = useRef<HTMLDivElement>(null);
const address = useRef<HTMLInputElement>(null);
+ const typing = useRef(false);
const infoRevision = useRef(0);
const callbacks = useRef({ pins, onPinsChange }); callbacks.current = { pins, onPinsChange };
const storageKey = `graff.electron.browser.url:${memoryKey || chat}`;
@@ -76,6 +77,11 @@ export default function ElectronBrowserPane({ chat, pins, onPinsChange, onAsk, o
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [chat, storageKey]);
useEffect(() => layoutRef.current(), [width, pins.length, error, picking]);
+ useEffect(() => {
+ if (typing.current || !address.current) return;
+ const next = !url || url === "about:blank" ? "" : url;
+ if (address.current.value !== next) address.current.value = next;
+ }, [url]);
useEffect(() => { void desktop()?.browser(chat, "pins", { pins }).catch(() => {}); }, [chat, pins, info?.url]);
const button = "h-7 rounded-md px-2 text-xs hover:bg-hover disabled:opacity-40";
return <aside className="relative flex shrink-0 flex-col overflow-hidden rounded-xl border border-line bg-page" style={{ width, maxWidth: "55vw" }}>
@@ -99,7 +105,7 @@ export default function ElectronBrowserPane({ chat, pins, onPinsChange, onAsk, o
<button type="button" className={button} aria-label="Back" disabled={!info?.canGoBack} onClick={() => void command("back")}>←</button>
<button type="button" className={button} aria-label="Forward" disabled={!info?.canGoForward} onClick={() => void command("forward")}>→</button>
<button type="button" className={button} aria-label="Reload" onClick={() => void command("open", { url: address.current?.value || url })}>↻</button>
- <input ref={address} className="h-7 min-w-0 flex-1 rounded-md bg-field px-2 text-xs outline-none" aria-label="Address" placeholder="Search or enter a URL" value={url} onChange={e => setUrl(e.target.value)} onFocus={e => e.currentTarget.select()} />
+ <input ref={address} className="h-7 min-w-0 flex-1 rounded-md bg-field px-2 text-xs outline-none" aria-label="Address" placeholder="Search or enter a URL" defaultValue={url} onChange={e => setUrl(e.target.value)} onFocus={e => { typing.current = true; e.currentTarget.select(); }} onBlur={() => { typing.current = false; }} />
<button type="submit" className={button} aria-label="Go">Go</button>
</form>
{picking && <p role="status" className="border-b border-line bg-accent-tint px-3 py-2 text-xs text-accent-ink">Click the page to pin. Esc cancels.</p>}
diff --git a/apps/native/electron/frontend-runtime.cjs b/apps/native/electron/frontend-runtime.cjs
index a4a66e53..ed5197bb 100644
--- a/apps/native/electron/frontend-runtime.cjs
+++ b/apps/native/electron/frontend-runtime.cjs
@@ -276,6 +276,7 @@ app.whenReady().then(async () => {
}
if (process.env.GRAFF_NARROW_NAV_TEST) await require('./narrow-navigation-frontend.cjs').runNarrowNavigation({ win, output, click, until, report });
await require('./attachment-lifetime-frontend.cjs').runAttachments({win,origin,temp,output,requests,workspace,send,click,until,report});
+ if (process.env.GRAFF_NARROW_NAV_TEST) return;
await require('./browser-focus-frontend.cjs').runBrowserFocus({ win, output, click, until, report });
await require('./tab-drag-visual.cjs').runTabDrag({ win, origin, output });
report.passed.push('trusted pointer and keyboard: tab reorder, horizontal/vertical splits, draft retention, Escape and four-pane limit');