From a22024f64049371d5fd21cf7f830afd41a67ea8e Mon Sep 17 00:00:00 2001 From: BiggerRain <15911122312@163.COM> Date: Wed, 16 Apr 2025 11:19:23 +0800 Subject: [PATCH] style: modify the style (#370) * style: modify the style * style: adjust page style * style: web style * docs: update notes --- .env | 4 ++-- docs/content.en/docs/release-notes/_index.md | 1 + src-tauri/tauri.conf.json | 2 +- src/components/Assistant/Chat.tsx | 2 +- src/components/Common/UI/Footer.tsx | 2 +- src/components/Search/DropdownList.tsx | 2 +- src/components/Search/InputBox.tsx | 14 +++++++------- src/components/Search/ListRight.tsx | 11 +++-------- src/components/Search/SearchListItem.tsx | 8 ++++---- src/components/Search/SearchPopover.tsx | 11 ++++++----- src/components/Search/SearchResults.tsx | 2 +- src/components/SearchChat/index.tsx | 15 ++++++--------- .../Advanced/components/Shortcuts/index.tsx | 7 ++++--- src/main.css | 2 +- src/pages/web/index.tsx | 6 +++--- src/stores/shortcutsStore.ts | 4 ++-- src/types/index.ts | 3 +++ src/utils/platformAdapter.ts | 4 ++-- src/utils/webAdapter.ts | 2 +- src/web.css | 2 +- 20 files changed, 51 insertions(+), 53 deletions(-) diff --git a/.env b/.env index 12c95ae6..f12d7e00 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ -COCO_SERVER_URL=http://localhost:9000 https://coco.infini.cloud #http://localhost:9000 +COCO_SERVER_URL=https://coco.infini.cloud #http://localhost:9000 -COCO_WEBSOCKET_URL=ws://localhost:9000/ws wss://coco.infini.cloud/ws #ws://localhost:9000/ws \ No newline at end of file +COCO_WEBSOCKET_URL=wss://coco.infini.cloud/ws #ws://localhost:9000/ws \ No newline at end of file diff --git a/docs/content.en/docs/release-notes/_index.md b/docs/content.en/docs/release-notes/_index.md index fe99b9cd..9b867ebd 100644 --- a/docs/content.en/docs/release-notes/_index.md +++ b/docs/content.en/docs/release-notes/_index.md @@ -32,6 +32,7 @@ Information about release notes of Coco Server is provided here. - refactor: web components #331 - refactor: refactoring login callback, receive access_token from coco-server - chore: adjust web component styles #362 +- style: modify the style #370 ## 0.3.0 (2025-03-31) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 8e16b1dc..2fa68971 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -31,7 +31,7 @@ "visible": false, "windowEffects": { "effects": [], - "radius": 12 + "radius": 6 }, "visibleOnAllWorkspaces": true, "alwaysOnTop": true diff --git a/src/components/Assistant/Chat.tsx b/src/components/Assistant/Chat.tsx index 4a126507..671f68cc 100644 --- a/src/components/Assistant/Chat.tsx +++ b/src/components/Assistant/Chat.tsx @@ -367,7 +367,7 @@ const ChatAI = memo( return (
{showChatHistory && !setIsSidebarOpen && ( {isTauri ? (
diff --git a/src/components/Search/DropdownList.tsx b/src/components/Search/DropdownList.tsx index 958f366f..4326edc4 100644 --- a/src/components/Search/DropdownList.tsx +++ b/src/components/Search/DropdownList.tsx @@ -158,7 +158,7 @@ function DropdownList({
{showError ? ( diff --git a/src/components/Search/InputBox.tsx b/src/components/Search/InputBox.tsx index 31ec8322..b7391815 100644 --- a/src/components/Search/InputBox.tsx +++ b/src/components/Search/InputBox.tsx @@ -287,7 +287,7 @@ export default function ChatInput({ return (
{!isChatMode && !sourceData ? ( @@ -428,7 +428,7 @@ export default function ChatInput({ className="flex justify-between items-center py-2" > {isChatMode ? ( -
+
{/* {sessionId && ( - + {isDeepThinkActive && ( {t("search.input.deepThink")} diff --git a/src/components/Search/ListRight.tsx b/src/components/Search/ListRight.tsx index 3f1d267e..d01ef685 100644 --- a/src/components/Search/ListRight.tsx +++ b/src/components/Search/ListRight.tsx @@ -1,6 +1,5 @@ import TypeIcon from "@/components/Common/Icons/TypeIcon"; import RichIcon from "@/components/Common/Icons/RichIcon"; -import { useAppStore } from "@/stores/appStore"; interface ListRightProps { item: any; @@ -17,17 +16,13 @@ export default function ListRight({ currentIndex, goToTwoPage, }: ListRightProps) { - const isTauri = useAppStore((state) => state.isTauri); - return (
{item?.rich_categories ? null : (
{ e.stopPropagation(); goToTwoPage && goToTwoPage(item); @@ -48,7 +43,7 @@ export default function ListRight({
{ e.stopPropagation(); goToTwoPage && goToTwoPage(item); diff --git a/src/components/Search/SearchListItem.tsx b/src/components/Search/SearchListItem.tsx index 37a49823..cb053089 100644 --- a/src/components/Search/SearchListItem.tsx +++ b/src/components/Search/SearchListItem.tsx @@ -42,16 +42,16 @@ const SearchListItem: React.FC = React.memo(({ ref={itemRef} onMouseEnter={onMouseEnter} onClick={onItemClick} - className={`w-full px-2 py-2.5 text-sm flex items-center justify-between rounded-lg transition-colors cursor-pointer ${ + className={`w-full px-2 py-2.5 md:mb-0 mb-2 text-sm flex md:flex-row flex-col md:items-center items-start justify-between rounded-lg transition-colors cursor-pointer ${ isSelected ? "text-white bg-[var(--coco-primary-color)] hover:bg-[var(--coco-primary-color)]" - : "text-[#333] dark:text-[#d8d8d8]" - } ${showListRight ? "gap-7" : ""}`} + : "text-[#333] dark:text-[#d8d8d8] md:bg-transparent bg-gray-200/80 dark:bg-gray-700/50" + } ${showListRight ? "md:gap-7 gap-1" : ""}`} onContextMenu={onContextMenu} >
diff --git a/src/components/Search/SearchPopover.tsx b/src/components/Search/SearchPopover.tsx index 8d4b1d8f..365dd678 100644 --- a/src/components/Search/SearchPopover.tsx +++ b/src/components/Search/SearchPopover.tsx @@ -188,16 +188,16 @@ export default function SearchPopover({ return (
- + {t("search.input.search")} @@ -229,9 +229,10 @@ export default function SearchPopover({ onKeypress={() => { buttonRef.current?.click(); }} + className="!size-3" > +
{/* Left Panel */}
}> { useEffect(() => { const unlisten = useShortcutsStore.subscribe((state) => { - emit("change-shortcuts-store", state); + platformAdapter.emitEvent("change-shortcuts-store", state); }); return unlisten; diff --git a/src/main.css b/src/main.css index e929c11e..23690395 100644 --- a/src/main.css +++ b/src/main.css @@ -96,7 +96,7 @@ } .input-body { - @apply rounded-xl overflow-hidden; + @apply rounded-md overflow-hidden; } .icon { diff --git a/src/pages/web/index.tsx b/src/pages/web/index.tsx index 349e1feb..26e83599 100644 --- a/src/pages/web/index.tsx +++ b/src/pages/web/index.tsx @@ -31,7 +31,7 @@ function WebApp({ height = 590, headers = { "X-API-TOKEN": - "cvqt6r02sdb2v3bkgip0x3ixv01f3r2lhnxoz1efbn160wm9og58wtv8t6wrv1ebvnvypuc23dx9pb33aemh", + "cvv8e2ehpcevm89r0khg8iesn4hbuzhxvy3y621n0ca2cqs3vw46mhs91yr5us82emdg46r0qtrt23nl1lux", "APP-INTEGRATION-ID": "cvkm9hmhpcemufsg3vug", }, // token = "cva1j5ehpcenic3ir7k0h8fb8qtv35iwtywze248oscrej8yoivhb5b1hyovp24xejjk27jy9ddt69ewfi3n", // https://coco.infini.cloud @@ -41,7 +41,7 @@ function WebApp({ hideCoco = () => {}, hasModules = ["search", "chat"], defaultModule = "search", - hasFeature = ["search", "think_active", "search_active"], + hasFeature = ["search", "think", "think_active", "search_active"], theme = "dark", searchPlaceholder = "", chatPlaceholder = "", @@ -142,7 +142,7 @@ function WebApp({ {isMobile() && (
diff --git a/src/stores/shortcutsStore.ts b/src/stores/shortcutsStore.ts index ac7c355a..c9720fcc 100644 --- a/src/stores/shortcutsStore.ts +++ b/src/stores/shortcutsStore.ts @@ -1,8 +1,8 @@ -import { isMac } from "@/utils/platform"; import { create } from "zustand"; import { persist } from "zustand/middleware"; -export type ModifierKey = "meta" | "ctrl" | "alt"; +import { isMac } from "@/utils/platform"; +import { ModifierKey } from "@/types/index"; export type IShortcutsStore = { modifierKey: ModifierKey; diff --git a/src/types/index.ts b/src/types/index.ts index c1d07ed5..4d7992bd 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,2 +1,5 @@ export type AppEndpoint = string + export type AppTheme = "auto" | "light" | "dark" + +export type ModifierKey = "meta" | "ctrl" | "alt"; diff --git a/src/utils/platformAdapter.ts b/src/utils/platformAdapter.ts index 7b353038..7afb9240 100644 --- a/src/utils/platformAdapter.ts +++ b/src/utils/platformAdapter.ts @@ -1,8 +1,8 @@ // manual modification -// import { createWebAdapter } from './webAdapter'; +//import { createWebAdapter } from './webAdapter'; import { createTauriAdapter } from "./tauriAdapter"; let platformAdapter = createTauriAdapter(); -// let platformAdapter: WebPlatformAdapter = createWebAdapter(); +//let platformAdapter = createWebAdapter(); export default platformAdapter; diff --git a/src/utils/webAdapter.ts b/src/utils/webAdapter.ts index 41b9042e..b98289cd 100644 --- a/src/utils/webAdapter.ts +++ b/src/utils/webAdapter.ts @@ -171,7 +171,7 @@ export const createWebAdapter = (): WebPlatformAdapter => { isWindows10: async () => false, async setShadow(enable) { - console.warn("setShadow is not supported in web environment", enable); + console.log("setShadow is not supported in web environment", enable); return Promise.resolve(); }, }; diff --git a/src/web.css b/src/web.css index 31c0cdb6..dace74d1 100644 --- a/src/web.css +++ b/src/web.css @@ -155,7 +155,7 @@ body, .input-body { overflow: hidden; - border-radius: 0.75rem; + border-radius: 0.375rem; } .icon {