feat: cross-OS profile sync

This commit is contained in:
zhom committed 2026-10-11 17:09:42 +04:00
1 parent b7a89ac94e
commit c359049e09
28 files changed
+532 -122

No files matched your search

+2 -1
View File
@@ -86,7 +86,7 @@ import { LaunchArgumentsEditor } from "@/components/wayfern-config-form";
import { WindowDragArea } from "@/components/window-drag-area";
import { useInputModality } from "@/hooks/use-input-modality";
import { translateBackendError } from "@/lib/backend-errors";
import { getProfileIcon } from "@/lib/browser-utils";
import { getProfileIcon, getProfileNativeOs } from "@/lib/browser-utils";
import { DNS_BLOCKLIST_LEVELS } from "@/lib/dns-blocklist-levels";
import { formatRelativeTime } from "@/lib/flag-utils";
import { MOTION_EASE_OUT } from "@/lib/motion";
@@ -2297,6 +2297,7 @@ function FingerprintSectionInline({
profileVersion={profile.version}
profileBrowser={profile.browser}
profileId={profile.id}
nativeOS={getProfileNativeOs(profile)}
/>
) : (
<>
+5 -10
View File
@@ -12,6 +12,7 @@ import {
} from "@/components/ui/dialog";
import { ScrollArea } from "@/components/ui/scroll-area";
import { translateBackendError } from "@/lib/backend-errors";
import { getProfileNativeOs } from "@/lib/browser-utils";
import type { BrowserProfile, WayfernConfig, WayfernOS } from "@/types";
import { LoadingButton } from "./loading-button";
import { RippleButton } from "./ui/ripple";
@@ -51,10 +52,8 @@ export function WayfernConfigDialog({
useEffect(() => {
if (profile?.browser === "wayfern") {
setConfig(
profile.wayfern_config || {
geoip: true,
os: getCurrentOS(),
},
// No `os` means the profile's native OS, which the form shows.
profile.wayfern_config || { geoip: true },
);
}
}, [profile]);
@@ -96,12 +95,7 @@ export function WayfernConfigDialog({
const handleClose = () => {
if (profile?.browser === "wayfern") {
setConfig(
profile.wayfern_config || {
geoip: true,
os: getCurrentOS(),
},
);
setConfig(profile.wayfern_config || { geoip: true });
}
onClose();
};
@@ -139,6 +133,7 @@ export function WayfernConfigDialog({
profileVersion={profile.version}
profileBrowser="wayfern"
profileId={profile.id}
nativeOS={getProfileNativeOs(profile)}
/>
</div>
</ScrollArea>
+10 -2
View File
@@ -183,6 +183,10 @@ interface WayfernConfigFormProps {
/// The saved profile whose persona is edited here. Absent while a profile is
/// being created: there is no seed yet, so there is no person to show.
profileId?: string;
/// The OS a fingerprint without an explicit `os` describes: the machine that
/// created the saved profile. It stays the profile's claim on every
/// computer, so it is shown and regenerated instead of this computer's OS.
nativeOS?: WayfernOS;
}
export function LaunchArgumentsEditor({
@@ -281,6 +285,7 @@ export function WayfernConfigForm({
profileVersion,
profileBrowser,
profileId,
nativeOS,
}: WayfernConfigFormProps) {
const { t } = useTranslation();
const [activeTab, setActiveTab] = useState(
@@ -296,7 +301,10 @@ export function WayfernConfigForm({
if (!profileVersion) return;
setIsGeneratingFingerprint(true);
try {
const configJson = JSON.stringify(config);
const configJson = JSON.stringify({
...config,
os: config.os ?? nativeOS,
});
const result = await invoke<GeneratedFingerprint>(
"generate_sample_fingerprint",
{
@@ -341,7 +349,7 @@ export function WayfernConfigForm({
void handleGenerateFingerprint();
};
const selectedOS = config.os || currentOS;
const selectedOS = config.os || nativeOS || currentOS;
useEffect(() => {
if (isCreating && typeof window !== "undefined") {