From 2083342199364af7ecf38de44aa8592fea48eaeb Mon Sep 17 00:00:00 2001 From: zhushen <2270364052@qq.com> Date: Tue, 12 May 2026 11:02:13 +0800 Subject: [PATCH] fix: Address code review feedback for PR #142 - Remove invalid allowBuilds from pnpm-workspace.yaml (use onlyBuiltDependencies in root package.json) - Use data-testid for search input selector (fixes / keyboard shortcut for non-English locales) --- package.json | 17 +++++++++++++++++ understand-anything-plugin/package.json | 17 ----------------- .../packages/dashboard/src/App.tsx | 2 +- .../dashboard/src/components/SearchBar.tsx | 1 + understand-anything-plugin/pnpm-workspace.yaml | 13 ------------- 5 files changed, 19 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 504c00a..3b79775 100644 --- a/package.json +++ b/package.json @@ -14,5 +14,22 @@ "devDependencies": { "typescript": "^5.7.0", "vitest": "^3.1.0" + }, + "pnpm": { + "onlyBuiltDependencies": [ + "esbuild", + "sharp", + "tree-sitter-c", + "tree-sitter-c-sharp", + "tree-sitter-cpp", + "tree-sitter-go", + "tree-sitter-java", + "tree-sitter-javascript", + "tree-sitter-php", + "tree-sitter-python", + "tree-sitter-ruby", + "tree-sitter-rust", + "tree-sitter-typescript" + ] } } diff --git a/understand-anything-plugin/package.json b/understand-anything-plugin/package.json index e553094..60c9ca0 100644 --- a/understand-anything-plugin/package.json +++ b/understand-anything-plugin/package.json @@ -15,22 +15,5 @@ "@types/node": "^22.0.0", "typescript": "^5.7.0", "vitest": "^3.1.0" - }, - "pnpm": { - "onlyBuiltDependencies": [ - "esbuild", - "sharp", - "tree-sitter-c", - "tree-sitter-c-sharp", - "tree-sitter-cpp", - "tree-sitter-go", - "tree-sitter-java", - "tree-sitter-javascript", - "tree-sitter-php", - "tree-sitter-python", - "tree-sitter-ruby", - "tree-sitter-rust", - "tree-sitter-typescript" - ] } } diff --git a/understand-anything-plugin/packages/dashboard/src/App.tsx b/understand-anything-plugin/packages/dashboard/src/App.tsx index edbb7fc..6835e0a 100644 --- a/understand-anything-plugin/packages/dashboard/src/App.tsx +++ b/understand-anything-plugin/packages/dashboard/src/App.tsx @@ -296,7 +296,7 @@ function DashboardContent({ description: t.keyboardShortcuts.focusSearch, action: () => { const searchInput = document.querySelector( - 'input[placeholder*="Search"]' + '[data-testid="search-input"]' ); searchInput?.focus(); }, diff --git a/understand-anything-plugin/packages/dashboard/src/components/SearchBar.tsx b/understand-anything-plugin/packages/dashboard/src/components/SearchBar.tsx index 2f8c90a..88ef3f5 100644 --- a/understand-anything-plugin/packages/dashboard/src/components/SearchBar.tsx +++ b/understand-anything-plugin/packages/dashboard/src/components/SearchBar.tsx @@ -107,6 +107,7 @@ export default function SearchBar() { onChange={handleInputChange} onFocus={() => setDropdownOpen(true)} placeholder={t.search.placeholder} + data-testid="search-input" className="flex-1 min-w-0 bg-elevated text-text-primary text-sm rounded-lg px-3 py-1.5 border border-border-subtle focus:outline-none focus:border-accent/50 placeholder-text-muted" />
diff --git a/understand-anything-plugin/pnpm-workspace.yaml b/understand-anything-plugin/pnpm-workspace.yaml index 901bea1..dee51e9 100644 --- a/understand-anything-plugin/pnpm-workspace.yaml +++ b/understand-anything-plugin/pnpm-workspace.yaml @@ -1,15 +1,2 @@ packages: - "packages/*" -allowBuilds: - esbuild: set this to true or false - tree-sitter-c: set this to true or false - tree-sitter-c-sharp: set this to true or false - tree-sitter-cpp: set this to true or false - tree-sitter-go: set this to true or false - tree-sitter-java: set this to true or false - tree-sitter-javascript: set this to true or false - tree-sitter-php: set this to true or false - tree-sitter-python: set this to true or false - tree-sitter-ruby: set this to true or false - tree-sitter-rust: set this to true or false - tree-sitter-typescript: set this to true or false