mirror of
https://github.com/infinilabs/coco-app.git
synced 2026-02-24 04:01:27 +01:00
Merge branch 'main' into detachable-1231
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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) => {
|
||||
</span>
|
||||
<span className="mx-4">|</span>
|
||||
<span className="flex items-center gap-1">
|
||||
<CalendarSync className="w-4 h-4" /> {cloudSelectService?.updated}
|
||||
<CalendarSync className="w-4 h-4" /> {formatDateToLocal(cloudSelectService?.updated)}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-gray-600 dark:text-gray-300 leading-relaxed">
|
||||
|
||||
@@ -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<HTMLButtonElement> {
|
||||
setIsPinnedWeb?: (value: boolean) => void;
|
||||
@@ -14,6 +18,13 @@ const TogglePin: FC<TogglePinProps> = (props) => {
|
||||
const { className, setIsPinnedWeb } = props;
|
||||
const { isPinned, setIsPinned } = useAppStore();
|
||||
const { fixedWindow } = useShortcutsStore();
|
||||
const [windowLabel, setWindowLabel] = useState<string>();
|
||||
|
||||
useMount(async () => {
|
||||
const label = await platformAdapter.getCurrentWindowLabel();
|
||||
|
||||
setWindowLabel(label);
|
||||
});
|
||||
|
||||
const togglePin = async () => {
|
||||
const { isTauri, isPinned } = useAppStore.getState();
|
||||
@@ -34,16 +45,18 @@ const TogglePin: FC<TogglePinProps> = (props) => {
|
||||
};
|
||||
|
||||
return (
|
||||
<button
|
||||
onClick={togglePin}
|
||||
className={clsx(className, {
|
||||
"text-blue-500": isPinned,
|
||||
})}
|
||||
>
|
||||
<VisibleKey shortcut={fixedWindow} onKeyPress={togglePin}>
|
||||
{isPinned ? <PinIcon /> : <PinOffIcon />}
|
||||
</VisibleKey>
|
||||
</button>
|
||||
windowLabel === MAIN_WINDOW_LABEL && (
|
||||
<button
|
||||
onClick={togglePin}
|
||||
className={clsx(className, {
|
||||
"text-blue-500": isPinned,
|
||||
})}
|
||||
>
|
||||
<VisibleKey shortcut={fixedWindow} onKeyPress={togglePin}>
|
||||
{isPinned ? <PinIcon /> : <PinOffIcon />}
|
||||
</VisibleKey>
|
||||
</button>
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user