Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(sidebar): add a return-to-call button to the rail (#9056)
Eric Hayesf22214a79b84
diff --git a/apps/web/src/components/app/sidebar-next/return-to-call-button.tsx b/apps/web/src/components/app/sidebar-next/return-to-call-button.tsxnew file mode 100644index 0000000000..b8a69617e3--- /dev/null+++ b/apps/web/src/components/app/sidebar-next/return-to-call-button.tsx@@ -0,0 +1,81 @@+import { useActiveQuickCallsSource } from '@app/features/meetings/queries/active-quick-calls';+import { useQuickCallsFlag } from '@app/features/meetings/use-quick-calls-flag';+import { useAnalytics } from '@app/lib/analytics/analytics-context';+import { t } from '@app/lib/i18n';+import { useCallContextOptional } from '@channel/Call/CallContext';+import {+ getActiveMeetingPath,+ getMeetingShareToken,+} from '@channel/Call/call-link';+import { openChannelCallTab } from '@channel/Call/open-channel-call-tab';+import { ENABLE_CALLS } from '@core/constant/featureFlags';+import { useUserId } from '@core/context/user';+import { fireAndForget } from '@core/util/fireAndForget';+import PhoneFillIcon from '@icon/system/fill/phone-fill.svg';+import { useNavigate } from '@solidjs/router';+import { Button, pressHandlers } from '@ui';+import { Show, Suspense } from 'solid-js';+import { NavGlyph } from './nav-glyph';++function ReturnToCallButtonContent() {+ const call = useCallContextOptional();+ const analytics = useAnalytics();+ const navigate = useNavigate();+ const userId = useUserId();+ const flag = useQuickCallsFlag();+ const quickCalls = useActiveQuickCallsSource(() =>+ !flag().loading && flag().enabled ? userId() : undefined+ );++ const inCall = () => Boolean(call?.isInCall());++ // A quick call is backed by a channel call; it lives on its meeting page.+ const meetingShareToken = () => {+ const callId = call?.activeCallId();+ if (!callId) return undefined;+ const meeting = quickCalls+ .calls()+ .find((quickCall) => quickCall.callId === callId);+ return meeting ? getMeetingShareToken(meeting.url) : undefined;+ };++ const open = (event: MouseEvent) => {+ event.preventDefault();+ analytics.track('sidebar_click', { view: 'active-call' });+ const token = meetingShareToken();+ if (token) {+ navigate(getActiveMeetingPath(token));+ return;+ }+ const channelId = call?.activeChannelId();+ if (channelId)+ fireAndForget(openChannelCallTab(channelId), 'sidebar-return-to-call');+ };++ return (+ <Show when={inCall()}>+ <Button+ variant="success"+ size="icon-md"+ class="size-10 cursor-default rounded-xl"+ label={t('nav.returnToCall')}+ tooltip={t('nav.returnToCall')}+ tooltipPlacement="right"+ draggable={false}+ data-sidebar-next-item="active-call"+ {...pressHandlers(open)}+ >+ <NavGlyph icon={PhoneFillIcon} class="size-5" />+ </Button>+ </Show>+ );+}++/** Green phone at the bottom of the rail, shown while the user is in a call. */+export const ReturnToCallButton = () => (+ <Show when={ENABLE_CALLS}>+ <Suspense>+ <ReturnToCallButtonContent />+ </Suspense>+ </Show>+);diff --git a/apps/web/src/components/app/sidebar-next/sidebar-rail.tsx b/apps/web/src/components/app/sidebar-next/sidebar-rail.tsxindex ce7a712609..b7aa5d6c0b 100644--- a/apps/web/src/components/app/sidebar-next/sidebar-rail.tsx+++ b/apps/web/src/components/app/sidebar-next/sidebar-rail.tsx@@ -12,6 +12,7 @@ import { ListNav, type ListNavProps } from './list-nav';import { MoreMenu } from './more-menu';import { visibleNavItems } from './nav-items';import { useNextMeetingBadge } from './queries/use-next-meeting-badge';+import { ReturnToCallButton } from './return-to-call-button';import { SearchRailButton } from './search-bar-button';import { useNavItemGates } from './use-nav-item-gates';@@ -99,6 +100,7 @@ export const SidebarRail = () => {<div class="min-h-0 flex-1" />+ <ReturnToCallButton /><FooterActions /></div>);diff --git a/apps/web/src/lib/i18n/locales/en/nav.ts b/apps/web/src/lib/i18n/locales/en/nav.tsindex a7e355e916..2430f8e9af 100644--- a/apps/web/src/lib/i18n/locales/en/nav.ts+++ b/apps/web/src/lib/i18n/locales/en/nav.ts@@ -36,6 +36,7 @@ export default {hideFromSidebar: 'Hide from sidebar',unreadItems: 'Unread items',activeCall: 'Active call',+ returnToCall: 'Return to call',nextMeeting: 'Next meeting: {{time}}',more: 'More',moreOptions: 'More options',diff --git a/docs/agent-guide/calls.md b/docs/agent-guide/calls.mdindex 64894eec19..be36960562 100644--- a/docs/agent-guide/calls.md+++ b/docs/agent-guide/calls.md@@ -68,6 +68,10 @@ already in that call, which returns to the channel's Call tab. To see the sectiowithout starting a real call, answer `/call/active` and `/call/<channelId>/active`with a fake call through CDP `Fetch` interception.+While you are in a call, a green phone button (`Return to call`,+`data-sidebar-next-item="active-call"`) sits at the bottom of the desktop rail,+above Settings. It opens the channel's Call tab, or the meeting page for a quick call.+In the native iOS call drawer, the horizontal participant row excludes the personshown in the large video. While holding or scrolling the row (including momentum),the displayed primary and row membership stay fixed; speaking indicators still