Skip to content

An agentic browser harness: an AI side panel & orb in your own logged-in Chrome, Edge, Arc, Brave or even Firefox run by the agent/subscription you already use (Claude Code, Codex, Antigravity). Free, open source, no API key. Also an MCP server.

feat(extension): detach the side panel into the hands-free mic, from a header button or /hands-free, folding the panel into it as it closes, and offered only where speech can be transcribed

Shahriarf0f34c4f5b94
diff --git a/src/extension/assets/globals.css b/src/extension/assets/globals.css
index b2ea018..17a3bf6 100644
--- a/src/extension/assets/globals.css
+++ b/src/extension/assets/globals.css
@@ -417,7 +417,50 @@
}
}
+/* The panel folding down into the hands-free mic before it closes. */
+@keyframes browsentic-fold {
+ to {
+ opacity: 0;
+ transform: scale(0.9) translateY(4%);
+ filter: blur(6px);
+ }
+}
+
+/* Appears as the panel starts to collapse, holds alone on the empty ground, then drops away. */
+@keyframes browsentic-detach-orb {
+ 0%,
+ 22% {
+ opacity: 0;
+ transform: scale(0.2);
+ }
+ 45% {
+ opacity: 1;
+ transform: scale(1.1);
+ }
+ 56% {
+ transform: scale(1);
+ }
+ 72% {
+ opacity: 1;
+ transform: scale(1);
+ animation-timing-function: cubic-bezier(0.7, 0, 0.84, 0);
+ }
+ 100% {
+ opacity: 0.3;
+ transform: translateY(170%) scale(0.85);
+ }
+}
+
@layer components {
+ .detaching > :not([data-detach-veil]) {
+ transform-origin: 50% 100%;
+ animation: browsentic-fold 0.34s cubic-bezier(0.7, 0, 0.84, 0) forwards;
+ }
+
+ .detach-orb {
+ animation: browsentic-detach-orb 0.56s var(--ease-out-expo) both;
+ }
+
[data-stream] .tok {
animation: browsentic-token 0.42s var(--ease-out-expo) both;
}
diff --git a/src/extension/components/composer.tsx b/src/extension/components/composer.tsx
index f04a972..4c545fe 100644
--- a/src/extension/components/composer.tsx
+++ b/src/extension/components/composer.tsx
@@ -31,6 +31,7 @@ export function Composer({
focus,
picking,
liveTools,
+ handsFree,
onToggleLiveTools,
onAttachSkill,
onCommand,
@@ -58,6 +59,8 @@ export function Composer({
focus: FocusedElement | null;
picking: boolean;
liveTools: boolean;
+ /** Whether `/hands-free` is offered — never where the browser cannot transcribe speech. */
+ handsFree: boolean;
onToggleLiveTools: () => void;
onAttachSkill: (skill: AttachedSkill | null) => void;
onCommand: (command: string) => void;
@@ -80,8 +83,8 @@ export function Composer({
const menuOpen = slash !== null && connected;
const [highlight, setHighlight] = useState(0);
const menuItems = useMemo(
- () => (menuOpen ? skillMenuItems(catalog, tabUrl, slash ?? '', tools) : []),
- [menuOpen, catalog, tabUrl, slash, tools],
+ () => (menuOpen ? skillMenuItems(catalog, tabUrl, slash ?? '', tools, { handsFree }) : []),
+ [menuOpen, catalog, tabUrl, slash, tools, handsFree],
);
useEffect(() => setHighlight(0), [slash]);
diff --git a/src/extension/components/detach-veil.tsx b/src/extension/components/detach-veil.tsx
new file mode 100644
index 0000000..d80ae7d
--- /dev/null
+++ b/src/extension/components/detach-veil.tsx
@@ -0,0 +1,12 @@
+import { Mic } from 'lucide-react';
+
+/** The mic the panel folds into on its way out — the same orb the page raises a moment later. */
+export function DetachVeil() {
+ return (
+ <div data-detach-veil className="pointer-events-none absolute inset-0 z-50 flex items-end justify-center pb-6">
+ <span className="detach-orb glow-brand flex size-14 items-center justify-center rounded-full border border-magenta/50 bg-ground-2 text-magenta">
+ <Mic className="size-5" />
+ </span>
+ </div>
+ );
+}
diff --git a/src/extension/components/skill-menu.tsx b/src/extension/components/skill-menu.tsx
index 008f8b7..e82ffd0 100644
--- a/src/extension/components/skill-menu.tsx
+++ b/src/extension/components/skill-menu.tsx
@@ -5,6 +5,9 @@ import { AGENTS } from '@/lib/agents/catalog';
import {
CONTEXT_COMMAND,
CONTEXT_COMMAND_DESCRIPTION,
+ HANDS_FREE_ALIASES,
+ HANDS_FREE_COMMAND,
+ HANDS_FREE_DESCRIPTION,
REMOVE_TOOLS_COMMAND,
REMOVE_TOOLS_DESCRIPTION,
} from '@/lib/bridge/commands';
@@ -28,6 +31,8 @@ export interface SkillMenuItem {
* was saved.
*/
savedToolId?: string;
+ /** Other spellings the filter matches, so a near miss still finds the command. */
+ aliases?: string[];
}
// Saved tools sort first: they are the only entries that do something on their own, and
@@ -46,6 +51,7 @@ export function skillMenuItems(
tabUrl: string,
query: string,
tools: readonly SavedToolMeta[] = [],
+ { handsFree = false }: { handsFree?: boolean } = {},
): SkillMenuItem[] {
const host = hostnameOf(tabUrl);
const items: SkillMenuItem[] = [
@@ -57,6 +63,16 @@ export function skillMenuItems(
command: CONTEXT_COMMAND,
},
];
+ if (handsFree) {
+ items.push({
+ key: 'command:hands-free',
+ group: 'command',
+ name: 'hands-free',
+ description: HANDS_FREE_DESCRIPTION,
+ command: HANDS_FREE_COMMAND,
+ aliases: HANDS_FREE_ALIASES,
+ });
+ }
if (tools.length) {
items.push({
key: 'command:remove-tools',
@@ -93,7 +109,10 @@ export function skillMenuItems(
const needle = query.trim().toLowerCase();
const matched = needle
? items.filter(
- (item) => item.name.toLowerCase().includes(needle) || item.description.toLowerCase().includes(needle),
+ (item) =>
+ item.name.toLowerCase().includes(needle) ||
+ item.description.toLowerCase().includes(needle) ||
+ item.aliases?.some((alias) => alias.includes(needle)),
)
: items;
return matched.sort((a, b) => GROUP_ORDER[a.group] - GROUP_ORDER[b.group] || a.name.localeCompare(b.name));
diff --git a/src/extension/entrypoints/sidepanel/App.tsx b/src/extension/entrypoints/sidepanel/App.tsx
index c6edc7a..be1170a 100644
--- a/src/extension/entrypoints/sidepanel/App.tsx
+++ b/src/extension/entrypoints/sidepanel/App.tsx
@@ -1,15 +1,16 @@
import { useEffect, useMemo, useRef, useState } from 'react';
-import { ArrowDown, PanelRightClose, SquarePen } from 'lucide-react';
+import { ArrowDown, PanelRightClose, PictureInPicture2, SquarePen } from 'lucide-react';
import { browser } from 'wxt/browser';
import { invokeInActiveTab } from '@/lib/actions/client';
-import { isRemoveToolsCommand } from '@/lib/bridge/commands';
+import { isHandsFreeCommand, isRemoveToolsCommand } from '@/lib/bridge/commands';
import { getPageInfo } from '@/lib/actions/page/get-page-info';
import { BRIDGE_CHANNEL, type FocusedElement } from '@/lib/actions/protocol';
import { MAX_STORED_FILE_BYTES } from '@/lib/files/report';
import { Wordmark } from '@/extension/components/brand';
import { Composer, type AttachedSkill } from '@/extension/components/composer';
import { ConnectionSheet } from '@/extension/components/connection-sheet';
+import { DetachVeil } from '@/extension/components/detach-veil';
import { DropMask } from '@/extension/components/drop-mask';
import { Greeting } from '@/extension/components/greeting';
import { MonitorBar } from '@/extension/components/monitor-bar';
@@ -34,6 +35,7 @@ import { useActiveTabUrl } from '@/lib/bridge/use-active-tab-url';
import { useDaemonState } from '@/lib/bridge/use-daemon-state';
import { useFileDrop } from '@/lib/bridge/use-file-drop';
import { closeSidePanel } from '@/lib/bridge/side-panel';
+import { startHandsFree } from '@/lib/bridge/panel-view';
import { usePanelCollapsed, usePanelTab } from '@/lib/bridge/use-panel-view';
import { useRun } from '@/lib/bridge/use-run';
import { useStoredFiles } from '@/lib/bridge/use-stored-files';
@@ -41,14 +43,21 @@ import { useStoredRecordings } from '@/lib/bridge/use-stored-recordings';
import { useStoredSessions } from '@/lib/bridge/use-stored-sessions';
import { useStoredSkills } from '@/lib/bridge/use-stored-skills';
import { useVoiceComposer } from '@/lib/bridge/use-voice-composer';
-import { useVoiceEnabled } from '@/lib/bridge/use-speech';
+import { useHandsFreeSupported, useVoiceEnabled } from '@/lib/bridge/use-speech';
+import { cn } from '@/lib/utils';
const PINNED_SLACK_PX = 56;
+/** Long enough to watch the panel fold into the mic; the panel then closes and the page’s own mic rises. */
+const DETACH_MS = 560;
+
+const DETACH_STUCK_MS = 1_500;
+
export default function App() {
const daemon = useDaemonState();
const run = useRun();
const [voiceEnabled, setVoiceEnabled] = useVoiceEnabled();
+ const handsFree = useHandsFreeSupported();
const storedFiles = useStoredFiles();
const sessions = useStoredSessions();
const recordings = useStoredRecordings();
@@ -66,6 +75,7 @@ export default function App() {
const viewport = useRef<HTMLDivElement>(null);
const windowId = useRef<number | null>(null);
const [pinned, setPinned] = useState(true);
+ const [detaching, setDetaching] = useState(false);
const connected = daemon?.connected ?? false;
const files = useMemo(
@@ -84,6 +94,10 @@ export default function App() {
const voice = useVoiceComposer({
active: voiceEnabled && connected && !run.running,
onSubmit: (text) => {
+ if (handsFree && isHandsFreeCommand(text)) {
+ detach();
+ return;
+ }
run.send(text, { agentSkillId: attachedSkill?.id, focus: focus ?? undefined, liveTools });
setAttachedSkill(null);
setFocus(null);
@@ -141,7 +155,34 @@ export default function App() {
void closeSidePanel(windowId.current);
}
+ /**
+ * A side panel cannot be shrunk, only closed, so detaching is a close dressed as a fold: the
+ * panel collapses into a mic at its foot and drops away, and the page’s own mic rises from
+ * the bottom once the panel is gone. Firefox closes its sidebar only inside the click’s
+ * gesture, so it skips the fold and goes at once.
+ */
+ function detach() {
+ if (detaching || !handsFree) return;
+ setConnectionOpen(false);
+ voice.setInput('');
+ if (import.meta.env.FIREFOX) {
+ void startHandsFree();
+ void closeSidePanel(windowId.current);
+ return;
+ }
+ setDetaching(true);
+ window.setTimeout(() => {
+ void startHandsFree();
+ void closeSidePanel(windowId.current);
+ }, DETACH_MS);
+ window.setTimeout(() => setDetaching(false), DETACH_MS + DETACH_STUCK_MS);
+ }
+
function handleSend() {
+ if (handsFree && isHandsFreeCommand(voice.input)) {
+ detach();
+ return;
+ }
if (run.running || !connected) return;
open('chat');
voice.submitNow();
@@ -220,7 +261,7 @@ export default function App() {
const counts = { history: sessions.length, skills: skills.length, recordings: recordings.length };
return (
- <div className="relative flex h-screen flex-col">
+ <div className={cn('relative flex h-screen flex-col', detaching && 'detaching')}>
<header className="flex shrink-0 items-center gap-2 px-3 py-2.5">
<Wordmark className="flex-1" />
<StatusPill
@@ -242,6 +283,17 @@ export default function App() {
>
<SquarePen className="size-3.5" />
</Button>
+ {handsFree && (
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ title="Detach — go hands-free with a mic on the page"
+ aria-label="Detach into a hands-free mic on the page"
+ onClick={detach}
+ >
+ <PictureInPicture2 className="size-3.5" />
+ </Button>
+ )}
<Button
variant="ghost"
size="icon-sm"
@@ -367,7 +419,12 @@ export default function App() {
liveTools={liveTools}
onToggleLiveTools={() => setLiveTools((on) => !on)}
onAttachSkill={setAttachedSkill}
+ handsFree={handsFree}
onCommand={(command) => {
+ if (handsFree && isHandsFreeCommand(command)) {
+ detach();
+ return;
+ }
if (isRemoveToolsCommand(command)) {
setShowTools(true);
return;
@@ -394,6 +451,7 @@ export default function App() {
)}
{dragging && <DropMask connected={connected} maxBytes={MAX_STORED_FILE_BYTES} />}
+ {detaching && <DetachVeil />}
</div>
);
}
diff --git a/src/lib/bridge/commands.test.ts b/src/lib/bridge/commands.test.ts
new file mode 100644
index 0000000..ac8582d
--- /dev/null
+++ b/src/lib/bridge/commands.test.ts
@@ -0,0 +1,15 @@
+import { describe, expect, it } from 'vitest';
+import { isHandsFreeCommand } from './commands';
+
+describe('isHandsFreeCommand', () => {
+ it('takes the command and the spellings people reach for', () => {
+ for (const typed of ['/hands-free', '/hand-free', '/handsfree', ' /Hands-Free ']) {
+ expect(isHandsFreeCommand(typed)).toBe(true);
+ }
+ });
+
+ it('leaves an instruction that merely mentions it alone', () => {
+ expect(isHandsFreeCommand('/hands-free please')).toBe(false);
+ expect(isHandsFreeCommand('hands-free')).toBe(false);
+ });
+});
diff --git a/src/lib/bridge/commands.ts b/src/lib/bridge/commands.ts
index bfbe27c..7a7f728 100644
--- a/src/lib/bridge/commands.ts
+++ b/src/lib/bridge/commands.ts
@@ -11,6 +11,17 @@ export const REMOVE_TOOLS_DESCRIPTION = 'Review the tools you saved, and delete
export const isRemoveToolsCommand = (text: string): boolean =>
text.trim().toLowerCase() === REMOVE_TOOLS_COMMAND;
+export const HANDS_FREE_COMMAND = '/hands-free';
+
+export const HANDS_FREE_ALIASES = ['hand-free', 'handsfree'];
+
+export const HANDS_FREE_DESCRIPTION = 'Put the panel away and talk to the page — a floating mic you can drag anywhere.';
+
+export const isHandsFreeCommand = (text: string): boolean => {
+ const typed = text.trim().toLowerCase();
+ return typed === HANDS_FREE_COMMAND || HANDS_FREE_ALIASES.some((alias) => typed === `/${alias}`);
+};
+
export const CONTEXT_COMMAND_DESCRIPTION =
'See what this conversation carries — messages, files, recordings, tabs.';