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(sidebar): add Activity to the rail's More menu (#8403)

Jacob Beckerman1e618af85dc5
diff --git a/apps/web/src/components/app/sidebar-next/customize-sidebar-modal.test.tsx b/apps/web/src/components/app/sidebar-next/customize-sidebar-modal.test.tsx
index 8724ac96d7..eaee87cfa6 100644
--- a/apps/web/src/components/app/sidebar-next/customize-sidebar-modal.test.tsx
+++ b/apps/web/src/components/app/sidebar-next/customize-sidebar-modal.test.tsx
@@ -48,6 +48,7 @@ function Modal() {
showCustomers: true,
showCalls: true,
showReviews: true,
+ showActivity: true,
get prefs() {
return prefs();
},
@@ -165,6 +166,38 @@ describe('sidebar customization drag sorting', () => {
).toBe(true);
const stored = JSON.parse(localStorage.getItem('macro:sidebar:prefs')!);
expect(stored.order).toEqual(['tasks', 'mail']);
- expect(stored.hidden).toEqual(['reviews']);
+ expect(stored.hidden).toEqual(['reviews', 'activity']);
+ });
+
+ it('keeps Activity hidden for version 1 preferences until explicitly enabled', async () => {
+ localStorage.setItem(
+ 'macro:sidebar:prefs',
+ JSON.stringify({ version: 1, hidden: ['reviews'], order: [] })
+ );
+ const mount = () =>
+ render(() => (
+ <SidebarPrefsProvider>
+ <Modal />
+ </SidebarPrefsProvider>
+ ));
+ mount();
+ const activity = await screen.findByRole<HTMLInputElement>('checkbox', {
+ name: 'Activity',
+ });
+ expect(activity.checked).toBe(false);
+ fireEvent.click(activity);
+ expect(activity.checked).toBe(true);
+ cleanup();
+ mount();
+ expect(
+ (
+ await screen.findByRole<HTMLInputElement>('checkbox', {
+ name: 'Activity',
+ })
+ ).checked
+ ).toBe(true);
+ expect(
+ JSON.parse(localStorage.getItem('macro:sidebar:prefs')!).hidden
+ ).toEqual(['reviews']);
});
});
diff --git a/apps/web/src/components/app/sidebar-next/nav-items.test.ts b/apps/web/src/components/app/sidebar-next/nav-items.test.ts
index 6a477af5ba..ce62ac4fb0 100644
--- a/apps/web/src/components/app/sidebar-next/nav-items.test.ts
+++ b/apps/web/src/components/app/sidebar-next/nav-items.test.ts
@@ -21,6 +21,7 @@ const defaultGates = (overrides: Partial<NavItemGates> = {}): NavItemGates => ({
showCustomers: true,
showCalls: true,
showReviews: true,
+ showActivity: true,
prefs: defaultPrefs(),
...overrides,
});
@@ -47,10 +48,32 @@ describe('sidebar visibility preferences', () => {
expect(items.map((item) => item.id)).toEqual([
'calls',
'reviews',
+ 'activity',
'booking-links',
]);
});
+ it('starts Activity in More and keeps it absent when its flag is off', () => {
+ expect(
+ visibleNavItems(defaultGates()).some((item) => item.id === 'activity')
+ ).toBe(false);
+ expect(moreMenuItems(defaultGates())).toContainEqual(
+ expect.objectContaining({ label: 'Activity', href: '/activity' })
+ );
+
+ const gates = defaultGates({
+ showActivity: false,
+ prefs: defaultPrefs({ hidden: new Set() }),
+ });
+ for (const items of [
+ customizableNavItems(gates),
+ visibleNavItems(gates),
+ moreMenuItems(gates),
+ ]) {
+ expect(items.some((item) => item.id === 'activity')).toBe(false);
+ }
+ });
+
it('shows an item on the rail when it is not hidden', () => {
const items = visibleNavItems(
defaultGates({
diff --git a/apps/web/src/components/app/sidebar-next/nav-items.ts b/apps/web/src/components/app/sidebar-next/nav-items.ts
index 291fda93a0..93239ec698 100644
--- a/apps/web/src/components/app/sidebar-next/nav-items.ts
+++ b/apps/web/src/components/app/sidebar-next/nav-items.ts
@@ -12,6 +12,7 @@ import GitPullRequestIcon from '@phosphor/git-pull-request.svg';
import HouseIcon from '@phosphor/house.svg';
import ListChecksIcon from '@phosphor/list-checks.svg';
import PhoneCallIcon from '@phosphor/phone-call.svg';
+import PulseIcon from '@phosphor/pulse.svg';
import AgentIcon from '@phosphor/sparkle.svg';
import BuildingsFillIcon from '@phosphor-fill/buildings-fill.svg';
import CalendarBlankFillIcon from '@phosphor-fill/calendar-blank-fill.svg';
@@ -23,6 +24,7 @@ import GitPullRequestFillIcon from '@phosphor-fill/git-pull-request-fill.svg';
import HouseFillIcon from '@phosphor-fill/house-fill.svg';
import ListChecksFillIcon from '@phosphor-fill/list-checks-fill.svg';
import PhoneCallFillIcon from '@phosphor-fill/phone-call-fill.svg';
+import PulseFillIcon from '@phosphor-fill/pulse-fill.svg';
import AgentFillIcon from '@phosphor-fill/sparkle-fill.svg';
import type { NavIcon } from './nav-glyph';
import type { SidebarPrefs } from './use-sidebar-prefs';
@@ -148,6 +150,15 @@ export const SIDEBAR_NEXT_NAV_ITEMS = [
hotkey: 'v',
hotkeyToken: TOKENS.sidebar.goTo.reviews,
},
+ {
+ id: 'activity',
+ label: 'Activity',
+ href: '/activity',
+ icon: PulseIcon,
+ iconActive: PulseFillIcon,
+ hotkey: 'y',
+ hotkeyToken: TOKENS.sidebar.goTo.activity,
+ },
{
id: 'booking-links',
label: 'Scheduling',
@@ -164,6 +175,7 @@ export type NavItemGates = {
showCustomers: boolean;
showCalls: boolean;
showReviews: boolean;
+ showActivity: boolean;
/** User preferences for which items are shown and in what order. */
prefs: SidebarPrefs;
};
@@ -178,6 +190,7 @@ export const isNavItemAvailable = (
if (item.id === 'companies') return gates.showCustomers;
if (item.id === 'calls') return gates.showCalls;
if (item.id === 'reviews') return gates.showReviews;
+ if (item.id === 'activity') return gates.showActivity;
return true;
};
diff --git a/apps/web/src/components/app/sidebar-next/use-nav-item-gates.ts b/apps/web/src/components/app/sidebar-next/use-nav-item-gates.ts
index 8eac3d3d51..6cdec5eaf9 100644
--- a/apps/web/src/components/app/sidebar-next/use-nav-item-gates.ts
+++ b/apps/web/src/components/app/sidebar-next/use-nav-item-gates.ts
@@ -1,3 +1,4 @@
+import { useActivityFeedFlag } from '@app/features/activity/use-activity-feed-flag';
import { useCalendarUiFlag } from '@app/features/calendar/hooks/use-calendar-ui-flag';
import { useFeatureFlag } from '@app/lib/analytics/posthog';
import {
@@ -20,6 +21,7 @@ export function useNavItemGates(): Accessor<NavItemGates> {
const scheduling = useFeatureFlag(enableCalendarScheduling);
const crm = useFeatureFlag(enableCrm);
const reviews = useFeatureFlag(enableTasksReviews);
+ const activity = useActivityFeedFlag();
const { prefs } = useSidebarPrefs();
return createMemo(() => ({
@@ -28,6 +30,7 @@ export function useNavItemGates(): Accessor<NavItemGates> {
showCustomers: crm().enabled,
showCalls: ENABLE_CALLS,
showReviews: reviews().enabled,
+ showActivity: activity(),
prefs: prefs(),
}));
}
diff --git a/apps/web/src/components/app/sidebar-next/use-sidebar-prefs.ts b/apps/web/src/components/app/sidebar-next/use-sidebar-prefs.ts
index 88e26a6c91..be7ad8c3a4 100644
--- a/apps/web/src/components/app/sidebar-next/use-sidebar-prefs.ts
+++ b/apps/web/src/components/app/sidebar-next/use-sidebar-prefs.ts
@@ -9,6 +9,7 @@ export const DEFAULT_HIDDEN_IDS = [
'calls',
'reviews',
'booking-links',
+ 'activity',
] as const;
export type SidebarPrefs = {
@@ -19,7 +20,7 @@ export type SidebarPrefs = {
};
type StoredPrefs = {
- version?: 1;
+ version?: 1 | 2;
hidden?: string[];
order?: string[];
};
@@ -41,6 +42,10 @@ function loadPrefs(): SidebarPrefs {
if (parsed.version === undefined && !hidden.includes('booking-links')) {
hidden.push('booking-links');
}
+ // Activity joined the rail after version 1; start it in More.
+ if ((parsed.version ?? 0) < 2 && !hidden.includes('activity')) {
+ hidden.push('activity');
+ }
return {
hidden: new Set(hidden),
order: Array.isArray(parsed.order) ? parsed.order : [],
@@ -69,7 +74,7 @@ function loadPrefs(): SidebarPrefs {
function savePrefs(prefs: SidebarPrefs): void {
try {
const payload: StoredPrefs = {
- version: 1,
+ version: 2,
hidden: [...prefs.hidden].filter((id) => id !== 'home'),
order: prefs.order,
};
diff --git a/docs/agent-guide/activity.md b/docs/agent-guide/activity.md
index f74cc97068..d3150d1f7d 100644
--- a/docs/agent-guide/activity.md
+++ b/docs/agent-guide/activity.md
@@ -13,6 +13,9 @@ Requires authentication and the `enable-activity-feed` flag. Direct navigation a
restored splits wait for flags to load; when disabled, they redirect to Home
(`/app/home`) without loading the activity feed.
+Open it from **More → Activity** in the sidebar rail (or `g y`); Customize sidebar
+can pin it to the rail.
+
When checking Activity, enable GraphQL Soup as well as the activity flag. Verify
that an initial visit resolves entity names in both the feed and Most active,
then reload and scroll through another page. Preview loading and live name
diff --git a/docs/agent-guide/navigation.md b/docs/agent-guide/navigation.md
index 3d0c394663..28be6c77a3 100644
--- a/docs/agent-guide/navigation.md
+++ b/docs/agent-guide/navigation.md
@@ -369,6 +369,9 @@ Scheduling appears in Customize sidebar only when the calendar-scheduling flag i
on. It starts hidden in More, including for existing sidebar preferences. Enable
its checkbox to place it on the rail, then reorder or hide it like other apps.
Showing Scheduling removes its duplicate from More; the choice survives reload.
+Activity appears in Customize sidebar only when the `enable-activity-feed` flag
+is on and, like Scheduling, starts hidden in More (also for existing preferences)
+until enabled on the rail.
- Top: buttons `Create` and `Search`. Clicking `Search` opens a menu
with `Command Menu` (⌘K on Mac / Ctrl+K elsewhere) and `Search everything`