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.

chore: file association helper rename (#1526)

gbirmanb1a79e71fe3a
diff --git a/js/app/packages/app/component/next-soup/filters/filters.ts b/js/app/packages/app/component/next-soup/filters/filters.ts
index 686c14dd7e..3dff3ab5b9 100644
--- a/js/app/packages/app/component/next-soup/filters/filters.ts
+++ b/js/app/packages/app/component/next-soup/filters/filters.ts
@@ -281,15 +281,16 @@ export const getFilterWithID = (filterID: FilterID) => {
return found;
};
-export const FOLDER_DOCUMENT_TYPES = [
+export const FILE_ASSOCIATION_TYPES = [
'code',
'image',
'pdf',
'unknown',
] as const;
-export const getFolderFileTypes = (type: 'soup' | 'search') => {
- return FOLDER_DOCUMENT_TYPES.flatMap((fileType) => {
+/** Expands file association types to file extensions for soup or search */
+export const getFileAssociations = (type: 'soup' | 'search') => {
+ return FILE_ASSOCIATION_TYPES.flatMap((fileType) => {
if (fileType === 'code')
return type === 'soup' ? ['assoc:code'] : codeFileExtensions;
if (fileType === 'image')
@@ -366,7 +367,7 @@ export const QUERY_FILTERS = {
channel_filters: { channel_ids: EXCLUDE },
chat_filters: { chat_ids: EXCLUDE },
email_filters: { recipients: EXCLUDE },
- document_filters: { file_types: getFolderFileTypes('soup') },
+ document_filters: { file_types: getFileAssociations('soup') },
},
/** Channels filter - all channels (teams and people) */
diff --git a/js/app/packages/app/component/next-soup/soup-view/create-search-state.ts b/js/app/packages/app/component/next-soup/soup-view/create-search-state.ts
index f7050a87c6..e8ebeeb186 100644
--- a/js/app/packages/app/component/next-soup/soup-view/create-search-state.ts
+++ b/js/app/packages/app/component/next-soup/soup-view/create-search-state.ts
@@ -1,7 +1,7 @@
import type { SoupState } from '@app/component/next-soup/create-soup-state';
import {
type FilterID,
- getFolderFileTypes,
+ getFileAssociations,
} from '@app/component/next-soup/filters/filters';
import { arrayEquals } from '@core/util/compareUtils';
import { debouncedDependent } from '@core/util/debounce';
@@ -131,7 +131,7 @@ export const createSearchState = ({
let fileTypes = document_filters?.file_types;
if (soup.filters.isActive('file')) {
- fileTypes = getFolderFileTypes('search');
+ fileTypes = getFileAssociations('search');
}
return {