Expose settings defaults directly in dashboard help text so operators can see baseline values while editing settings. - Add default-value wording across global and project settings descriptions and locale strings. - Document the dashboard/default-reference alignment and add a changeset for the published CLI package. - Add coverage that every visible settings field includes its default in helper text and update existing assertions. Files changed: .changeset/fn-7505-settings-default-descriptions.md | 7 + docs/dashboard-guide.md | 3 + docs/settings-reference.md | 3 + .../__tests__/SettingsModal.general.test.tsx | 2 +- .../settings/sections/AgentPermissionsSection.tsx | 4 +- .../settings/sections/AppearanceSection.tsx | 4 +- .../settings/sections/BackupsSection.tsx | 13 +- .../settings/sections/CommandsSection.tsx | 4 +- .../settings/sections/ExperimentalSection.tsx | 2 +- .../settings/sections/GeneralSection.tsx | 26 +- .../settings/sections/GlobalGeneralSection.tsx | 25 +- .../settings/sections/GlobalModelsSection.tsx | 24 +- .../settings/sections/McpServersCard.tsx | 1 + .../components/settings/sections/MemorySection.tsx | 12 +- .../components/settings/sections/MergeSection.tsx | 37 +- .../settings/sections/ModelPricingSection.tsx | 2 +- .../settings/sections/NodeRoutingSection.tsx | 3 +- .../settings/sections/NodeSyncSection.tsx | 6 +- .../settings/sections/NotificationsSection.tsx | 14 +- .../settings/sections/ProjectModelsSection.tsx | 11 +- .../settings/sections/PromptsSection.tsx | 2 +- .../components/settings/sections/RemoteSection.tsx | 7 +- .../settings/sections/ResearchGlobalSection.tsx | 15 +- .../settings/sections/ResearchProjectSection.tsx | 16 +- .../settings/sections/ScheduledEvalsSection.tsx | 7 +- .../settings/sections/SchedulingSection.tsx | 20 +- .../settings/sections/WorktreesSection.tsx | 14 +- .../sections/__tests__/AppearanceSection.test.tsx | 4 +- .../MergeSection.legacy-automerge-cleanup.test.tsx | 2 +- .../settings-default-descriptions.test.tsx | 573 +++++++++++++++++++++ packages/i18n/locales/en/app.json | 261 ++++++---- 31 files changed, 914 insertions(+), 210 deletions(-) Fusion-Task-Id: FN-7505 Fusion-Task-Lineage: 7688caf2-2a95-4401-8b27-9da4b46ecfcd Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
60 lines
3.2 KiB
TypeScript
60 lines
3.2 KiB
TypeScript
import type { ReactNode } from "react";
|
|
import type { SectionBaseProps } from "./context";
|
|
import { useTranslation } from "react-i18next";
|
|
export interface ExperimentalSectionProps extends SectionBaseProps {
|
|
scopeBanner: ReactNode;
|
|
/** Display labels for well-known features (always rendered). */
|
|
knownFeatures: Record<string, string>;
|
|
/** Map of legacy alias key -> canonical key. */
|
|
legacyAliases: Record<string, string>;
|
|
/** Canonicalize a possibly-legacy feature key. */
|
|
getCanonicalKey: (key: string) => string;
|
|
/** Whether a feature is enabled, honoring legacy aliases. */
|
|
isFeatureEnabled: (features: Record<string, boolean>, key: string) => boolean;
|
|
/** Feature keys that are supported internally but should not render as user toggles. */
|
|
hiddenFeatureKeys?: ReadonlySet<string>;
|
|
}
|
|
export function ExperimentalSection({ scopeBanner, form, setForm, knownFeatures, legacyAliases, getCanonicalKey, isFeatureEnabled, hiddenFeatureKeys, }: ExperimentalSectionProps) {
|
|
const { t } = useTranslation("app");
|
|
const experimentalFeatures = form.experimentalFeatures ?? {};
|
|
const allFeatureKeys = Array.from(new Set([
|
|
...Object.keys(knownFeatures),
|
|
...Object.keys(experimentalFeatures).map(getCanonicalKey),
|
|
])).filter((key) => !hiddenFeatureKeys?.has(key)).sort((a, b) => a.localeCompare(b));
|
|
const featureFlags = allFeatureKeys.map((key) => [key, isFeatureEnabled(experimentalFeatures, key)] as const);
|
|
return (<>
|
|
{scopeBanner}
|
|
<h4 className="settings-section-heading">{t("settings.experimental.experimentalFeatures", "Experimental Features")}</h4>
|
|
<div className="form-group">
|
|
<small>{t("settings.experimental.experimentalFeaturesAreEarlyCapabilitiesThatAreNot", " Experimental features are early capabilities that are not yet fully stable. Enable them to test new functionality, but be aware they may change or be removed. Default: disabled for every feature flag below. ")}</small>
|
|
</div>
|
|
|
|
<div className="form-group">
|
|
<label>{t("settings.experimental.featureFlags", "Feature Flags")}</label>
|
|
<div style={{ display: "flex", flexDirection: "column", gap: "var(--space-sm)" }}>
|
|
{featureFlags.map(([key, enabled]) => (<label key={key} htmlFor={`experimental-${key}`} className="checkbox-label">
|
|
<input id={`experimental-${key}`} type="checkbox" checked={enabled} onChange={(e) => {
|
|
setForm((f) => {
|
|
const nextExperimentalFeatures = {
|
|
...(f.experimentalFeatures ?? {}),
|
|
[key]: e.target.checked,
|
|
};
|
|
for (const [legacyKey, canonicalKey] of Object.entries(legacyAliases)) {
|
|
if (canonicalKey === key) {
|
|
delete nextExperimentalFeatures[legacyKey];
|
|
}
|
|
}
|
|
return {
|
|
...f,
|
|
experimentalFeatures: nextExperimentalFeatures,
|
|
};
|
|
});
|
|
}}/>
|
|
<span>{knownFeatures[key] ?? key}</span>
|
|
</label>))}
|
|
</div>
|
|
</div>
|
|
</>);
|
|
}
|
|
export default ExperimentalSection;
|