Implementing app search feature (#1302)
This PR implements app search feature and addresses the issue #1182. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds a fast app search with a command-style dialog so users can find apps by name or chat content and jump to them quickly. Implements the search experience requested in #1182. - New Features - Search dialog (Ctrl+K or “Search Apps” button) with result snippets from matching chat titles/messages. - Searches across app names, chat titles, and message content; case-insensitive; supports partial matches; empty query lists all apps. - Selecting a result navigates to the app and closes the dialog. - New IPC endpoint search-app with Zod-validated results, debounced React Query hook, and preload allowlist update. - Added E2E tests for dialog open/close, shortcuts, matching behavior, empty state, and navigation. <!-- End of auto-generated description by cubic. -->
This commit is contained in:
committed by
GitHub
parent
2edd122d9b
commit
a547aa3ac1
@@ -5,6 +5,7 @@ import {
|
||||
type UserSettings,
|
||||
type ContextPathResults,
|
||||
ChatSearchResultsSchema,
|
||||
AppSearchResultsSchema,
|
||||
} from "../lib/schemas";
|
||||
import type {
|
||||
AppOutput,
|
||||
@@ -66,6 +67,7 @@ import type {
|
||||
import type { Template } from "../shared/templates";
|
||||
import type {
|
||||
AppChatContext,
|
||||
AppSearchResult,
|
||||
ChatSearchResult,
|
||||
ProposalResult,
|
||||
} from "@/lib/schemas";
|
||||
@@ -312,6 +314,17 @@ export class IpcClient {
|
||||
return this.ipcRenderer.invoke("list-apps");
|
||||
}
|
||||
|
||||
// Search apps by name
|
||||
public async searchApps(searchQuery: string): Promise<AppSearchResult[]> {
|
||||
try {
|
||||
const data = await this.ipcRenderer.invoke("search-app", searchQuery);
|
||||
return AppSearchResultsSchema.parse(data);
|
||||
} catch (error) {
|
||||
showError(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
public async readAppFile(appId: number, filePath: string): Promise<string> {
|
||||
return this.ipcRenderer.invoke("read-app-file", {
|
||||
appId,
|
||||
|
||||
Reference in New Issue
Block a user