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.

chore(flag): flag off activity (#4999)

teo960f3b40f8ae
diff --git a/apps/web/src/components/app/app-sidebar/sidebar.tsx b/apps/web/src/components/app/app-sidebar/sidebar.tsx
index 2296f6e202..61c841714d 100644
--- a/apps/web/src/components/app/app-sidebar/sidebar.tsx
+++ b/apps/web/src/components/app/app-sidebar/sidebar.tsx
@@ -43,6 +43,7 @@ import { ContextMenuContent, MenuItem } from '@core/component/ContextMenu';
import { inboxIconProps } from '@core/component/inboxIcon';
import { UserIcon } from '@core/component/UserIcon';
import {
+ ENABLE_ACTIVITY,
ENABLE_CALLS,
ENABLE_CRM,
ENABLE_NEW_PRICING_OVERRIDE,
@@ -175,14 +176,6 @@ const SIDEBAR_LINKS = [
hotkey: 'i',
hotkeyToken: TOKENS.sidebar.goTo.inbox,
},
- {
- id: 'activity',
- label: 'Activity',
- href: '/activity',
- icon: AnimatedActivityIcon,
- hotkey: 'y',
- hotkeyToken: TOKENS.sidebar.goTo.activity,
- },
{
id: 'search',
label: 'Search',
@@ -959,18 +952,36 @@ const DASHBOARD_LINK: SidebarItem = {
hotkeyToken: TOKENS.sidebar.goTo.home,
};
+const ACTIVITY_LINK: SidebarItem = {
+ id: 'activity',
+ label: 'Activity',
+ href: '/activity',
+ icon: AnimatedActivityIcon,
+ hotkey: 'y',
+ hotkeyToken: TOKENS.sidebar.goTo.activity,
+};
+
/**
* Assemble the ordered sidebar link list: the static links plus Home and the
- * flag-gated Calls and CRM entries in their correct positions. Shared by the
- * rendered sidebar (`AppSidebar.visibleLinks`) and the always-mounted
- * `GoToHotkeys` registrar so their link sets can't drift. Call from a reactive
- * context — it reads `ENABLE_CALLS()` / `ENABLE_CRM()`. Rendered sections
- * additionally drop `hiddenFromSidebar` entries, which have hotkeys but no
- * sidebar row.
+ * flag-gated Activity, Calls, and CRM entries in their correct positions.
+ * Shared by the rendered sidebar (`AppSidebar.visibleLinks`) and the
+ * always-mounted `GoToHotkeys` registrar so their link sets can't drift. Call
+ * from a reactive context — it reads `ENABLE_CALLS()` / `ENABLE_CRM()`.
+ * Rendered sections additionally drop `hiddenFromSidebar` entries, which have
+ * hotkeys but no sidebar row.
*/
const buildSidebarLinks = (): SidebarItem[] => {
let links: SidebarItem[] = [DASHBOARD_LINK, ...SIDEBAR_LINKS];
+ if (ENABLE_ACTIVITY) {
+ const idx = links.findIndex((link) => link.id === 'inbox');
+ links = [
+ ...links.slice(0, idx + 1),
+ ACTIVITY_LINK,
+ ...links.slice(idx + 1),
+ ];
+ }
+
if (ENABLE_CALLS()) {
const idx = links.findIndex((l) => l.id === 'channels');
links = [...links.slice(0, idx + 1), CALLS_LINK, ...links.slice(idx + 1)];
diff --git a/apps/web/src/components/app/split-layout/componentRegistry.tsx b/apps/web/src/components/app/split-layout/componentRegistry.tsx
index ea084757b2..f48e2c99f4 100644
--- a/apps/web/src/components/app/split-layout/componentRegistry.tsx
+++ b/apps/web/src/components/app/split-layout/componentRegistry.tsx
@@ -1,4 +1,3 @@
-import { ActivityView } from '@app/features/activity-timeline/activity-view';
import { Home } from '@app/features/home';
import { queryStateFrom } from '@app/features/next-soup/filters/filter-store';
import type { SetPredicatesInput } from '@app/features/next-soup/filters/filter-store/predicates-store';
@@ -20,6 +19,7 @@ import { useIsAuthenticated } from '@core/auth';
import { LoadingBlock } from '@core/component/LoadingBlock';
import {
DEV_MODE_ENV,
+ ENABLE_ACTIVITY,
ENABLE_CRM,
LOCAL_ONLY,
} from '@core/constant/featureFlags';
@@ -158,9 +158,20 @@ registerComponent(
})
);
+const ActivityView = lazy(() =>
+ import('@app/features/activity-timeline/activity-view').then((module) => ({
+ default: module.ActivityView,
+ }))
+);
+
registerComponent(
'activity',
withAuth(() => {
+ // Keep the registration so direct navigation and restored splits can
+ // recover safely without loading the data-owning Activity view.
+ if (!ENABLE_ACTIVITY) {
+ return <RedirectSplit to={{ type: 'component', id: 'inbox' }} />;
+ }
usePageViewTracking('activity');
return <ActivityView />;
})
diff --git a/apps/web/src/lib/core/constant/featureFlags.ts b/apps/web/src/lib/core/constant/featureFlags.ts
index ef9eb06c7c..d87a6a9f2b 100644
--- a/apps/web/src/lib/core/constant/featureFlags.ts
+++ b/apps/web/src/lib/core/constant/featureFlags.ts
@@ -122,6 +122,14 @@ export const ENABLE_MARKDOWN_LIVE_COLLABORATION = resolveFeatureFlag(
export const ENABLE_EMAIL = resolveFeatureFlag('ENABLE_EMAIL', true);
+// Activity timeline: the Activity sidebar entry and the combined Firehose /
+// My Activity view. Keep it dev-only by default while the feature is under
+// development; override with VITE_ENABLE_ACTIVITY for controlled testing.
+export const ENABLE_ACTIVITY = resolveFeatureFlag(
+ 'ENABLE_ACTIVITY',
+ DEV_MODE_ENV
+);
+
// Email signatures: the settings editor, the compose / reply / AI-chat signature
// previews, and the per-message include toggle. PostHog-gated with a dev-mode
// default; override with VITE_ENABLE_EMAIL_SIGNATURES.