fix(settings): sync auto-settle and other shared preferences across environments (#9147)
Co-authored-by: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
5014e5fcdd
commit
8efd4e95fc
10 files changed
+489
-44
No files matched your search
@@ -112,6 +112,7 @@ import {
|
||||
TYPOGRAPHY_ADVANCED_STORAGE_KEY,
|
||||
} from "../../appearanceFonts";
|
||||
import { CodeFontPreview, PromptFontPreview, TerminalFontPreview } from "./SettingsFontPreviews";
|
||||
import { SharedSettingsMismatchAlert } from "./SharedSettingsMismatchAlert";
|
||||
import { discoverInstalledFonts, FontFamilyPicker, useFontEnumeration } from "./FontFamilyPicker";
|
||||
import {
|
||||
NumberField,
|
||||
@@ -1928,6 +1929,7 @@ export function GeneralSettingsPanel() {
|
||||
|
||||
return (
|
||||
<SettingsPageContainer>
|
||||
<SharedSettingsMismatchAlert />
|
||||
<SettingsSection title="General">
|
||||
<SettingsRow
|
||||
{...searchableSetting("project-grouping")}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import { TriangleAlertIcon } from "lucide-react";
|
||||
|
||||
import { useSharedSettingsSync } from "../../hooks/useSettings";
|
||||
import { Alert, AlertAction, AlertDescription } from "../ui/alert";
|
||||
import { Button } from "../ui/button";
|
||||
|
||||
/**
|
||||
* Warns when a connected environment holds different shared settings than
|
||||
* the primary one, and offers to write the primary's values everywhere.
|
||||
* Renders nothing when every connected environment agrees.
|
||||
*/
|
||||
export function SharedSettingsMismatchAlert() {
|
||||
const { mismatches, applyToAll } = useSharedSettingsSync();
|
||||
if (mismatches.length === 0) {
|
||||
return null;
|
||||
}
|
||||
const labels = mismatches.map((mismatch) => mismatch.label).join(", ");
|
||||
return (
|
||||
<Alert variant="warning" className="mx-3 sm:mx-4">
|
||||
<TriangleAlertIcon />
|
||||
<AlertDescription>
|
||||
Settings differ on {labels}. Thread and source control preferences are meant to match on
|
||||
every environment.
|
||||
</AlertDescription>
|
||||
<AlertAction>
|
||||
<Button variant="outline" size="compact" onClick={applyToAll}>
|
||||
Apply to all
|
||||
</Button>
|
||||
</AlertAction>
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
} from "@t3tools/shared/backgroundActivitySettings";
|
||||
|
||||
import { usePrimarySettings, useUpdatePrimarySettings } from "../../hooks/useSettings";
|
||||
import { SharedSettingsMismatchAlert } from "./SharedSettingsMismatchAlert";
|
||||
import { cn } from "../../lib/utils";
|
||||
import { useEnvironments, usePrimaryEnvironment } from "../../state/environments";
|
||||
import { useEnvironmentQuery } from "../../state/query";
|
||||
@@ -548,6 +549,7 @@ export function SourceControlSettingsPanel() {
|
||||
|
||||
return (
|
||||
<SettingsPageContainer>
|
||||
<SharedSettingsMismatchAlert />
|
||||
{isInitialScanPending ? (
|
||||
<>
|
||||
<SourceControlSectionSkeleton title="Version Control" headerAction={scanButton} />
|
||||
|
||||
Reference in new issue
Block a user