File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed
docs/content.en/docs/release-notes Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ Information about release notes of Coco Server is provided here.
25
25
- feat: add keyboard-only operation to history list #385
26
26
- feat: add error notification #386
27
27
- feat: add support for AI assistant #394
28
- - feat: add support for AI assistant #394
29
28
- feat: add support for calculator function #399
30
29
31
30
### Bug fix
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { ChevronsRight } from "lucide-react";
2
2
import { FC } from "react" ;
3
3
import clsx from "clsx" ;
4
4
import { useTranslation } from "react-i18next" ;
5
+ import { copyToClipboard } from "@/utils" ;
5
6
6
7
interface CalculatorProps {
7
8
item : any ;
@@ -36,7 +37,12 @@ const Calculator: FC<CalculatorProps> = (props) => {
36
37
} ;
37
38
38
39
return (
39
- < div className = "flex items-center gap-1 w-full children:flex" >
40
+ < div
41
+ className = "flex items-center gap-1 w-full children:flex"
42
+ onDoubleClick = { ( ) => {
43
+ copyToClipboard ( result . value ) ;
44
+ } }
45
+ >
40
46
{ renderItem ( query . value , t ( `calculator.${ query . type } ` ) ) }
41
47
42
48
< ChevronsRight className = "text-[#999999] size-5" />
Original file line number Diff line number Diff line change 1
- import { useClickAway , useCreation , useReactive } from "ahooks" ;
1
+ import {
2
+ useClickAway ,
3
+ useCreation ,
4
+ useEventListener ,
5
+ useReactive ,
6
+ } from "ahooks" ;
2
7
import clsx from "clsx" ;
3
8
import { isNil , noop } from "lodash-es" ;
4
9
import { Copy , Link , SquareArrowOutUpRight } from "lucide-react" ;
@@ -152,6 +157,12 @@ const ContextMenu = ({ hideCoco }: ContextMenuProps) => {
152
157
handleClick ( item ?. clickEvent ) ;
153
158
} ) ;
154
159
160
+ useEventListener ( "keydown" , ( event ) => {
161
+ if ( ! visibleContextMenu ) return ;
162
+
163
+ event . stopImmediatePropagation ( ) ;
164
+ } ) ;
165
+
155
166
const handleClick = ( click = noop ) => {
156
167
click ?.( ) ;
157
168
You can’t perform that action at this time.
0 commit comments