Skip to content

Commit 4dd6c2e

Browse files
Add natural sort agentic results (#481)
* Enhance Claude agent progress reporting with detailed tool input formatting - Remove the --bare flag from the Claude Code agent configuration in apps/editor/src/features/search-files/search-modes/perform-agent-search-mode/agents/claude.ts. - [Pasted text] W przypadku claude code chcemy naprawic wysweitlanie progesu notifikacji - [Pasted text] Nie chcemy widziec notyfikacji w tekstem jeddnoslownym bash dla claude code └── apps └── editor └── src └── features └── search-files └── search-modes └── perform-agent-search-mode ├── agents │ ├── antigravity.ts │ ├── claude.ts │ ├── codex.ts │ ├── cursor.ts │ ├── grok.ts │ ├── muse.ts │ └── opencode.ts ├── index.ts ├── perform-agent-search-mode.ts ├── types.ts └── utils.ts * Sort files naturally by path in quick pick items - Implement natural sort └── apps └── editor └── src ├── features │ └── search-files │ ├── index.ts │ ├── search-files.ts │ ├── search-modes │ │ ├── perform-agent-search-mode │ │ │ ├── agents │ │ │ │ ├── antigravity.ts │ │ │ │ ├── claude.ts │ │ │ │ ├── codex.ts │ │ │ │ ├── cursor.ts │ │ │ │ ├── grok.ts │ │ │ │ ├── muse.ts │ │ │ │ └── opencode.ts │ │ │ ├── index.ts │ │ │ ├── perform-agent-search-mode.ts │ │ │ ├── types.ts │ │ │ └── utils.ts │ │ ├── perform-intelligent-search-mode.ts │ │ ├── perform-keywords-search-mode.ts │ │ └── perform-phrase-search-mode.ts │ └── utils │ ├── analyze-files.ts │ ├── check-matches-condition.ts │ ├── create-search-regex.ts │ ├── group-quick-pick-items.ts │ ├── handle-parent-folder-result.ts │ ├── map-files-to-quick-pick-items.ts │ ├── prompt-for-config.ts │ ├── prompt-for-intelligent-search-results.ts │ ├── prompt-for-keywords-match-mode.ts │ ├── prompt-for-keywords-target.ts │ ├── prompt-for-search-mode.ts │ ├── prompt-for-search-results.ts │ ├── prompt-for-search-term.ts │ ├── prompt-for-shrink-mode.ts │ ├── search-files-by-intelligent.ts │ ├── search-files-by-keywords.ts │ ├── search-files-by-phrase.ts │ └── show-search-results-quick-pick.ts └── utils └── natural-sort.ts
1 parent 0bb3e05 commit 4dd6c2e

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

‎apps/editor/src/features/search-files/utils/map-files-to-quick-pick-items.ts‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as vscode from 'vscode'
22
import * as path from 'path'
33
import { WorkspaceProvider } from '@/context/providers/workspace/workspace-provider'
44
import { display_token_count } from '@shared/utils/display-token-count'
5+
import { natural_sort } from '@/utils/natural-sort'
56

67
export const map_files_to_quick_pick_items = async <
78
T extends { path: string }
@@ -12,8 +13,28 @@ export const map_files_to_quick_pick_items = async <
1213
open_file_button: vscode.QuickInputButton
1314
add_parent_folder_button: vscode.QuickInputButton
1415
}) => {
16+
const get_sort_path = (file_path: string) => {
17+
const workspace_root =
18+
params.workspace_provider.get_workspace_root_for_file(file_path)
19+
const relative_path = workspace_root
20+
? path.relative(workspace_root, file_path)
21+
: file_path
22+
23+
if (workspace_root && params.is_multi_root) {
24+
const workspace_name =
25+
params.workspace_provider.get_workspace_name(workspace_root)
26+
return `${workspace_name}/${relative_path}`
27+
}
28+
29+
return relative_path
30+
}
31+
32+
const sorted_files = [...params.files].sort((a, b) =>
33+
natural_sort(get_sort_path(a.path), get_sort_path(b.path))
34+
)
35+
1536
return await Promise.all(
16-
params.files.map(async (file_obj) => {
37+
sorted_files.map(async (file_obj) => {
1738
const file_path = file_obj.path
1839
const workspace_root =
1940
params.workspace_provider.get_workspace_root_for_file(file_path)

0 commit comments

Comments
 (0)