TagSpaces is an offline, open source, document manager with tagging support
Minor issues (search, clear search, max. columns) in kanban (#2226)
Stanimire2d9186fe17c
diff --git a/package-lock.json b/package-lock.jsonindex fbf577ad3..4a3f467e8 100644--- a/package-lock.json+++ b/package-lock.json@@ -199,7 +199,7 @@"yarn": "please-use-npm"},"optionalDependencies": {- "@tagspacespro/tagspacespro": "5.0.99"+ "@tagspacespro/tagspacespro": "5.0.100"}},"node_modules/@adobe/css-tools": {@@ -15880,9 +15880,9 @@}},"node_modules/@tagspacespro/tagspacespro": {- "version": "5.0.99",- "resolved": "https://npm.pkg.github.com/download/@tagspacespro/tagspacespro/5.0.99/268238f09216de31258e8f77d33caf46ed15582b",- "integrity": "sha512-gDF5XH6K7y0zcNg5xbErwu8WeMRJcr+PI8RQNcvHUjteoWIGPHvdme19ivyd2W7oCTDqeM5aJ62cmImBNsOe5A==",+ "version": "5.0.100",+ "resolved": "https://npm.pkg.github.com/download/@tagspacespro/tagspacespro/5.0.100/90a18beef6c7245b322ce7a641fe8885ce0193a8",+ "integrity": "sha512-DCbHuuXBqx2zW6vpKlrJKkwBbR2eYeeBEFD6zrGEccXsBInqq+xgs8702XgjaELd71e12VOkwpxUJit/5uPJsw==","license": "Proprietary","optional": true},diff --git a/package.json b/package.jsonindex 9852ac282..c2747de9a 100644--- a/package.json+++ b/package.json@@ -236,7 +236,7 @@"uuid": "^9.0.0"},"optionalDependencies": {- "@tagspacespro/tagspacespro": "5.0.99"+ "@tagspacespro/tagspacespro": "5.0.101"},"devDependencies": {"@electron/notarize": "^2.3.2",diff --git a/src/renderer/components/FolderContainer.tsx b/src/renderer/components/FolderContainer.tsxindex f12768081..c50440c72 100644--- a/src/renderer/components/FolderContainer.tsx+++ b/src/renderer/components/FolderContainer.tsx@@ -181,7 +181,7 @@ function FolderContainer(props: Props) {});const openSearchMode = () => {- setSearchQuery({ textQuery: '' });+ // setSearchQuery({ textQuery: '' });enterSearchMode();};diff --git a/src/renderer/components/SearchAutocomplete.tsx b/src/renderer/components/SearchAutocomplete.tsxindex 238f7ef82..824d77faf 100644--- a/src/renderer/components/SearchAutocomplete.tsx+++ b/src/renderer/components/SearchAutocomplete.tsx@@ -393,10 +393,11 @@ function SearchAutocomplete(props: Props) {}}const clearSearch = () => {- resetValues([]);- setSearchQuery({});- exitSearchMode();- openCurrentDirectory();+ openCurrentDirectory().then(() => {+ resetValues([]);+ setSearchQuery({});+ exitSearchMode();+ });};function removeActionsFromQuery(diff --git a/src/renderer/components/SearchPopover.tsx b/src/renderer/components/SearchPopover.tsxindex 52af4c89d..784e545af 100644--- a/src/renderer/components/SearchPopover.tsx+++ b/src/renderer/components/SearchPopover.tsx@@ -307,10 +307,11 @@ function SearchPopover(props: Props) {setTagPlaceLong(null);forceIndexing.current = false;fileSize.current = '';- setSearchQuery({});- exitSearchMode();props.onClose();- openCurrentDirectory();+ openCurrentDirectory().then(() => {+ setSearchQuery({});+ exitSearchMode();+ });};const saveSearch = (isNew = true) => {diff --git a/src/renderer/hooks/DirectoryContentContextProvider.tsx b/src/renderer/hooks/DirectoryContentContextProvider.tsxindex f6e513a46..e27420c41 100644--- a/src/renderer/hooks/DirectoryContentContextProvider.tsx+++ b/src/renderer/hooks/DirectoryContentContextProvider.tsx@@ -83,6 +83,7 @@ type DirectoryContentContextData = {searchQuery: TS.SearchQuery;isSearchMode: boolean;sendDirMessage: (type: string, payload?: any) => void;+ isSearching: () => boolean;addDirectoryEntries: (entries: TS.FileSystemEntry[]) => void;//removeDirectoryEntries: (entryPaths: string[]) => void;//reflectRenameEntries: (paths: Array<string[]>) => Promise<boolean>;@@ -159,6 +160,7 @@ export const DirectoryContentContext =searchQuery: {},isSearchMode: false,sendDirMessage: undefined,+ isSearching: undefined,addDirectoryEntries: undefined,//removeDirectoryEntries: undefined,//reflectRenameEntries: undefined,@@ -616,6 +618,7 @@ export const DirectoryContentContextProvider = ({function exitSearchMode() {isSearchMode.current = false;dispatch(AppActions.setSearchFilter(undefined));+ searchQuery.current = {};forceUpdate();}@@ -807,6 +810,8 @@ export const DirectoryContentContextProvider = ({currentDirectoryFiles.current = meta.customOrder?.files || [];} else {directoryMeta.current = getDefaultDirMeta();+ currentDirectoryDirs.current = [];+ currentDirectoryFiles.current = [];}// Set current directory entries@@ -1055,6 +1060,10 @@ export const DirectoryContentContextProvider = ({[directoryMeta.current?.perspective, manualPerspective.current],);*/+ function isSearching(): boolean {+ return Object.keys(searchQuery.current).length > 0;+ }+function getPerspective(): TS.PerspectiveType {if (manualPerspective.current === 'unspecified') {if (@@ -1480,6 +1489,7 @@ export const DirectoryContentContextProvider = ({//isMetaFolderExist: isMetaFolderExist.current,searchQuery: searchQuery.current,isSearchMode: isSearchMode.current,+ isSearching,sendDirMessage,getPerspective,setCurrentDirectoryEntries,