mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-16 21:51:13 +01:00
Apply the approved wording table: labels stay short, explanations are one full sentence about the user's traffic, and detail moves behind an info icon on the first-run card, the body banners, the Settings Helper row and the rejected card. One word per thing: traffic and flows, recorded, truncated, domains, searches, the CLI, Retry. Backend messages that reach the window change with them, with the tests and harness fixtures that assert on the old text. The two working files for the pass are removed from the branch. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
30 lines
969 B
TypeScript
30 lines
969 B
TypeScript
import { openUrl, revealItemInDir } from "@tauri-apps/plugin-opener";
|
|
|
|
/** Says what failed, as a toast, rather than leaving a button that does nothing */
|
|
export type ReportFailure = (message: string) => void;
|
|
|
|
/** Shows a file or folder in the platform's file manager */
|
|
export async function revealPath(path: string, report: ReportFailure): Promise<void> {
|
|
try {
|
|
await revealItemInDir(path);
|
|
} catch (err) {
|
|
report(`Failed to reveal ${path}: ${String(err)}`);
|
|
}
|
|
}
|
|
|
|
/** Opens a link in the default browser */
|
|
export async function openLink(url: string, report: ReportFailure): Promise<void> {
|
|
try {
|
|
await openUrl(url);
|
|
} catch (err) {
|
|
report(`Failed to open ${url}: ${String(err)}`);
|
|
}
|
|
}
|
|
|
|
/** What the platform calls showing a file in its file manager */
|
|
export function revealLabel(os: string): string {
|
|
if (os === "macos") return "Reveal in Finder";
|
|
if (os === "windows") return "Show in Explorer";
|
|
return "Show in File Manager";
|
|
}
|