mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-21 17:09:09 +01:00
Add .oxfmtignore to skip generated bindings and wasm-pack output. Add npm format script, update DEVELOPMENT.md for Vite+ toolchain, and format all non-generated files with oxfmt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import { setWindowTitle } from "@yaakapp-internal/mac-window";
|
||
import { settingsAtom } from "@yaakapp-internal/models";
|
||
import { useAtomValue } from "jotai";
|
||
import { useEffect } from "react";
|
||
import { appInfo } from "../lib/appInfo";
|
||
import { jotaiStore } from "../lib/jotai";
|
||
import { resolvedModelName } from "../lib/resolvedModelName";
|
||
import { useActiveEnvironment } from "./useActiveEnvironment";
|
||
import { activeRequestAtom } from "./useActiveRequest";
|
||
import { activeWorkspaceAtom } from "./useActiveWorkspace";
|
||
|
||
export function useSyncWorkspaceRequestTitle() {
|
||
const activeWorkspace = useAtomValue(activeWorkspaceAtom);
|
||
const activeEnvironment = useActiveEnvironment();
|
||
const activeRequest = useAtomValue(activeRequestAtom);
|
||
|
||
useEffect(() => {
|
||
const settings = jotaiStore.get(settingsAtom);
|
||
let newTitle = activeWorkspace ? activeWorkspace.name : "Yaak";
|
||
if (activeEnvironment) {
|
||
newTitle += ` (${activeEnvironment.name})`;
|
||
}
|
||
|
||
if (!settings.useNativeTitlebar && activeRequest) {
|
||
newTitle += ` › ${resolvedModelName(activeRequest)}`;
|
||
}
|
||
|
||
if (appInfo.isDev) {
|
||
newTitle = `[DEV] ${newTitle}`;
|
||
}
|
||
|
||
setWindowTitle(newTitle);
|
||
}, [activeEnvironment, activeRequest, activeWorkspace]);
|
||
}
|