fix: improve session export and empty chat states

Move session export into the sidebar menu
Add desktop save-and-reveal flow for exported markdown
Show empty-state UI instead of a loading skeleton for empty sessions
This commit is contained in:
Bohdan Triapitsyn
2026-04-17 15:33:26 +03:00
parent a17d159e18
commit 71eac0d2f6
7 changed files with 192 additions and 40 deletions
+26
View File
@@ -502,6 +502,32 @@ export const openDesktopPath = async (path: string, app?: string | null): Promis
}
};
export const saveDesktopMarkdownFile = async (
defaultFileName: string,
content: string,
): Promise<string | null> => {
if (!isTauriShell() || !isDesktopLocalOriginActive()) {
return null;
}
const trimmedFileName = defaultFileName?.trim();
if (!trimmedFileName) {
return null;
}
try {
const tauri = (window as unknown as { __TAURI__?: TauriGlobal }).__TAURI__;
const result = await tauri?.core?.invoke?.('desktop_save_markdown_file', {
defaultFileName: trimmedFileName,
content,
});
return typeof result === 'string' && result.trim().length > 0 ? result : null;
} catch (error) {
console.warn('Failed to save markdown file (tauri)', error);
return null;
}
};
export const openDesktopProjectInApp = async (
projectPath: string,
appId: string,