chore: add database-backed feature flag for sidebar tips section (#26516)

* chore: remove tips section from sidebar

Co-Authored-By: [email protected] <[email protected]>

* chore: add feature flag for sidebar tips section

Co-Authored-By: [email protected] <[email protected]>

* chore: use database-backed feature flag for sidebar tips section

Co-Authored-By: [email protected] <[email protected]>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-01-09 22:31:45 +05:30
1 parent 2b7c087ac8
commit a12ab5bb65
4 files changed
+12 -3

No files matched your search

+7 -3
View File
@@ -5,6 +5,7 @@ import Link from "next/link";
import { usePathname } from "next/navigation"; import { usePathname } from "next/navigation";
import { getBookerBaseUrlSync } from "@calcom/features/ee/organizations/lib/getBookerBaseUrlSync"; import { getBookerBaseUrlSync } from "@calcom/features/ee/organizations/lib/getBookerBaseUrlSync";
import { useFlagMap } from "@calcom/features/flags/context/provider";
import { IS_VISUAL_REGRESSION_TESTING, ENABLE_PROFILE_SWITCHER } from "@calcom/lib/constants"; import { IS_VISUAL_REGRESSION_TESTING, ENABLE_PROFILE_SWITCHER } from "@calcom/lib/constants";
import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage"; import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
@@ -56,6 +57,7 @@ export function SideBar({ bannersHeight, user }: SideBarProps) {
const pathname = usePathname(); const pathname = usePathname();
const isPlatformPages = pathname?.startsWith("/settings/platform"); const isPlatformPages = pathname?.startsWith("/settings/platform");
const isAdmin = session.data?.user.role === UserPermissionRole.ADMIN; const isAdmin = session.data?.user.role === UserPermissionRole.ADMIN;
const flags = useFlagMap();
const publicPageUrl = `${getBookerBaseUrlSync(user?.org?.slug ?? null)}/${user?.orgAwareUsername}`; const publicPageUrl = `${getBookerBaseUrlSync(user?.org?.slug ?? null)}/${user?.orgAwareUsername}`;
@@ -137,9 +139,11 @@ export function SideBar({ bannersHeight, user }: SideBarProps) {
{!isPlatformPages && ( {!isPlatformPages && (
<div className="md:px-2 md:pb-4 lg:p-0"> <div className="md:px-2 md:pb-4 lg:p-0">
<div className="overflow-hidden"> {flags["sidebar-tips"] && (
<Tips /> <div className="overflow-hidden">
</div> <Tips />
</div>
)}
{bottomNavItems.map((item, index) => ( {bottomNavItems.map((item, index) => (
<Tooltip side="right" content={t(item.name)} className="lg:hidden" key={item.name}> <Tooltip side="right" content={t(item.name)} className="lg:hidden" key={item.name}>
<ButtonOrLink <ButtonOrLink
+1
View File
@@ -34,6 +34,7 @@ export type AppFlags = {
"booking-email-sms-tasker": boolean; "booking-email-sms-tasker": boolean;
"bookings-v3": boolean; "bookings-v3": boolean;
"booking-audit": boolean; "booking-audit": boolean;
"sidebar-tips": boolean;
}; };
export type TeamFeatures = Record<keyof AppFlags, boolean>; export type TeamFeatures = Record<keyof AppFlags, boolean>;
+1
View File
@@ -33,6 +33,7 @@ const initialData: AppFlags = {
"booking-email-sms-tasker": false, "booking-email-sms-tasker": false,
"bookings-v3": false, "bookings-v3": false,
"booking-audit": false, "booking-audit": false,
"sidebar-tips": false,
}; };
if (process.env.NEXT_PUBLIC_IS_E2E) { if (process.env.NEXT_PUBLIC_IS_E2E) {
@@ -0,0 +1,3 @@
INSERT INTO "Feature" (slug, enabled, description, "type")
VALUES ('sidebar-tips', false, 'Enables the tips section in the sidebar.', 'OPERATIONAL')
ON CONFLICT (slug) DO NOTHING;