Skip to content

Commit 016f379

Browse files
Marfuenclaude
andauthored
feat(frameworks): remove is-framework-versioning-enabled feature flag (#2781)
Roll out framework versioning to all organizations by removing the PostHog feature flag gate. The History tab and update banner now render unconditionally. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5a406f9 commit 016f379

3 files changed

Lines changed: 14 additions & 28 deletions

File tree

apps/app/src/app/(app)/[orgId]/frameworks/[frameworkInstanceId]/components/FrameworkDetailContent.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export function FrameworkDetailContent({
5353
const pathname = usePathname();
5454
const searchParams = useSearchParams();
5555
const { hasPermission, permissions } = usePermissions();
56-
const versioningEnabled = useFeatureFlag('is-framework-versioning-enabled');
5756
const complianceTimelineEnabled = useFeatureFlag('is-timeline-enabled');
5857
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
5958
const [dropdownOpen, setDropdownOpen] = useState(false);
@@ -82,7 +81,7 @@ export function FrameworkDetailContent({
8281
const validTabsList: string[] = [];
8382
if (complianceTimelineEnabled) validTabsList.push('progress');
8483
validTabsList.push('requirements');
85-
if (versioningEnabled) validTabsList.push('history');
84+
validTabsList.push('history');
8685
const validTabs = new Set(validTabsList);
8786
const activeTab = tabParam && validTabs.has(tabParam) ? tabParam : DEFAULT_TAB;
8887

@@ -158,7 +157,7 @@ export function FrameworkDetailContent({
158157
<TabsTrigger value="requirements">
159158
Requirements <TabBadge>{requirementsCount}</TabBadge>
160159
</TabsTrigger>
161-
{versioningEnabled && <TabsTrigger value="history">History</TabsTrigger>}
160+
<TabsTrigger value="history">History</TabsTrigger>
162161
</TabsList>
163162
}
164163
>
@@ -197,14 +196,12 @@ export function FrameworkDetailContent({
197196
/>
198197
</TabsContent>
199198

200-
{versioningEnabled && (
201-
<TabsContent value="history">
202-
<SyncHistorySection
203-
frameworkInstanceId={frameworkInstanceId}
204-
permissions={permissions}
205-
/>
206-
</TabsContent>
207-
)}
199+
<TabsContent value="history">
200+
<SyncHistorySection
201+
frameworkInstanceId={frameworkInstanceId}
202+
permissions={permissions}
203+
/>
204+
</TabsContent>
208205
</PageLayout>
209206

210207
<FrameworkDeleteDialog

apps/app/src/app/(app)/[orgId]/frameworks/[frameworkInstanceId]/components/FrameworkVersioningSection.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use client';
22

3-
import { useFeatureFlag } from '@trycompai/analytics';
43
import { useParams, useRouter } from 'next/navigation';
54
import { useFrameworkUpdateStatus } from '@/hooks/use-framework-update-status';
65
import { usePermissions } from '@/hooks/use-permissions';
@@ -18,20 +17,13 @@ export function FrameworkVersioningSection({
1817
initialStatus,
1918
hasActiveAudit,
2019
}: FrameworkVersioningSectionProps) {
21-
const enabled = useFeatureFlag('is-framework-versioning-enabled');
22-
// Thread the flag into SWR so the update-status request doesn't fire for
23-
// orgs that don't have versioning enabled. Without this the request runs
24-
// every mount and we just throw the response away.
2520
const { data } = useFrameworkUpdateStatus(frameworkInstanceId, {
2621
fallbackData: initialStatus,
27-
enabled,
2822
});
2923
const { hasPermission } = usePermissions();
3024
const router = useRouter();
3125
const { orgId } = useParams<{ orgId: string }>();
3226

33-
if (!enabled) return null;
34-
3527
const canUpdate = hasPermission('framework', 'update');
3628

3729
return (

apps/app/src/hooks/use-framework-update-status.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@ import type { FrameworkUpdateStatus } from '@/types/framework-versioning';
66

77
interface UseFrameworkUpdateStatusOptions {
88
fallbackData?: FrameworkUpdateStatus;
9-
enabled?: boolean;
109
}
1110

1211
export function useFrameworkUpdateStatus(
1312
frameworkInstanceId: string,
1413
options?: UseFrameworkUpdateStatusOptions,
1514
) {
16-
const key =
17-
frameworkInstanceId && options?.enabled !== false
18-
? `/v1/frameworks/${frameworkInstanceId}/update-status`
19-
: null;
15+
const key = frameworkInstanceId
16+
? `/v1/frameworks/${frameworkInstanceId}/update-status`
17+
: null;
2018

2119
return useSWR<FrameworkUpdateStatus>(
2220
key,
@@ -30,10 +28,9 @@ export function useFrameworkUpdateStatus(
3028
// Always revalidate on mount, even when fallbackData is provided.
3129
// fallbackData is only a fast first paint — without this, SWR treats
3230
// the server-rendered snapshot as authoritative forever and skips the
33-
// client fetch, so users don't see newly-available upgrades after the
34-
// feature flag is flipped, after a sync on a sibling framework, or
35-
// whenever the Next.js router cache serves a stale RSC. Short of
36-
// signing out and back in.
31+
// client fetch, so users don't see newly-available upgrades after a
32+
// sync on a sibling framework or whenever the Next.js router cache
33+
// serves a stale RSC.
3734
revalidateOnMount: true,
3835
revalidateOnFocus: true,
3936
},

0 commit comments

Comments
 (0)