2025-12-09 19:42:37 +02:00
|
|
|
import options from "./options";
|
|
|
|
|
|
2025-12-09 19:34:03 +02:00
|
|
|
interface ExperimentalFeature {
|
|
|
|
|
id: string;
|
|
|
|
|
name: string;
|
|
|
|
|
description: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const experimentalFeatures: ExperimentalFeature[] = [
|
|
|
|
|
{
|
2025-12-09 19:42:37 +02:00
|
|
|
id: "new-layout",
|
2025-12-09 19:34:03 +02:00
|
|
|
name: "New Layout",
|
|
|
|
|
description: "Try out the new layout for a more modern look and improved usability.",
|
|
|
|
|
}
|
|
|
|
|
];
|
2025-12-09 19:42:37 +02:00
|
|
|
|
|
|
|
|
type ExperimentalFeatureId = typeof experimentalFeatures[number]["id"];
|
|
|
|
|
|
|
|
|
|
let enabledFeatures: Set<ExperimentalFeatureId> | null = null;
|
|
|
|
|
|
|
|
|
|
export function isExperimentalFeatureEnabled(featureId: ExperimentalFeatureId): boolean {
|
|
|
|
|
if (!enabledFeatures) {
|
|
|
|
|
const features = JSON.parse(options.get("experimentalFeatures")) as string[];
|
|
|
|
|
enabledFeatures = new Set(features);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return enabledFeatures.has(featureId);
|
|
|
|
|
}
|