Skip to content

Commit 01c51d8

Browse files
authored
feat: support opening file in its containing folder (#900)
1 parent 2944282 commit 01c51d8

File tree

6 files changed

+70
-18
lines changed

6 files changed

+70
-18
lines changed

docs/content.en/docs/release-notes/_index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Information about release notes of Coco App is provided here.
1010
## Latest (In development)
1111

1212
### ❌ Breaking changes
13+
1314
- chore: update request accesstoken api #866
1415

1516
### 🚀 Features
@@ -26,7 +27,7 @@ Information about release notes of Coco App is provided here.
2627
- feat: file search for Linux/KDE #886
2728
- feat: extension Window Management for macOS #892
2829
- feat: new extension type View #894
29-
30+
- feat: support opening file in its containing folder #900
3031

3132
### 🐛 Bug fix
3233

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@tauri-apps/plugin-global-shortcut": "~2.0.0",
2727
"@tauri-apps/plugin-http": "~2.0.2",
2828
"@tauri-apps/plugin-log": "~2.4.0",
29-
"@tauri-apps/plugin-opener": "^2.2.7",
29+
"@tauri-apps/plugin-opener": "^2.5.0",
3030
"@tauri-apps/plugin-os": "^2.2.1",
3131
"@tauri-apps/plugin-process": "^2.2.1",
3232
"@tauri-apps/plugin-shell": "^2.2.1",

pnpm-lock.yaml

Lines changed: 50 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Search/ContextMenu.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const ContextMenu = ({ formatUrl }: ContextMenuProps) => {
111111
return [];
112112
}
113113

114-
const { id, url, category, type, payload } = selectedSearchContent;
114+
const { id, url, category, type, payload, source } = selectedSearchContent;
115115
const { query, result } = payload ?? {};
116116

117117
if (category === "AI Overview") {
@@ -177,6 +177,18 @@ const ContextMenu = ({ formatUrl }: ContextMenuProps) => {
177177
copyToClipboard(`${query.value} = ${result.value}`);
178178
},
179179
},
180+
{
181+
name: t("search.contextMenu.openFileLocation"),
182+
icon: <SquareArrowOutUpRight />,
183+
keys: isMac ? ["⌘", "↩︎"] : ["Ctrl", "Enter"],
184+
shortcut: isMac ? "meta.enter" : "ctrl.enter",
185+
hide: source?.id !== "File Search",
186+
clickEvent: async () => {
187+
await platformAdapter.revealItemInDir(url);
188+
189+
platformAdapter.hideWindow();
190+
},
191+
},
180192
];
181193
}, [selectedSearchContent, selectedExtension]);
182194

src/locales/en/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,8 @@
379379
"details": "Details",
380380
"install": "Install",
381381
"uninstall": "Uninstall",
382-
"configureExtension": "Configure Extension"
382+
"configureExtension": "Configure Extension",
383+
"openFileLocation": "Open File Location"
383384
},
384385
"askCocoAi": {
385386
"title": "{{0}} {{1}}",

src/locales/zh/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,8 @@
379379
"details": "详情",
380380
"install": "安装",
381381
"uninstall": "卸载",
382-
"configureExtension": "配置扩展"
382+
"configureExtension": "配置扩展",
383+
"openFileLocation": "打开所在文件夹"
383384
},
384385
"askCocoAi": {
385386
"title": "{{0}}{{1}}",

0 commit comments

Comments
 (0)