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
fix(web): turn new app views on without waiting for PostHog (#6899)
teo967f42e528d5
diff --git a/apps/web/src/lib/core/constant/featureFlags.ts b/apps/web/src/lib/core/constant/featureFlags.tsindex b4b9733598..c56267ebce 100644--- a/apps/web/src/lib/core/constant/featureFlags.ts+++ b/apps/web/src/lib/core/constant/featureFlags.ts@@ -107,14 +107,14 @@ export function isFeatureEnabled(flag: Flag): boolean {/*** Switches Inbox, Tasks, and Channels from the current SoupView implementations- * to the new composable view implementations. Enabled by default in local- * development; production follows PostHog. Override locally with- * VITE_ENABLE_NEW_APP_VIEWS=false.+ * to the new composable view implementations. On everywhere without waiting+ * for PostHog: a late PostHog answer swaps the app shell after first paint.+ * Override locally with VITE_ENABLE_NEW_APP_VIEWS=false.*/export const enableNewAppViews = defineFlag({key: 'enable-new-app-views',env: 'ENABLE_NEW_APP_VIEWS',- default: DEV_MODE_ENV || undefined,+ default: true,});/**diff --git a/apps/web/src/lib/core/tests/featureFlags.test.ts b/apps/web/src/lib/core/tests/featureFlags.test.tsindex 09e5b40a09..c19ae6d514 100644--- a/apps/web/src/lib/core/tests/featureFlags.test.ts+++ b/apps/web/src/lib/core/tests/featureFlags.test.ts@@ -12,18 +12,26 @@ afterEach(() => {});describe('new app views rollout', () => {- it('allows PostHog to disable and enable the production flag', async () => {+ it('enables production without waiting for PostHog', async () => {vi.stubEnv('MODE', 'production');vi.stubEnv('VITE_ENABLE_NEW_APP_VIEWS', '');vi.resetModules();const { enableNewAppViews, isFeatureEnabled } = await import('../constant/featureFlags');- expect(enableNewAppViews.override).toBeUndefined();- remoteFlag.mockReturnValue(false);- expect(isFeatureEnabled(enableNewAppViews)).toBe(false);- remoteFlag.mockReturnValue(true);+ remoteFlag.mockReturnValue(undefined);expect(isFeatureEnabled(enableNewAppViews)).toBe(true);+ expect(remoteFlag).not.toHaveBeenCalled();+ });++ it('lets the env override disable the flag', async () => {+ vi.stubEnv('MODE', 'production');+ vi.stubEnv('VITE_ENABLE_NEW_APP_VIEWS', 'false');+ vi.resetModules();+ const { enableNewAppViews, isFeatureEnabled } = await import(+ '../constant/featureFlags'+ );+ expect(isFeatureEnabled(enableNewAppViews)).toBe(false);});it('enables local development by default', async () => {