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.

fix(call): you pane (#3226)

Will Hutchinson6f2f8d393c07
diff --git a/js/app/packages/channel/Call/CallOverlay.tsx b/js/app/packages/channel/Call/CallOverlay.tsx
index c5aac1a3f1..2396fda285 100644
--- a/js/app/packages/channel/Call/CallOverlay.tsx
+++ b/js/app/packages/channel/Call/CallOverlay.tsx
@@ -1,4 +1,6 @@
import { MiniToggleSwitch } from '@core/component/FormControls/MiniToggleSwitch';
+import { UserIcon } from '@core/component/UserIcon';
+import { useAuthor, useUserId } from '@core/context/user';
import { tryMacroId, useDisplayName } from '@core/user';
import ShareNetwork from '@phosphor-icons/core/assets/regular/share-network.svg';
import { useToggleShareWithTeamMutation } from '@queries/call/call';
@@ -49,11 +51,60 @@ function ParticipantTileWrapper(props: {
);
}
+function LocalParticipantAvatar(props: {
+ userId: string | undefined;
+ fallbackName: string | undefined;
+ avatarSize?: 'sm' | 'md';
+}) {
+ const avatarClass = () =>
+ cn(
+ 'overflow-hidden rounded-full',
+ props.avatarSize === 'sm' ? 'size-12' : 'size-20 sm:size-24'
+ );
+
+ const fallbackInitial = () => {
+ const name = props.fallbackName?.trim();
+ return (name ? name.charAt(0) : 'Y').toUpperCase();
+ };
+
+ return (
+ <div class="flex items-center justify-center size-full p-4">
+ <div class={avatarClass()}>
+ <Show
+ when={props.userId?.trim()}
+ keyed
+ fallback={
+ <div
+ class={cn(
+ 'flex size-full items-center justify-center rounded-full bg-ink-extra-muted text-surface font-semibold',
+ props.avatarSize === 'sm' ? 'text-xl' : 'text-4xl'
+ )}
+ >
+ {fallbackInitial()}
+ </div>
+ }
+ >
+ {(userId) => (
+ <UserIcon
+ id={userId}
+ size="fill"
+ suppressClick
+ showTooltip={false}
+ />
+ )}
+ </Show>
+ </div>
+ </div>
+ );
+}
+
function LocalParticipantTile(props: {
isSpeaking: boolean;
isConnecting: boolean;
isVideoMuted: boolean;
track: Track | undefined;
+ userId: string | undefined;
+ fallbackName: string | undefined;
avatarSize?: 'sm' | 'md';
class?: string;
}) {
@@ -66,16 +117,11 @@ function LocalParticipantTile(props: {
<Show
when={!props.isConnecting && !props.isVideoMuted}
fallback={
- <div class="flex items-center justify-center size-full p-4">
- <div
- class={cn(
- 'rounded-full bg-hover flex items-center justify-center text-ink-muted font-medium',
- props.avatarSize === 'sm' ? 'size-8 text-sm' : 'size-12 text-lg'
- )}
- >
- You
- </div>
- </div>
+ <LocalParticipantAvatar
+ userId={props.userId}
+ fallbackName={props.fallbackName}
+ avatarSize={props.avatarSize}
+ />
}
>
<TrackView track={props.track} mirror />
@@ -144,6 +190,8 @@ function ScreenShareTile(props: { participant: RemoteParticipant }) {
export function CallOverlay(props: { onLeave: () => void }) {
const callCtx = useCallContext();
+ const currentUserId = useUserId();
+ const currentUserName = useAuthor();
const isConnecting = () => callCtx.isConnecting();
const toggleShareWithTeam = useToggleShareWithTeamMutation();
@@ -159,6 +207,16 @@ export function CallOverlay(props: { onLeave: () => void }) {
const isLocalSpeaking = () => callCtx.isLocalSpeaking();
+ const localUserId = () => {
+ callCtx.connectionState();
+ callCtx.trackVersion();
+
+ const identity = callCtx.room()?.localParticipant.identity?.trim();
+ const macroIdentity = identity ? tryMacroId(identity) : undefined;
+ const userId = currentUserId()?.trim();
+ return macroIdentity ?? userId ?? identity;
+ };
+
const localVideoTrack = () => {
callCtx.trackVersion();
const r = callCtx.room();
@@ -225,6 +283,8 @@ export function CallOverlay(props: { onLeave: () => void }) {
isConnecting={isConnecting()}
isVideoMuted={callCtx.isVideoMuted()}
track={localVideoTrack()}
+ userId={localUserId()}
+ fallbackName={currentUserName()}
/>
}
>
@@ -245,6 +305,8 @@ export function CallOverlay(props: { onLeave: () => void }) {
isConnecting={isConnecting()}
isVideoMuted={callCtx.isVideoMuted()}
track={localVideoTrack()}
+ userId={localUserId()}
+ fallbackName={currentUserName()}
avatarSize="sm"
/>
</div>
diff --git a/js/bun.lock b/js/bun.lock
index abb76fa624..e2ec2551a9 100644
--- a/js/bun.lock
+++ b/js/bun.lock
@@ -839,7 +839,7 @@
"@img/sharp-win32-x64": ["@img/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw=="],
- "@inkibra/tauri-plugins": ["@inkibra/tauri-plugins@github:macro-inc/tauri-plugins#6152009", { "dependencies": { "react": "^18.3.1", "react-dom": "^18.3.1" } }, "macro-inc-tauri-plugins-6152009", "sha512-XLN+niDA9BkzrxiZqBjYf+DL4TLoMIcI80ypCowacVfrfAjWt0qLwLkzWVUXjD7k3v0DB/G+BP4OLJNkGygHIw=="],
+ "@inkibra/tauri-plugins": ["@inkibra/tauri-plugins@github:macro-inc/tauri-plugins#6152009", { "dependencies": { "react": "^18.3.1", "react-dom": "^18.3.1" } }, "macro-inc-tauri-plugins-6152009"],
"@inquirer/external-editor": ["@inquirer/[email protected]", "", { "dependencies": { "chardet": "^2.1.1", "iconv-lite": "^0.7.0" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA=="],
@@ -2565,7 +2565,7 @@
"pathval": ["[email protected]", "", {}, "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ=="],
- "pdfjs-dist": ["pdfjs-dist@github:macro-inc/pdf.js#f9b2ce6", { "dependencies": { "dommatrix": "^1.0.3", "web-streams-polyfill": "^3.2.1" }, "peerDependencies": { "worker-loader": "^3.0.8" }, "optionalPeers": ["worker-loader"] }, "macro-inc-pdf.js-f9b2ce6", "sha512-HDFaPbCxLG2GHpf1smUG97nku5aPGBGaCcIbK05dGdp07TBLUlDcXsM4WcE82mO5W4RBPIBVYobX5N/6M6NFrA=="],
+ "pdfjs-dist": ["pdfjs-dist@github:macro-inc/pdf.js#f9b2ce6", { "dependencies": { "dommatrix": "^1.0.3", "web-streams-polyfill": "^3.2.1" }, "peerDependencies": { "worker-loader": "^3.0.8" }, "optionalPeers": ["worker-loader"] }, "macro-inc-pdf.js-f9b2ce6"],
"performance-now": ["[email protected]", "", {}, "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow=="],