feat: session manger (#867)

* feat: init session manger

* feat: persist selected app to localStorage

- Save app selection when switching providers
- Restore last selected app on page load

* feat: persist current view to localStorage

- Save view selection when switching tabs
- Restore last selected view on page load

* styles: update ui

* feat: Improve macOS Terminal activation and refactor Kitty launch to use  command with user's default shell.

* fix: session view

* feat: toc

* feat: Implement FlexSearch for improved session search functionality.

* feat: Redesign session manager search and filter UI for a more compact and dynamic experience.

* refactor: modularize session manager by extracting components and utility functions into dedicated files.

* feat: Enhance session terminal launching with support for iTerm2, Ghostty, WezTerm, and Alacritty, including UI and custom configuration options.

* feat: Conditionally render terminal selection and resume session buttons only on macOS.
This commit is contained in:
TinsFox
2026-02-02 11:12:30 +08:00
committed by GitHub
parent 58153333ce
commit f0e8ba1d8f
32 changed files with 2926 additions and 32 deletions
+1
View File
@@ -7,6 +7,7 @@ export { skillsApi } from "./skills";
export { usageApi } from "./usage";
export { vscodeApi } from "./vscode";
export { proxyApi } from "./proxy";
export { sessionsApi } from "./sessions";
export * as configApi from "./config";
export type { ProviderSwitchEvent } from "./providers";
export type { Prompt } from "./prompts";
+30
View File
@@ -0,0 +1,30 @@
import { invoke } from "@tauri-apps/api/core";
import type { SessionMessage, SessionMeta } from "@/types";
export const sessionsApi = {
async list(): Promise<SessionMeta[]> {
return await invoke("list_sessions");
},
async getMessages(
providerId: string,
sourcePath: string
): Promise<SessionMessage[]> {
return await invoke("get_session_messages", { providerId, sourcePath });
},
async launchTerminal(options: {
target: string;
command: string;
cwd?: string | null;
customConfig?: string | null;
}): Promise<boolean> {
const { target, command, cwd, customConfig } = options;
return await invoke("launch_session_terminal", {
target,
command,
cwd,
customConfig,
});
},
};