Skip unrelated required checks without losing their names (#2542)
* fix(ci): skip unrelated required checks cleanly Matrix jobs had to start no-op runners to preserve interpolated required-check names. Static named jobs let GitHub report genuine skipped conclusions while keeping those names stable. * fix(ci): gate changes to install patching script * fix(ci): route cross-package test contracts narrowly * fix(ci): keep routed contracts merge-blocking * fix(server): exclude nested test utilities from builds * fix(ci): cover app-owned native and browser domains * refactor(ci): align tests with runtime domains Own browser specs, desktop specs, and Electron-only app code by stable directories so PR routing does not depend on filename conventions. Keep desktop integration coverage inside the required desktop check. * fix(ci): keep routing and desktop suites isolated The routing regression must run before dependency installation, and desktop Vitest must not collect Playwright-owned specs. * fix(ci): isolate desktop e2e runtime * perf(test): isolate Playwright workers * perf(test): parallelize Playwright within specs * fix(test): keep Playwright file scheduling * fix(test): share dynamic Metro fixture * fix(test): preserve own-host restart fixtures * fix(ci): preserve routed contracts after rebase * Stabilize Playwright wheel-scroll assertions
This commit is contained in:
@@ -1,80 +0,0 @@
|
||||
import { useCallback, useRef, useState } from "react";
|
||||
import { Text, View } from "react-native";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useToast } from "@/contexts/toast-context";
|
||||
import { getDesktopHost } from "@/desktop/host";
|
||||
import { SettingsSection } from "@/screens/settings/settings-section";
|
||||
import { useBrowserStore } from "@/stores/browser-store";
|
||||
import { settingsStyles } from "@/styles/settings";
|
||||
import { confirmDialog } from "@/utils/confirm-dialog";
|
||||
|
||||
export function BrowserDataSection() {
|
||||
const { t } = useTranslation();
|
||||
const toast = useToast();
|
||||
const clearInFlightRef = useRef(false);
|
||||
const [isClearing, setIsClearing] = useState(false);
|
||||
|
||||
const handleClear = useCallback(async () => {
|
||||
if (clearInFlightRef.current) {
|
||||
return;
|
||||
}
|
||||
|
||||
clearInFlightRef.current = true;
|
||||
setIsClearing(true);
|
||||
try {
|
||||
const confirmed = await confirmDialog({
|
||||
title: t("settings.general.browserData.confirmTitle"),
|
||||
message: t("settings.general.browserData.confirmMessage"),
|
||||
confirmLabel: t("settings.general.browserData.clear"),
|
||||
cancelLabel: t("common.actions.cancel"),
|
||||
destructive: true,
|
||||
});
|
||||
if (!confirmed) {
|
||||
return;
|
||||
}
|
||||
|
||||
const clearProfile = getDesktopHost()?.browser?.clearProfile;
|
||||
if (!clearProfile) {
|
||||
throw new Error("Electron browser profile bridge is unavailable");
|
||||
}
|
||||
|
||||
await clearProfile(Object.keys(useBrowserStore.getState().browsersById));
|
||||
toast.show(t("settings.general.browserData.success"), { variant: "success" });
|
||||
} catch {
|
||||
toast.error(t("settings.general.browserData.error"));
|
||||
} finally {
|
||||
clearInFlightRef.current = false;
|
||||
setIsClearing(false);
|
||||
}
|
||||
}, [t, toast]);
|
||||
const clearButtonLabel = isClearing
|
||||
? t("settings.general.browserData.clearing")
|
||||
: t("settings.general.browserData.clear");
|
||||
|
||||
return (
|
||||
<SettingsSection title={t("settings.general.browserData.title")}>
|
||||
<View style={settingsStyles.card}>
|
||||
<View style={settingsStyles.row}>
|
||||
<View style={settingsStyles.rowContent}>
|
||||
<Text style={settingsStyles.rowTitle}>
|
||||
{t("settings.general.browserData.siteData")}
|
||||
</Text>
|
||||
<Text style={settingsStyles.rowHint}>
|
||||
{t("settings.general.browserData.description")}
|
||||
</Text>
|
||||
</View>
|
||||
<Button
|
||||
variant="destructive"
|
||||
size="sm"
|
||||
loading={isClearing}
|
||||
disabled={isClearing}
|
||||
onPress={handleClear}
|
||||
>
|
||||
{clearButtonLabel}
|
||||
</Button>
|
||||
</View>
|
||||
</View>
|
||||
</SettingsSection>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user