File tree Expand file tree Collapse file tree
docs/content.en/docs/release-notes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ Information about release notes of Coco Server is provided here.
1616- feat: ai overview support is enabled with shortcut #597
1717- feat: add key monitoring during reset #615
1818- feat: calculator extension add description #623
19+ - feat: support right-click actions after text selection #624
1920
2021### 🐛 Bug fix
2122
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export const UserMessage = ({ messageContent }: UserMessageProps) => {
2424 < CopyButton textToCopy = { messageContent } />
2525 </ div >
2626 < div
27- className = "px-3 py-2 bg-white dark:bg-[#202126] rounded-xl border border-black/12 dark:border-black/15 font-normal text-sm text-[#333333] dark:text-[#D8D8D8] cursor-pointer select-none "
27+ className = "px-3 py-2 bg-white dark:bg-[#202126] rounded-xl border border-black/12 dark:border-black/15 font-normal text-sm text-[#333333] dark:text-[#D8D8D8] cursor-pointer user- select-text "
2828 onDoubleClick = { ( e ) => {
2929 const selection = window . getSelection ( ) ;
3030 const range = document . createRange ( ) ;
Original file line number Diff line number Diff line change 11import { useEffect } from "react" ;
22import { Outlet , useLocation } from "react-router-dom" ;
33import { useTranslation } from "react-i18next" ;
4- import { useAsyncEffect , useEventListener , useMount } from "ahooks" ;
4+ import {
5+ useAsyncEffect ,
6+ useEventListener ,
7+ useMount ,
8+ useTextSelection ,
9+ } from "ahooks" ;
510import { isArray , isString } from "lodash-es" ;
611import { error } from "@tauri-apps/plugin-log" ;
712
@@ -83,6 +88,7 @@ export default function Layout() {
8388 const { i18n } = useTranslation ( ) ;
8489 const language = useAppStore ( ( state ) => state . language ) ;
8590 const setLanguage = useAppStore ( ( state ) => state . setLanguage ) ;
91+ const { text : selectionText } = useTextSelection ( ) ;
8692
8793 useEffect ( ( ) => {
8894 if ( language ) {
@@ -108,7 +114,7 @@ export default function Layout() {
108114
109115 // Disable right-click for production environment
110116 useEventListener ( "contextmenu" , ( event ) => {
111- if ( import . meta. env . DEV ) return ;
117+ if ( import . meta. env . DEV || selectionText ) return ;
112118
113119 event . preventDefault ( ) ;
114120 } ) ;
You can’t perform that action at this time.
0 commit comments