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: add posthog flag for history (#4666)

Wolf Mermelstein52c169fb684f
diff --git a/js/app/packages/block-md/component/Notebook.tsx b/js/app/packages/block-md/component/Notebook.tsx
index 6418f91f18..a6030e211c 100644
--- a/js/app/packages/block-md/component/Notebook.tsx
+++ b/js/app/packages/block-md/component/Notebook.tsx
@@ -354,7 +354,7 @@ export function Notebook(props: {
setShowLexicalStateDebugger(false)
}
/>
- <Show when={ENABLE_HISTORY_COMPONENT}>
+ <Show when={ENABLE_HISTORY_COMPONENT()}>
<HistoryOverlay
currentState={currentEditorState}
selectedAt={history.selectedAt()}
diff --git a/js/app/packages/block-md/component/sidepanel/MarkdownSidePanelSections.tsx b/js/app/packages/block-md/component/sidepanel/MarkdownSidePanelSections.tsx
index 19e8721e93..67aa32c154 100644
--- a/js/app/packages/block-md/component/sidepanel/MarkdownSidePanelSections.tsx
+++ b/js/app/packages/block-md/component/sidepanel/MarkdownSidePanelSections.tsx
@@ -110,7 +110,7 @@ export function MarkdownSidePanelSections(
<StatsSectionContent />
</SidePanel.Section>
</Show>
- <Show when={ENABLE_HISTORY_COMPONENT}>
+ <Show when={ENABLE_HISTORY_COMPONENT()}>
<SidePanel.Section id="history" title="History" defaultOpen order={35}>
<HistorySectionContent />
</SidePanel.Section>
diff --git a/js/app/packages/core/constant/featureFlags.ts b/js/app/packages/core/constant/featureFlags.ts
index d3444dea6c..72e33bae61 100644
--- a/js/app/packages/core/constant/featureFlags.ts
+++ b/js/app/packages/core/constant/featureFlags.ts
@@ -150,11 +150,19 @@ export const ENABLE_MARKDOWN_DIFF = resolveFeatureFlag(
true
);
-// Toggle the new experimental history viewer — on in dev/preview, off in prod.
-export const ENABLE_HISTORY_COMPONENT = resolveFeatureFlag(
- 'ENABLE_HISTORY_COMPONENT',
- DEV_MODE_ENV
-);
+export const ENABLE_HISTORY_COMPONENT_FLAG = 'enable-history-component';
+export const ENABLE_HISTORY_COMPONENT_OVERRIDE =
+ resolveFeatureFlag('ENABLE_HISTORY_COMPONENT', DEV_MODE_ENV) || undefined;
+
+export function ENABLE_HISTORY_COMPONENT(): boolean {
+ if (ENABLE_HISTORY_COMPONENT_OVERRIDE !== undefined) {
+ return ENABLE_HISTORY_COMPONENT_OVERRIDE;
+ }
+
+ return (
+ analytics.posthog.isFeatureEnabled(ENABLE_HISTORY_COMPONENT_FLAG) ?? false
+ );
+}
export const ENABLE_BEARER_TOKEN_AUTH = resolveFeatureFlag(
'ENABLE_BEARER_TOKEN_AUTH',