feat(search): kind chips, large view with filters and context, tick tasks and list items right in the results
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 2m37s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 2m37s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
558fc46cf4
commit
994f6dc554
12 files changed
+522
-40
No files matched your search
@@ -35,6 +35,7 @@ import {
|
||||
Thought,
|
||||
SubTask,
|
||||
SearchResults,
|
||||
SearchFilter,
|
||||
TagDetails,
|
||||
TagSummary,
|
||||
User,
|
||||
@@ -1340,10 +1341,12 @@ export const api = {
|
||||
});
|
||||
},
|
||||
|
||||
async searchAll(q: string): Promise<SearchResults> {
|
||||
return request<SearchResults>(
|
||||
`/api/v1/search?q=${encodeURIComponent(q)}`
|
||||
);
|
||||
async searchAll(q: string, filter: SearchFilter = {}): Promise<SearchResults> {
|
||||
const params = new URLSearchParams({ q });
|
||||
for (const [k, v] of Object.entries(filter)) {
|
||||
if (v !== undefined && v !== '') params.set(k, String(v));
|
||||
}
|
||||
return request<SearchResults>(`/api/v1/search?${params.toString()}`);
|
||||
},
|
||||
|
||||
async exportAll(): Promise<any> {
|
||||
|
||||
@@ -511,6 +511,22 @@ export interface SearchHit {
|
||||
blockId?: string;
|
||||
listId?: string;
|
||||
icon?: string;
|
||||
// Bullets: the bullet before and after, for context
|
||||
before?: string;
|
||||
after?: string;
|
||||
}
|
||||
|
||||
/** Narrowing of the global search (GET /search); empty fields do not filter. */
|
||||
export interface SearchFilter {
|
||||
type?: 'document' | 'thought' | 'list_item';
|
||||
limit?: number;
|
||||
taskStatus?: 'open' | 'done';
|
||||
taskListId?: string; // 'personal' = without list
|
||||
priority?: string;
|
||||
due?: 'today' | 'overdue' | 'week';
|
||||
folder?: string;
|
||||
listId?: string;
|
||||
itemStatus?: 'open' | 'done';
|
||||
}
|
||||
|
||||
export interface SearchResults {
|
||||
@@ -518,6 +534,7 @@ export interface SearchResults {
|
||||
documents: Document[];
|
||||
listItems: ListItem[];
|
||||
hits: SearchHit[];
|
||||
counts?: Partial<Record<'document' | 'thought' | 'list_item', number>>;
|
||||
}
|
||||
|
||||
export interface SpaceMember {
|
||||
|
||||
Reference in new issue
Block a user