6 Commits

Author SHA1 Message Date
ayang
f02b8bb28a v0.2.0 2025-03-07 17:38:43 +08:00
ayangweb
e68e8f7954 refactor: optimized theme switching (#270) 2025-03-07 17:38:05 +08:00
ayangweb
18b6e1cbc9 chore: fallback version (#269) 2025-03-07 17:17:43 +08:00
Medcl
062e2873b4 fix: typo (#268)
* v0.2.0

* fix: typo

---------

Co-authored-by: ayang <473033518@qq.com>
2025-03-07 17:14:20 +08:00
Medcl
e75f4ce187 chore: update release notes (#267)
* chore: update release notes

* fix typo

* chore: update docs
2025-03-07 17:09:11 +08:00
BiggerRain
dbbc87523d fix: ws link (#266) 2025-03-07 15:50:43 +08:00
17 changed files with 73 additions and 23 deletions

View File

@@ -0,0 +1,20 @@
---
weight: 10
title: "Windows"
asciinema: true
---
# Windows
## Download Coco AI
Goto [https://coco.rs/](https://coco.rs/)
## Install Wizard
{{% load-img "/img/windows/1.png" "" %}}
{{% load-img "/img/windows/2.png" "" %}}
{{% load-img "/img/windows/3.png" "" %}}
{{% load-img "/img/windows/4.png" "" %}}
{{% load-img "/img/windows/5.jpeg" "" %}}

View File

@@ -11,15 +11,30 @@ Information about release notes of Coco Server is provided here.
### Features ### Features
### Breaking changes
### Bug fix
### Improvements
## 0.2.0 (2025-03-07)
### Features
- Add timeout to fusion search #174 - Add timeout to fusion search #174
- Add api to disable or enable server #185 - Add api to disable or enable server #185
- Networked search supports selection of data sources #209 - Networked search supports selection of data sources #209
- Add deepthink and knowledge search options to RAG based chat
- Support i18n, add Chinese language support
- Support Windows platform
- etc.
### Breaking changes ### Breaking changes
### Bug fix ### Bug fix
- Fix to access deeplink for linux #148 - Fix to access deeplink for linux #148
- etc.
### Improvements ### Improvements
@@ -32,9 +47,15 @@ Information about release notes of Coco Server is provided here.
- Refactor: the display of search results and the logic of creating new chats #207 - Refactor: the display of search results and the logic of creating new chats #207
- Refactor: AI conversation rendering logic #216 - Refactor: AI conversation rendering logic #216
- Refresh all server's info on purpose, get the actual health info #225 - Refresh all server's info on purpose, get the actual health info #225
- Improve chat message display
- Improve application search, support macOS/Windows and Linux
- Display the version of the server in the settings page
- Allow to switch between different data sources in networked search
- Allow to switch servers in the settings page
- etc.
## 0.1.0 (2015-02-16) ## 0.1.0 (2025-02-16)
### Features ### Features

BIN
docs/static/img/windows/1.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 KiB

BIN
docs/static/img/windows/2.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

BIN
docs/static/img/windows/3.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

BIN
docs/static/img/windows/4.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 KiB

BIN
docs/static/img/windows/5.jpeg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@@ -1,7 +1,7 @@
{ {
"name": "coco", "name": "coco",
"private": true, "private": true,
"version": "0.2.0-rc.1", "version": "0.2.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

2
src-tauri/Cargo.lock generated
View File

@@ -733,7 +733,7 @@ dependencies = [
[[package]] [[package]]
name = "coco" name = "coco"
version = "0.2.0-rc.1" version = "0.2.0"
dependencies = [ dependencies = [
"applications", "applications",
"async-trait", "async-trait",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "coco" name = "coco"
version = "0.2.0-rc.1" version = "0.2.0"
description = "Search, connect, collaborate all in one place." description = "Search, connect, collaborate all in one place."
authors = ["INFINI Labs"] authors = ["INFINI Labs"]
edition = "2021" edition = "2021"

View File

@@ -81,7 +81,7 @@ export function ChatHeader({
); );
if (currentServiceExists) { if (currentServiceExists) {
switchServer(currentServiceExists, true); switchServer(currentServiceExists);
} else { } else {
switchServer(enabledServers[enabledServers.length - 1]); switchServer(enabledServers[enabledServers.length - 1]);
} }
@@ -117,7 +117,7 @@ export function ChatHeader({
} }
}; };
const switchServer = async (server: IServer, isCurrent: boolean = false) => { const switchServer = async (server: IServer) => {
if (!server) return; if (!server) return;
try { try {
// Switch UI first, then switch server connection // Switch UI first, then switch server connection
@@ -132,10 +132,8 @@ export function ChatHeader({
} }
setIsLogin(true); setIsLogin(true);
// //
if (!(isCurrent && connected)) { await disconnect();
await disconnect(); reconnect && reconnect(server);
reconnect && reconnect(server);
}
} catch (error) { } catch (error) {
console.error("switchServer:", error); console.error("switchServer:", error);
} }

View File

@@ -8,9 +8,9 @@ import { useThemeStore } from "@/stores/themeStore";
const ConnectPrompt = () => { const ConnectPrompt = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const activeTheme = useThemeStore((state) => state.activeTheme); const isDark = useThemeStore((state) => state.isDark);
const logo = activeTheme === "dark" ? LoginDark : LoginLight; const logo = isDark ? LoginDark : LoginLight;
const handleConnect = async () => { const handleConnect = async () => {
emit("open_settings", "connect"); emit("open_settings", "connect");

View File

@@ -20,7 +20,7 @@ interface DataSourceItemProps {
export function DataSourceItem({ name, connector }: DataSourceItemProps) { export function DataSourceItem({ name, connector }: DataSourceItemProps) {
// const isConnected = true; // const isConnected = true;
const activeTheme = useThemeStore((state) => state.activeTheme); const isDark = useThemeStore((state) => state.isDark);
const connector_data = useConnectStore((state) => state.connector_data); const connector_data = useConnectStore((state) => state.connector_data);
const endpoint_http = useAppStore((state) => state.endpoint_http); const endpoint_http = useAppStore((state) => state.endpoint_http);
@@ -42,9 +42,7 @@ export function DataSourceItem({ name, connector }: DataSourceItemProps) {
const icons = connectorSource?.icon; const icons = connectorSource?.icon;
if (!icons) { if (!icons) {
return activeTheme === "dark" return isDark ? source_default_dark_img : source_default_img;
? source_default_dark_img
: source_default_img;
} }
if (icons?.startsWith("http://") || icons?.startsWith("https://")) { if (icons?.startsWith("http://") || icons?.startsWith("https://")) {

View File

@@ -8,9 +8,9 @@ import { useThemeStore } from "@/stores/themeStore";
export default function AboutView() { export default function AboutView() {
const { t } = useTranslation(); const { t } = useTranslation();
const activeTheme = useThemeStore((state) => state.activeTheme); const isDark = useThemeStore((state) => state.isDark);
const logo = activeTheme === "dark" ? logoDark : logoLight; const logo = isDark ? logoDark : logoLight;
return ( return (
<div className="flex justify-center items-center flex-col h-[calc(100vh-170px)]"> <div className="flex justify-center items-center flex-col h-[calc(100vh-170px)]">

View File

@@ -18,6 +18,8 @@ export default function Layout() {
const activeTheme = useThemeStore((state) => state.activeTheme); const activeTheme = useThemeStore((state) => state.activeTheme);
const setTheme = useThemeStore((state) => state.setTheme); const setTheme = useThemeStore((state) => state.setTheme);
const isDark = useThemeStore((state) => state.isDark);
const setIsDark = useThemeStore((state) => state.setIsDark);
function updateBodyClass(path: string) { function updateBodyClass(path: string) {
const body = document.body; const body = document.body;
@@ -34,10 +36,9 @@ export default function Layout() {
}); });
appWindow.onThemeChanged(({ payload }) => { appWindow.onThemeChanged(({ payload }) => {
console.log("onThemeChanged", payload);
if (activeTheme !== "auto") return; if (activeTheme !== "auto") return;
setTheme(payload); setIsDark(payload === "dark");
}); });
}); });
@@ -46,11 +47,19 @@ export default function Layout() {
await appWindow.setTheme(nextTheme); await appWindow.setTheme(nextTheme);
const root = window.document.documentElement; nextTheme = nextTheme ?? (await appWindow.theme());
root.className = nextTheme ?? "light";
root.dataset.theme = nextTheme ?? "light"; setIsDark(nextTheme === "dark");
}, [activeTheme]); }, [activeTheme]);
useEffect(() => {
const theme = isDark ? "dark" : "light";
const root = window.document.documentElement;
root.className = theme;
root.dataset.theme = theme;
}, [isDark]);
useEffect(() => { useEffect(() => {
updateBodyClass(location.pathname); updateBodyClass(location.pathname);
}, [location.pathname]); }, [location.pathname]);

View File

@@ -9,6 +9,8 @@ export type IThemeStore = {
themes: AppTheme[]; themes: AppTheme[];
activeTheme: AppTheme; activeTheme: AppTheme;
setTheme: (theme: AppTheme) => void; setTheme: (theme: AppTheme) => void;
isDark: boolean;
setIsDark: (isDark: boolean) => void;
}; };
export const useThemeStore = create<IThemeStore>()( export const useThemeStore = create<IThemeStore>()(
@@ -17,6 +19,8 @@ export const useThemeStore = create<IThemeStore>()(
themes: ["dark", "light", "auto"], themes: ["dark", "light", "auto"],
activeTheme: "auto", activeTheme: "auto",
setTheme: (activeTheme: AppTheme) => set(() => ({ activeTheme })), setTheme: (activeTheme: AppTheme) => set(() => ({ activeTheme })),
isDark: false,
setIsDark: (isDark: boolean) => set(() => ({ isDark })),
}), }),
{ {
name: "active-theme", name: "active-theme",