Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat: command k backend search filter out deleted (#252)

gbirmanbb2028f8a061
diff --git a/js/app/packages/app/component/command/useChatItems.ts b/js/app/packages/app/component/command/useChatItems.ts
index 5f9d944293..838f0288b0 100644
--- a/js/app/packages/app/component/command/useChatItems.ts
+++ b/js/app/packages/app/component/command/useChatItems.ts
@@ -11,7 +11,8 @@ export function useChatItems(fullTextSearchTerm: () => string) {
const items: CommandItemCard[] = [];
for (const chat of chatResults.results) {
- if (chat.chat_search_results.length === 0) continue;
+ if (chat.chat_search_results.length === 0 || chat.metadata?.deleted_at)
+ continue;
for (const result of chat.chat_search_results) {
const contents = result.highlight.content ?? [];
contents.forEach((content, index) => {
diff --git a/js/app/packages/app/component/command/useDocumentItems.ts b/js/app/packages/app/component/command/useDocumentItems.ts
index d540c54484..40ef88220b 100644
--- a/js/app/packages/app/component/command/useDocumentItems.ts
+++ b/js/app/packages/app/component/command/useDocumentItems.ts
@@ -12,7 +12,8 @@ export function useDocumentItems(fullTextSearchTerm: () => string) {
const items: CommandItemCard[] = [];
for (const doc of docResults.results) {
- if (doc.document_search_results.length === 0) continue;
+ if (doc.document_search_results.length === 0 || doc.metadata?.deleted_at)
+ continue;
for (const result of doc.document_search_results) {
const contents = result.highlight.content ?? [];
diff --git a/js/app/packages/app/component/command/useSearchItems.ts b/js/app/packages/app/component/command/useSearchItems.ts
index 6836e96460..006e11278b 100644
--- a/js/app/packages/app/component/command/useSearchItems.ts
+++ b/js/app/packages/app/component/command/useSearchItems.ts
@@ -14,7 +14,8 @@ function createDocumentItems(
const items: CommandItemCard[] = [];
if (doc.type !== 'document') return [];
- if (doc.document_search_results.length === 0) return [];
+ if (doc.document_search_results.length === 0 || doc.metadata?.deleted_at)
+ return [];
// TODO: de-duplicate: see logic in useDocumentItems
for (const result of doc.document_search_results) {
@@ -85,7 +86,8 @@ function createChatItems(chat: UnifiedSearchResponseItem): CommandItemCard[] {
const items: CommandItemCard[] = [];
if (chat.type !== 'chat') return [];
- if (chat.chat_search_results.length === 0) return [];
+ if (chat.chat_search_results.length === 0 || chat.metadata?.deleted_at)
+ return [];
// TODO: de-duplicate: see logic in useChatItems
for (const result of chat.chat_search_results) {
@@ -151,7 +153,11 @@ function createProjectItems(
const items: CommandItemCard[] = [];
if (project.type !== 'project') return [];
- if (project.project_search_results.length === 0) return [];
+ if (
+ project.project_search_results.length === 0 ||
+ project.metadata?.deleted_at
+ )
+ return [];
for (const result of project.project_search_results) {
const contents = result.highlight.content ?? [];
diff --git a/js/app/packages/app/component/custom-cursor/custom-cursor.ts b/js/app/packages/app/component/custom-cursor/custom-cursor.ts
index ab2d1122df..467ed7c119 100644
--- a/js/app/packages/app/component/custom-cursor/custom-cursor.ts
+++ b/js/app/packages/app/component/custom-cursor/custom-cursor.ts
@@ -476,7 +476,7 @@ createRoot(() => {
createEffect(() => {
const { l, c, h } = themeReactive.a0;
- const col = `oklch(${l[0]()} ${c[0]()} ${h[0]()}deg)`;
+ const _col = `oklch(${l[0]()} ${c[0]()} ${h[0]()}deg)`;
if (!customCursorEnabled()) {
clearAllCustomCursorStylesheetEls();
return;