From a6b6a09af07a01fb5cf0d88059373dbf7b76d54e Mon Sep 17 00:00:00 2001 From: SteveLauC Date: Wed, 31 Dec 2025 14:04:45 +0800 Subject: [PATCH 1/4] refactor: format Coco server update time in settings (#1040) Previously, the last update time of the Coco server in the "Connect" settings page was displayed using the raw string directly from the `updated` field, which lacked consistent formatting. This commit refactors the `ServiceMetadata` component to use the `formatDateToLocal` utility function. This ensures the update time is displayed in a standardized `YYYY/MM/DD HH:mm:ss` format and provides a fallback value if the date is invalid or missing. --- docs/content.en/docs/release-notes/_index.md | 1 + src/components/Cloud/ServiceMetadata.tsx | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/content.en/docs/release-notes/_index.md b/docs/content.en/docs/release-notes/_index.md index b49b6ba4..09c2da59 100644 --- a/docs/content.en/docs/release-notes/_index.md +++ b/docs/content.en/docs/release-notes/_index.md @@ -27,6 +27,7 @@ Information about release notes of Coco App is provided here. ### ✈️ Improvements - refactor: add a timeout to open() #1025 +- refactor: format Coco server update time in settings #1040 ## 0.10.0 (2025-12-19) diff --git a/src/components/Cloud/ServiceMetadata.tsx b/src/components/Cloud/ServiceMetadata.tsx index 01a1a5fa..4c220b29 100644 --- a/src/components/Cloud/ServiceMetadata.tsx +++ b/src/components/Cloud/ServiceMetadata.tsx @@ -2,6 +2,7 @@ import { memo } from "react"; import { PackageOpen, GitFork, CalendarSync } from "lucide-react"; import { useConnectStore } from "@/stores/connectStore"; +import { formatDateToLocal } from "@/utils/date"; interface ServiceMetadataProps {} @@ -20,7 +21,7 @@ const ServiceMetadata = memo(({}: ServiceMetadataProps) => { | - {cloudSelectService?.updated} + {formatDateToLocal(cloudSelectService?.updated)}

From d00c07e8eceda1bfb2de0d094ad3044acf1c129e Mon Sep 17 00:00:00 2001 From: ayangweb <75017711+ayangweb@users.noreply.github.com> Date: Wed, 31 Dec 2025 14:13:22 +0800 Subject: [PATCH 2/4] refactor: remove the pin button in the standalone window (#1041) * refactor: remove the pin button in the standalone window * refactor: update --- src/components/Common/TogglePin.tsx | 39 +++++++++++++++++++---------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/src/components/Common/TogglePin.tsx b/src/components/Common/TogglePin.tsx index 36d9ff19..56c0eb09 100644 --- a/src/components/Common/TogglePin.tsx +++ b/src/components/Common/TogglePin.tsx @@ -1,10 +1,14 @@ -import { useAppStore } from "@/stores/appStore"; -import { useShortcutsStore } from "@/stores/shortcutsStore"; +import { FC, HTMLAttributes, useState } from "react"; +import { useMount } from "ahooks"; import clsx from "clsx"; + import VisibleKey from "./VisibleKey"; -import { FC, HTMLAttributes } from "react"; import PinOffIcon from "@/icons/PinOff"; import PinIcon from "@/icons/Pin"; +import platformAdapter from "@/utils/platformAdapter"; +import { MAIN_WINDOW_LABEL } from "@/constants"; +import { useAppStore } from "@/stores/appStore"; +import { useShortcutsStore } from "@/stores/shortcutsStore"; interface TogglePinProps extends HTMLAttributes { setIsPinnedWeb?: (value: boolean) => void; @@ -14,6 +18,13 @@ const TogglePin: FC = (props) => { const { className, setIsPinnedWeb } = props; const { isPinned, setIsPinned } = useAppStore(); const { fixedWindow } = useShortcutsStore(); + const [windowLabel, setWindowLabel] = useState(); + + useMount(async () => { + const label = await platformAdapter.getCurrentWindowLabel(); + + setWindowLabel(label); + }); const togglePin = async () => { const { isTauri, isPinned } = useAppStore.getState(); @@ -34,16 +45,18 @@ const TogglePin: FC = (props) => { }; return ( - + windowLabel === MAIN_WINDOW_LABEL && ( + + ) ); }; From 6dfa4f6a5fc4809bdce968d290905feb696db67d Mon Sep 17 00:00:00 2001 From: BiggerRain <15911122312@163.COM> Date: Wed, 31 Dec 2025 14:13:51 +0800 Subject: [PATCH 3/4] fix: prevent window collapse when chat history is open (#1039) --- src/components/SearchChat/index.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/SearchChat/index.tsx b/src/components/SearchChat/index.tsx index 53731261..beb50290 100644 --- a/src/components/SearchChat/index.tsx +++ b/src/components/SearchChat/index.tsx @@ -38,6 +38,7 @@ import { useTauriFocus } from "@/hooks/useTauriFocus"; import { POPOVER_PANEL_SELECTOR, WINDOW_CENTER_BASELINE_HEIGHT, + HISTORY_PANEL_ID, } from "@/constants"; import { useChatStore } from "@/stores/chatStore"; import { useSearchStore } from "@/stores/searchStore"; @@ -132,6 +133,7 @@ function SearchChat({ const updateAppDialog = document.querySelector("#update-app-dialog"); const popoverPanelEl = document.querySelector(POPOVER_PANEL_SELECTOR); + const historyPanel = document.getElementById(HISTORY_PANEL_ID); const { hasActiveChat } = useChatStore.getState(); @@ -140,6 +142,7 @@ function SearchChat({ canNavigateBack() || inputRef.current || popoverPanelEl || + historyPanel || (isChatModeRef.current && hasActiveChat) ) { setHideMiddleBorder(false); From 341682aed008022c97dd7cced259ee9dd0edbca4 Mon Sep 17 00:00:00 2001 From: BiggerRain <15911122312@163.COM> Date: Wed, 31 Dec 2025 14:14:46 +0800 Subject: [PATCH 4/4] chore: remove deep-link to settings (#1038) * chore: remove deep-link to settings * chore: delete comment * chore: delete comment --- src-tauri/src/selection_monitor.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src-tauri/src/selection_monitor.rs b/src-tauri/src/selection_monitor.rs index 54d2f7c9..07dcc282 100644 --- a/src-tauri/src/selection_monitor.rs +++ b/src-tauri/src/selection_monitor.rs @@ -375,7 +375,7 @@ pub fn start_selection_monitor(app_handle: tauri::AppHandle) { } /// Ensure macOS Accessibility permission with double-checking and session throttling. -/// Returns true when trusted; otherwise triggers prompt/settings link and emits +/// Returns true when trusted; otherwise triggers prompt and emits /// `selection-permission-required` to the frontend, then returns false. #[cfg(target_os = "macos")] fn ensure_accessibility_permission(app_handle: &tauri::AppHandle) -> bool { @@ -424,7 +424,7 @@ fn ensure_accessibility_permission(app_handle: &tauri::AppHandle) -> bool { log::warn!(target: "coco_lib::selection_monitor", "ensure_accessibility_permission: still not trusted after prompt"); } - // Still not trusted — notify frontend and deep-link to settings. + // Still not trusted — notify frontend. let _ = app_handle.emit("selection-permission-required", true); log::debug!(target: "coco_lib::selection_monitor", "selection-permission-required emitted"); @@ -433,13 +433,6 @@ fn ensure_accessibility_permission(app_handle: &tauri::AppHandle) -> bool { log::info!(target: "coco_lib::selection_monitor", "selection-permission-info: bundle_id={}, exe_path={}, in_applications={}, is_dmg={}, is_dev_guess={}", info.bundle_id, info.exe_path, info.in_applications, info.is_dmg, info.is_dev_guess); let _ = app_handle.emit("selection-permission-info", info); - #[allow(unused_must_use)] - { - use std::process::Command; - Command::new("open") - .arg("x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility") - .status(); - } false }