Skip to content

Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.

feat(web): float the Voice Mode call again from the window in the page

muterCef3550332965
diff --git a/apps/web/src/features/rooms/chat/voice-mode/voice-mode-mini-window.test.tsx b/apps/web/src/features/rooms/chat/voice-mode/voice-mode-mini-window.test.tsx
index 2d519ac6..8d6d48ca 100644
--- a/apps/web/src/features/rooms/chat/voice-mode/voice-mode-mini-window.test.tsx
+++ b/apps/web/src/features/rooms/chat/voice-mode/voice-mode-mini-window.test.tsx
@@ -17,7 +17,7 @@ import VoiceModeMiniWindow, {
sessionMessages,
} from "./voice-mode-mini-window";
import type { VoiceModeSession } from "./voice-mode-session";
-import { openVoicePip, resetVoicePipForTest } from "./voice-pip";
+import { closeVoicePip, openVoicePip, resetVoicePipForTest } from "./voice-pip";
const startedAt = "2026-10-02T03:00:00.000Z";
const message = (
@@ -309,6 +309,33 @@ describe("Voice Mode mini window", () => {
}
});
+ it("floats the call again from the window inside the page", async () => {
+ const fake = installFakeVoicePip();
+ try {
+ renderWindow();
+ await act(async () => {
+ fireEvent.click(
+ screen.getByRole("button", { name: "Float Voice Mode window" }),
+ );
+ await fake.requestWindow.mock.results[0]?.value;
+ });
+ await within(fake.document.body).findByRole("region", {
+ name: "Voice Mode window",
+ });
+ expect(fake.requestWindow).toHaveBeenCalledOnce();
+ expect(
+ screen.queryByRole("region", { name: "Voice Mode window" }),
+ ).not.toBeInTheDocument();
+ expect(voice.exit).not.toHaveBeenCalled();
+ // The page takes the window back before the test removes its frame.
+ act(() => closeVoicePip("voice-mode"));
+ } finally {
+ fake.frame.remove();
+ Reflect.deleteProperty(window, "documentPictureInPicture");
+ resetVoicePipForTest();
+ }
+ });
+
it("keeps the call when the desktop's back to tab button returns to the page", async () => {
const fake = installFakeVoicePip();
const focused = vi.spyOn(document, "hasFocus").mockReturnValue(true);
diff --git a/apps/web/src/features/rooms/chat/voice-mode/voice-mode-mini-window.tsx b/apps/web/src/features/rooms/chat/voice-mode/voice-mode-mini-window.tsx
index 40f75fdc..a636d372 100644
--- a/apps/web/src/features/rooms/chat/voice-mode/voice-mode-mini-window.tsx
+++ b/apps/web/src/features/rooms/chat/voice-mode/voice-mode-mini-window.tsx
@@ -4,6 +4,7 @@ import {
Mic01Icon,
MicOff01Icon,
Minimize01Icon,
+ PictureInPictureOnIcon,
RotateLeft01Icon,
VolumeHighIcon,
VolumeOffIcon,
@@ -39,8 +40,10 @@ import styles from "./voice-mode.module.css";
import { registerVoiceWindow, type VoiceWindowAction } from "./voice-ui-bridge";
import {
onVoicePipClosedByHuman,
+ openVoicePip,
returnedToOpener,
useVoicePip,
+ voicePipSupported,
} from "./voice-pip";
import { showVoiceNotice, useVoiceNotice } from "./voice-notice";
import {
@@ -315,6 +318,19 @@ function MiniWindow({
)}
</Button>
)}
+ {/* Back in the page, one click floats the call again; the browser
+ opens that window only from a click in the page. */}
+ {pip || !voicePipSupported() ? null : (
+ <Button
+ aria-label="Float Voice Mode window"
+ onClick={() => void openVoicePip("voice-mode")}
+ size="compactIcon"
+ title="Float over other tabs and apps"
+ tone="ghost"
+ >
+ <Icon icon={PictureInPictureOnIcon} size={16} />
+ </Button>
+ )}
{pip ? null : (
<Button
aria-label={
diff --git a/apps/web/src/features/rooms/chat/voice-mode/voice-pip.ts b/apps/web/src/features/rooms/chat/voice-mode/voice-pip.ts
index a62011b7..6b524e84 100644
--- a/apps/web/src/features/rooms/chat/voice-mode/voice-pip.ts
+++ b/apps/web/src/features/rooms/chat/voice-mode/voice-pip.ts
@@ -32,6 +32,11 @@ function api(): DocumentPictureInPicture | undefined {
).documentPictureInPicture;
}
+/** Whether this browser can float a voice window over other tabs and apps. */
+export function voicePipSupported() {
+ return api() !== undefined;
+}
+
function publish(next: typeof pip) {
pip = next;
for (const listener of listeners) listener();