diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index e58ded3b..3d3eb238 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -197,11 +197,14 @@ fn enable_tray(app: &mut tauri::App) { }; let quit_i = MenuItem::with_id(app, "quit", "Quit Coco", true, None::<&str>).unwrap(); - let settings_i = MenuItem::with_id(app, "settings", "Settings", true, None::<&str>).unwrap(); + let settings_i = MenuItem::with_id(app, "settings", "Settings...", true, None::<&str>).unwrap(); let open_i = MenuItem::with_id(app, "open", "Open Coco", true, None::<&str>).unwrap(); + let about_i = MenuItem::with_id(app, "about", "About Coco", true, None::<&str>).unwrap(); let menu = MenuBuilder::new(app) .item(&open_i) + .separator() + .item(&about_i) .item(&settings_i) .separator() .item(&quit_i) @@ -212,18 +215,12 @@ fn enable_tray(app: &mut tauri::App) { .icon(app.default_window_icon().unwrap().clone()) .menu(&menu) .on_menu_event(|app, event| match event.id.as_ref() { - "show" => { - // let win = app.get_webview_window("main").unwrap(); - // match win.is_visible() { - // Ok(visible) if !visible => { - // win.show().unwrap(); - // } - // Err(e) => eprintln!("{}", e), - // _ => (), - // }; - // win.set_focus().unwrap(); + "open" => { handle_open_coco(app); } + "about" => { + let _ = app.emit("open_settings", "about"); + } "settings" => { // windows failed to open second window, issue: https://github.com/tauri-apps/tauri/issues/11144 //#[cfg(windows)] @@ -255,9 +252,11 @@ fn open_settings(app: &tauri::App) { } else { let window = tauri::window::WindowBuilder::new(app, "settings") .title("Settings Window") - .inner_size(800.0, 600.0) - .resizable(true) .fullscreen(false) + .resizable(false) + .minimizable(false) + .maximizable(false) + .inner_size(800.0, 600.0) .build() .unwrap(); diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 39185d09..4db64869 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -1,23 +1,30 @@ -import { Menu, MenuButton, MenuItems, MenuItem } from "@headlessui/react"; -import { Settings, LogOut, User, ChevronUp, Home } from "lucide-react"; -import { Link } from "react-router-dom"; +import { + Menu, + MenuButton, + // MenuItems, MenuItem +} from "@headlessui/react"; +// import { Settings, LogOut, User, ChevronUp, Home } from "lucide-react"; +// import { Link } from "react-router-dom"; -import logoImg from "../assets/32x32.png" +import logoImg from "../assets/32x32.png"; const Footer = () => { return (
- - + + Coco - + {/* */} - + {/*
{({ active }) => ( @@ -77,17 +84,17 @@ const Footer = () => { )}
-
+
*/}
Version 1.0.0 -
+ {/*
+ */}
diff --git a/src/components/Settings/AboutView.tsx b/src/components/Settings/AboutView.tsx new file mode 100644 index 00000000..14bcaa99 --- /dev/null +++ b/src/components/Settings/AboutView.tsx @@ -0,0 +1,48 @@ +export default function AboutView(){ + return
+
+
+

+ Coco AI - Connect & Collaborate +

+

+ "Coco AI - search, connect, collaborate – all in one + place." +

+
+ +
+

+ What is Coco AI? +

+

+ Coco AI is a unified search platform that connects + all your enterprise applications and data—Google + Workspace, Dropbox, Confluent Wiki, GitHub, and + more—into a single, powerful search interface. +

+

+ The app allows users to search and interact with + their enterprise data across platforms. +

+
+ +
+

+ Gen-AI Chat for Teams +

+

+ Imagine{" "} + ChatGPT, but + tailored to your team’s unique knowledge and + internal resources. +

+

+ Coco AI enhances collaboration by making information + instantly accessible and providing AI-driven + insights based on your enterprise's specific data. +

+
+
+
+} \ No newline at end of file diff --git a/src/components/Settings/index2.tsx b/src/components/Settings/index2.tsx index d1982985..62aa735f 100644 --- a/src/components/Settings/index2.tsx +++ b/src/components/Settings/index2.tsx @@ -1,9 +1,11 @@ -import { createContext, useContext, useState } from "react"; +import { createContext, useContext, useEffect, useState } from "react"; import { Tab, TabGroup, TabList, TabPanel, TabPanels } from "@headlessui/react"; import { Settings, Puzzle, User, Users, Settings2, Info } from "lucide-react"; +import { useSearchParams } from "react-router-dom"; import SettingsPanel from "./SettingsPanel"; import GeneralSettings from "./GeneralSettings"; +import AboutView from "./AboutView"; import Footer from "../Footer"; export type Theme = "light" | "dark" | "system"; @@ -18,6 +20,14 @@ export const ThemeContext = createContext<{ function SettingsPage() { const [theme, setTheme] = useState("system"); + const [defaultIndex, setDefaultIndex] = useState(0); + + const [searchParams] = useSearchParams(); + const name = searchParams.get("tab"); + + useEffect(() => { + setDefaultIndex(name === "about" ? 5 : 0); + }, [name]); const tabs = [ { name: "General", icon: Settings }, @@ -37,7 +47,12 @@ function SettingsPage() {

Coco Settings

*/} - + { + setDefaultIndex(index); + }} + > {tabs.map((tab) => ( -
- About settings content -
+
diff --git a/src/hooks/useWindows.ts b/src/hooks/useWindows.ts index 0ed7a027..45c432cc 100644 --- a/src/hooks/useWindows.ts +++ b/src/hooks/useWindows.ts @@ -98,6 +98,10 @@ export const useWindows = () => { listen("open_settings", (event) => { console.log("open_settings", event); + let url = "/ui/settings" + if (event.payload==="about") { + url = "/ui/settings?tab=about" + } createWin({ label: "settings", title: "Settings Window", @@ -107,7 +111,9 @@ export const useWindows = () => { height: 600, decorations: true, closable: true, - url: "/ui/settings", + minimizable: false, + maximizable: false, + url, }); }); }, [appWindow, createWin]);