diff --git a/docs/content.en/docs/release-notes/_index.md b/docs/content.en/docs/release-notes/_index.md index d99b67f3..0a7c7d65 100644 --- a/docs/content.en/docs/release-notes/_index.md +++ b/docs/content.en/docs/release-notes/_index.md @@ -10,6 +10,7 @@ Information about release notes of Coco App is provided here. ## Latest (In development) ### ❌ Breaking changes + - chore: update request accesstoken api #866 ### 🚀 Features @@ -26,7 +27,7 @@ Information about release notes of Coco App is provided here. - feat: file search for Linux/KDE #886 - feat: extension Window Management for macOS #892 - feat: new extension type View #894 - +- feat: support opening file in its containing folder #900 ### 🐛 Bug fix diff --git a/package.json b/package.json index 7c0b574b..9f5e1cc2 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@tauri-apps/plugin-global-shortcut": "~2.0.0", "@tauri-apps/plugin-http": "~2.0.2", "@tauri-apps/plugin-log": "~2.4.0", - "@tauri-apps/plugin-opener": "^2.2.7", + "@tauri-apps/plugin-opener": "^2.5.0", "@tauri-apps/plugin-os": "^2.2.1", "@tauri-apps/plugin-process": "^2.2.1", "@tauri-apps/plugin-shell": "^2.2.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5d8407d7..d5284623 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -33,8 +33,8 @@ importers: specifier: ~2.4.0 version: 2.4.0 '@tauri-apps/plugin-opener': - specifier: ^2.2.7 - version: 2.2.7 + specifier: ^2.5.0 + version: 2.5.0 '@tauri-apps/plugin-os': specifier: ^2.2.1 version: 2.2.1 @@ -790,6 +790,9 @@ packages: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} + '@jridgewell/gen-mapping@0.3.13': + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + '@jridgewell/gen-mapping@0.3.8': resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==} engines: {node: '>=6.0.0'} @@ -802,15 +805,21 @@ packages: resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} engines: {node: '>=6.0.0'} - '@jridgewell/source-map@0.3.6': - resolution: {integrity: sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==} + '@jridgewell/source-map@0.3.11': + resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==} '@jridgewell/sourcemap-codec@1.5.0': resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + '@jridgewell/trace-mapping@0.3.31': + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + '@mermaid-js/parser@0.4.0': resolution: {integrity: sha512-wla8XOWvQAwuqy+gxiZqY+c7FokraOTHRWMsbB4AgRx9Sy7zKslNyejy7E+a77qHfey5GXw/ik3IXv/NHMJgaA==} @@ -1153,6 +1162,9 @@ packages: '@tauri-apps/api@2.5.0': resolution: {integrity: sha512-Ldux4ip+HGAcPUmuLT8EIkk6yafl5vK0P0c0byzAKzxJh7vxelVtdPONjfgTm96PbN24yjZNESY8CKo8qniluA==} + '@tauri-apps/api@2.8.0': + resolution: {integrity: sha512-ga7zdhbS2GXOMTIZRT0mYjKJtR9fivsXzsyq5U3vjDL0s6DTMwYRm0UHNjzTY5dh4+LSC68Sm/7WEiimbQNYlw==} + '@tauri-apps/cli-darwin-arm64@2.5.0': resolution: {integrity: sha512-VuVAeTFq86dfpoBDNYAdtQVLbP0+2EKCHIIhkaxjeoPARR0sLpFHz2zs0PcFU76e+KAaxtEtAJAXGNUc8E1PzQ==} engines: {node: '>= 10'} @@ -1242,8 +1254,8 @@ packages: '@tauri-apps/plugin-log@2.4.0': resolution: {integrity: sha512-j7yrDtLNmayCBOO2esl3aZv9jSXy2an8MDLry3Ys9ZXerwUg35n1Y2uD8HoCR+8Ng/EUgx215+qOUfJasjYrHw==} - '@tauri-apps/plugin-opener@2.2.7': - resolution: {integrity: sha512-uduEyvOdjpPOEeDRrhwlCspG/f9EQalHumWBtLBnp3fRp++fKGLqDOyUhSIn7PzX45b/rKep//ZQSAQoIxobLA==} + '@tauri-apps/plugin-opener@2.5.0': + resolution: {integrity: sha512-B0LShOYae4CZjN8leiNDbnfjSrTwoZakqKaWpfoH6nXiJwt6Rgj6RnVIffG3DoJiKsffRhMkjmBV9VeilSb4TA==} '@tauri-apps/plugin-os@2.2.1': resolution: {integrity: sha512-cNYpNri2CCc6BaNeB6G/mOtLvg8dFyFQyCUdf2y0K8PIAKGEWdEcu8DECkydU2B+oj4OJihDPD2de5K6cbVl9A==} @@ -1464,6 +1476,11 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + acorn@8.15.0: + resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} + engines: {node: '>=0.4.0'} + hasBin: true + agent-base@7.1.3: resolution: {integrity: sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==} engines: {node: '>= 14'} @@ -4230,6 +4247,12 @@ snapshots: wrap-ansi: 8.1.0 wrap-ansi-cjs: wrap-ansi@7.0.0 + '@jridgewell/gen-mapping@0.3.13': + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping': 0.3.31 + optional: true + '@jridgewell/gen-mapping@0.3.8': dependencies: '@jridgewell/set-array': 1.2.1 @@ -4240,19 +4263,28 @@ snapshots: '@jridgewell/set-array@1.2.1': {} - '@jridgewell/source-map@0.3.6': + '@jridgewell/source-map@0.3.11': dependencies: - '@jridgewell/gen-mapping': 0.3.8 - '@jridgewell/trace-mapping': 0.3.25 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 optional: true '@jridgewell/sourcemap-codec@1.5.0': {} + '@jridgewell/sourcemap-codec@1.5.5': + optional: true + '@jridgewell/trace-mapping@0.3.25': dependencies: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/trace-mapping@0.3.31': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 + optional: true + '@mermaid-js/parser@0.4.0': dependencies: langium: 3.3.1 @@ -4546,6 +4578,8 @@ snapshots: '@tauri-apps/api@2.5.0': {} + '@tauri-apps/api@2.8.0': {} + '@tauri-apps/cli-darwin-arm64@2.5.0': optional: true @@ -4617,9 +4651,9 @@ snapshots: dependencies: '@tauri-apps/api': 2.5.0 - '@tauri-apps/plugin-opener@2.2.7': + '@tauri-apps/plugin-opener@2.5.0': dependencies: - '@tauri-apps/api': 2.5.0 + '@tauri-apps/api': 2.8.0 '@tauri-apps/plugin-os@2.2.1': dependencies: @@ -4876,6 +4910,9 @@ snapshots: acorn@8.14.1: {} + acorn@8.15.0: + optional: true + agent-base@7.1.3: {} ahooks@3.8.4(react@18.3.1): @@ -7232,8 +7269,8 @@ snapshots: terser@5.40.0: dependencies: - '@jridgewell/source-map': 0.3.6 - acorn: 8.14.1 + '@jridgewell/source-map': 0.3.11 + acorn: 8.15.0 commander: 2.20.3 source-map-support: 0.5.21 optional: true diff --git a/src/components/Search/ContextMenu.tsx b/src/components/Search/ContextMenu.tsx index 1095856f..91348c22 100644 --- a/src/components/Search/ContextMenu.tsx +++ b/src/components/Search/ContextMenu.tsx @@ -111,7 +111,7 @@ const ContextMenu = ({ formatUrl }: ContextMenuProps) => { return []; } - const { id, url, category, type, payload } = selectedSearchContent; + const { id, url, category, type, payload, source } = selectedSearchContent; const { query, result } = payload ?? {}; if (category === "AI Overview") { @@ -177,6 +177,18 @@ const ContextMenu = ({ formatUrl }: ContextMenuProps) => { copyToClipboard(`${query.value} = ${result.value}`); }, }, + { + name: t("search.contextMenu.openFileLocation"), + icon: , + keys: isMac ? ["⌘", "↩︎"] : ["Ctrl", "Enter"], + shortcut: isMac ? "meta.enter" : "ctrl.enter", + hide: source?.id !== "File Search", + clickEvent: async () => { + await platformAdapter.revealItemInDir(url); + + platformAdapter.hideWindow(); + }, + }, ]; }, [selectedSearchContent, selectedExtension]); diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index ff876cf9..04a0e9ab 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -379,7 +379,8 @@ "details": "Details", "install": "Install", "uninstall": "Uninstall", - "configureExtension": "Configure Extension" + "configureExtension": "Configure Extension", + "openFileLocation": "Open File Location" }, "askCocoAi": { "title": "{{0}} {{1}}", diff --git a/src/locales/zh/translation.json b/src/locales/zh/translation.json index 7016c8eb..fa56b8e5 100644 --- a/src/locales/zh/translation.json +++ b/src/locales/zh/translation.json @@ -379,7 +379,8 @@ "details": "详情", "install": "安装", "uninstall": "卸载", - "configureExtension": "配置扩展" + "configureExtension": "配置扩展", + "openFileLocation": "打开所在文件夹" }, "askCocoAi": { "title": "{{0}}{{1}}",