fix(browser): reveal panel for agent captures

Fixes #3175
This commit is contained in:
Bohdan Triapitsyn
2026-08-28 14:06:43 +03:00
parent 262397f896
commit 3f3d942aab
2 changed files with 47 additions and 5 deletions
@@ -452,13 +452,12 @@ export const ContextPanel: React.FC = () => {
// Lets an agent's browser.open create the tab it needs when none is open yet.
// Registered from the panel because opening a tab is panel state, not
// something the browser view itself can do before it exists. Background on
// purpose: an agent working a page must not pop the panel open (or steal
// the active surface) under the user — the tab mounts invisibly, and the
// rail is where the user opens it when curious.
// something the browser view itself can do before it exists. Reveal the
// panel so Electron gives the webview a composited surface; capturePage()
// cannot capture the zero-width webview inside a closed panel.
React.useEffect(() => {
if (!effectiveDirectory) return;
return registerBrowserOpener((url) => openContextBrowser(effectiveDirectory, url, { reveal: false }));
return registerBrowserOpener((url) => openContextBrowser(effectiveDirectory, url));
}, [effectiveDirectory, openContextBrowser]);
const reorderContextPanelTabs = useUIStore((state) => state.reorderContextPanelTabs);
const setSelectedFilePath = useFilesViewTabsStore((state) => state.setSelectedPath);