[WIP] Encryption for secure values (#183)

This commit is contained in:
Gregory Schier
2025-04-15 07:18:26 -07:00
committed by GitHub
parent e114a85c39
commit 2e55a1bd6d
208 changed files with 4063 additions and 28698 deletions

View File

@@ -1,31 +1,22 @@
import { emit } from '@tauri-apps/api/event';
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
import { setWindowTitle } from '@yaakapp-internal/mac-window';
import { useAtomValue } from 'jotai';
import { useEffect } from 'react';
import { jotaiStore } from '../lib/jotai';
import { resolvedModelName } from '../lib/resolvedModelName';
import { useActiveEnvironment } from './useActiveEnvironment';
import { activeRequestAtom } from './useActiveRequest';
import { activeWorkspaceAtom } from './useActiveWorkspace';
import { useAppInfo } from './useAppInfo';
import { useOsInfo } from './useOsInfo';
import { appInfo } from './useAppInfo';
export function useSyncWorkspaceRequestTitle() {
const activeWorkspace = useAtomValue(activeWorkspaceAtom);
const activeEnvironment = useActiveEnvironment();
const osInfo = useOsInfo();
const appInfo = useAppInfo();
const activeRequest = useAtomValue(activeRequestAtom);
useEffect(() => {
if (osInfo.osType == null) {
return;
}
let newTitle = activeWorkspace ? activeWorkspace.name : 'Yaak';
if (activeEnvironment) {
newTitle += ` [${activeEnvironment.name}]`;
}
const activeRequest = jotaiStore.get(activeRequestAtom);
if (activeRequest) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
newTitle += ` ${resolvedModelName(activeRequest)}`;
@@ -35,12 +26,6 @@ export function useSyncWorkspaceRequestTitle() {
newTitle = `[DEV] ${newTitle}`;
}
// TODO: This resets the stoplight position so we can't use it on macOS yet. So we send
// a custom command instead
if (osInfo.osType !== 'macos') {
getCurrentWebviewWindow().setTitle(newTitle).catch(console.error);
} else {
emit('yaak_title_changed', newTitle).catch(console.error);
}
}, [activeEnvironment, activeWorkspace, appInfo.isDev, osInfo.osType]);
setWindowTitle(newTitle);
}, [activeEnvironment, activeRequest, activeWorkspace]);
}