Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(calls): let viewers maximize a screen share (#9906)

Eric Hayes77df1af6176e
diff --git a/apps/web/src/features/channel/Call/CallOverlay.tsx b/apps/web/src/features/channel/Call/CallOverlay.tsx
index e5873e47d9..4b1a773a1e 100644
--- a/apps/web/src/features/channel/Call/CallOverlay.tsx
+++ b/apps/web/src/features/channel/Call/CallOverlay.tsx
@@ -15,6 +15,8 @@ import { virtualKeyboardVisible } from '@core/mobile/virtualKeyboard';
import { getDisplayName, tryMacroId } from '@core/user';
import { fireAndForget } from '@core/util/fireAndForget';
import ChatIcon from '@icon/system/regular/chat-circle.svg';
+import CornersInIcon from '@icon/system/regular/corners-in.svg';
+import CornersOutIcon from '@icon/system/regular/corners-out.svg';
import UsersIcon from '@icon/system/regular/users.svg';
import { Button, cn } from '@ui';
import type { RemoteParticipant, Track } from 'livekit-client';
@@ -488,6 +490,13 @@ export function CallOverlay(props: {
const hasAnyScreenShare = () =>
callCtx.isScreenSharing() || remoteScreenShares().length > 0;
+ const [screenShareMaximized, setScreenShareMaximized] = createSignal(false);
+ const showScreenShare = () => hasAnyScreenShare() && !focusedParticipant();
+ const maximizeLabel = () =>
+ screenShareMaximized()
+ ? t('calls.restoreScreenShare')
+ : t('calls.maximizeScreenShare');
+
const gridCols = () => {
if (focusedParticipant() && focusedParticipant() !== 'local')
return 'grid-cols-1';
@@ -556,7 +565,22 @@ export function CallOverlay(props: {
class="flex-1 min-h-0 pt-2"
classList={{ hidden: !!focusedParticipant() }}
>
- <div class="h-full rounded-lg overflow-hidden bg-surface-2 flex items-center justify-center">
+ <div class="relative h-full rounded-lg overflow-hidden bg-surface-2 flex items-center justify-center">
+ <Button
+ class="absolute right-2 top-2 z-10"
+ variant="secondary"
+ size="icon-sm"
+ aria-label={maximizeLabel()}
+ tooltip={{ content: maximizeLabel(), placement: 'left' }}
+ onClick={() => setScreenShareMaximized((value) => !value)}
+ >
+ <Show
+ when={screenShareMaximized()}
+ fallback={<CornersOutIcon class="size-4" />}
+ >
+ <CornersInIcon class="size-4" />
+ </Show>
+ </Button>
<Show when={callCtx.isScreenSharing()}>
<div class="relative size-full">
<TrackView track={localScreenTrack()} fit="contain" />
@@ -573,9 +597,10 @@ export function CallOverlay(props: {
</div>
</Show>
- {/* Participants area */}
+ {/* Participants area; stays mounted while the screen share is maximized. */}
<div
- class={`${hasAnyScreenShare() && !focusedParticipant() ? 'h-45 shrink-0' : 'flex-1 min-h-0'} relative pt-2 mobile:pt-0`}
+ hidden={showScreenShare() && screenShareMaximized()}
+ class={`${showScreenShare() ? 'h-45 shrink-0' : 'flex-1 min-h-0'} relative pt-2 mobile:pt-0`}
>
<Show
when={participants().length > 0}
diff --git a/apps/web/src/features/channel/Call/tests/call-overlay-muted.test.tsx b/apps/web/src/features/channel/Call/tests/call-overlay-muted.test.tsx
index cdd7d20dc3..8178876668 100644
--- a/apps/web/src/features/channel/Call/tests/call-overlay-muted.test.tsx
+++ b/apps/web/src/features/channel/Call/tests/call-overlay-muted.test.tsx
@@ -212,6 +212,60 @@ beforeEach(() => {
);
});
+describe('CallOverlay screen share', () => {
+ it('hides participant tiles without remounting them while maximized', () => {
+ const screenShare: MockTrackPublication = {
+ isMuted: false,
+ isSubscribed: true,
+ track: createTrack('remote-screen'),
+ };
+ const sharer = createRemoteParticipant(
+ 'sharer',
+ {
+ camera: {
+ isMuted: false,
+ isSubscribed: true,
+ track: createTrack('remote-camera'),
+ },
+ screen_share: screenShare,
+ },
+ 'Sam Sharer'
+ );
+ const controls = setUpCallState([sharer]);
+ render(() => <CallOverlay onLeave={() => undefined} />);
+ const camera = screen.getByTestId('track-remote-camera');
+ expect(
+ screen.getByRole('button', { name: 'Focus Sam Sharer' })
+ ).toBeTruthy();
+
+ fireEvent.click(
+ screen.getByRole('button', { name: 'Maximize screen share' })
+ );
+ expect(
+ screen.queryByRole('button', { name: 'Focus Sam Sharer' })
+ ).toBeNull();
+ expect(screen.getByTestId('track-remote-camera')).toBe(camera);
+ expect(screen.getByTestId('track-remote-screen')).toBeTruthy();
+
+ fireEvent.click(screen.getByRole('button', { name: 'Show participants' }));
+ expect(
+ screen.getByRole('button', { name: 'Focus Sam Sharer' })
+ ).toBeTruthy();
+
+ fireEvent.click(
+ screen.getByRole('button', { name: 'Maximize screen share' })
+ );
+ screenShare.track = undefined;
+ controls.setTrackVersion((version) => version + 1);
+ expect(
+ screen.getByRole('button', { name: 'Focus Sam Sharer' })
+ ).toBeTruthy();
+ expect(
+ screen.queryByRole('button', { name: 'Show participants' })
+ ).toBeNull();
+ });
+});
+
describe('CallOverlay muted microphone badges', () => {
it('excludes standalone calls from team sharing even when the caller enables the control', () => {
const controls = setUpCallState();
diff --git a/apps/web/src/lib/i18n/locales/en/calls.ts b/apps/web/src/lib/i18n/locales/en/calls.ts
index e049ee269e..b2f8cf4fee 100644
--- a/apps/web/src/lib/i18n/locales/en/calls.ts
+++ b/apps/web/src/lib/i18n/locales/en/calls.ts
@@ -25,4 +25,6 @@ export default {
'Macro needs Screen Recording access. Turn on Macro in System Settings › Privacy & Security › Screen & System Audio Recording, then reopen Macro.',
share: 'Share',
shareFailed: "Couldn't share your screen. Try again.",
+ maximizeScreenShare: 'Maximize screen share',
+ restoreScreenShare: 'Show participants',
};
diff --git a/docs/agent-guide/calls.md b/docs/agent-guide/calls.md
index 2742042b5d..238db1124b 100644
--- a/docs/agent-guide/calls.md
+++ b/docs/agent-guide/calls.md
@@ -259,6 +259,12 @@ button on the focused tile to restore the grid. If that participant leaves, the
returns automatically. Focus changes keep the existing video tracks mounted.
A talking participant has an accent-colored border above their video or avatar.
+While someone shares their screen, **Maximize screen share** at the share's
+top-right hides the participant strip so the share fills the call area, and
+**Show participants** brings it back. Video tiles stay mounted and audio keeps
+playing. The choice lasts while the call view is open, so a later share also
+opens maximized; check it on desktop and at phone width, and when the share stops.
+
Open **Chat** and **Participants** from the button beside the media controls.
The sidebar and phone drawer share a compact grouped section switcher at the top.
**Participants** shows the live attendee count and a scrollable roster, including