From 8d9f677c4e9ccfcc6dc9297864dc49446fb5ee59 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Wed, 10 Jul 2024 15:56:33 +0100 Subject: feat(gui): use fancy new side nav (#2243) * feat(gui): use fancy new side nav * compact only sidebar, no expand-collapse * custom drag region, remove titlebar * add user popup * wire up login/logout/register, move user button to bottom and add menu * link help and feedback to forum --- ui/backend/Cargo.lock | 1 + ui/backend/Cargo.toml | 7 +++++-- ui/backend/capabilities/migrated.json | 1 + ui/backend/src/main.rs | 11 +++++++++++ ui/backend/tauri.conf.json | 4 +++- 5 files changed, 21 insertions(+), 3 deletions(-) (limited to 'ui/backend') diff --git a/ui/backend/Cargo.lock b/ui/backend/Cargo.lock index 827fd09b..105ad65f 100644 --- a/ui/backend/Cargo.lock +++ b/ui/backend/Cargo.lock @@ -6481,6 +6481,7 @@ dependencies = [ "atuin-dotfiles", "atuin-history", "bytes", + "cocoa", "comrak", "eyre", "nix 0.29.0", diff --git a/ui/backend/Cargo.toml b/ui/backend/Cargo.toml index d027e152..3e4c61ca 100644 --- a/ui/backend/Cargo.toml +++ b/ui/backend/Cargo.toml @@ -18,7 +18,7 @@ atuin-dotfiles = { path = "../../crates/atuin-dotfiles", version = "0.4.0" } atuin-history = { path = "../../crates/atuin-history", version = "0.3.0" } eyre = "0.6" -tauri = { version = "2.0.0-beta", features = ["tray-icon"] } +tauri = { version = "2.0.0-beta", features = [ "tray-icon"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" time = "0.3.36" @@ -29,11 +29,14 @@ tauri-plugin-single-instance = "2.0.0-beta" tokio = "1.38.0" tauri-plugin-shell = "2.0.0-beta.7" comrak = "0.22" -portable-pty = "0.8.1" +portable-pty = "0.8.1" vt100 = "0.15.2" bytes = "1.6.0" nix = "0.29.0" +[target."cfg(target_os = \"macos\")".dependencies] +cocoa = "0.25" + [dependencies.sqlx] version = "0.7" features = ["runtime-tokio-rustls", "time", "postgres", "uuid"] diff --git a/ui/backend/capabilities/migrated.json b/ui/backend/capabilities/migrated.json index e740ab1e..08e88a36 100644 --- a/ui/backend/capabilities/migrated.json +++ b/ui/backend/capabilities/migrated.json @@ -15,6 +15,7 @@ "sql:allow-load", "sql:allow-execute", "sql:allow-select", + "window:allow-start-dragging", { "identifier": "http:default", "allow": ["https://api.atuin.sh/*"] diff --git a/ui/backend/src/main.rs b/ui/backend/src/main.rs index 7adbbbe5..147bf413 100644 --- a/ui/backend/src/main.rs +++ b/ui/backend/src/main.rs @@ -110,6 +110,16 @@ async fn login(username: String, password: String, key: String) -> Result Result<(), String> { + let settings = Settings::new().map_err(|e| e.to_string())?; + + atuin_client::logout::logout(&settings) + .map_err(|e| e.to_string())?; + + Ok(()) +} + #[tauri::command] async fn register(username: String, email: String, password: String) -> Result { let settings = Settings::new().map_err(|e| e.to_string())?; @@ -257,6 +267,7 @@ fn main() { config, session, login, + logout, register, history_calendar, run::pty::pty_open, diff --git a/ui/backend/tauri.conf.json b/ui/backend/tauri.conf.json index 910b453d..c8565721 100644 --- a/ui/backend/tauri.conf.json +++ b/ui/backend/tauri.conf.json @@ -15,7 +15,9 @@ "width": 1200, "height": 800, "minWidth": 1000, - "minHeight": 500 + "minHeight": 500, + "titleBarStyle": "Overlay", + "hiddenTitle": true } ] }, -- cgit v1.3.1