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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user