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-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 } 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)}

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 && ( + + ) ); }; diff --git a/src/components/SearchChat/index.tsx b/src/components/SearchChat/index.tsx index 82ded109..c66525e7 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"; @@ -134,6 +135,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(); @@ -142,6 +144,7 @@ function SearchChat({ canNavigateBack() || inputRef.current || popoverPanelEl || + historyPanel || (isChatModeRef.current && hasActiveChat) ) { setHideMiddleBorder(false);