Skip to content

TagSpaces is an offline, open source, document manager with tagging support

chore: improvements in the search autocomplete comp. added icons for the tags

Ilian Sapundshiev2fff1abfe021
diff --git a/src/renderer/components/CommonIcons.tsx b/src/renderer/components/CommonIcons.tsx
index d802d5218..55c210043 100644
--- a/src/renderer/components/CommonIcons.tsx
+++ b/src/renderer/components/CommonIcons.tsx
@@ -18,15 +18,21 @@
import ExportIcon from '@mui/icons-material/ExitToApp';
import KeyboardReturnIcon from '@mui/icons-material/KeyboardReturn';
+import TagsIcon from '@mui/icons-material/LocalOfferOutlined';
+import RemoveCircleOutlineOutlined from '@mui/icons-material/RemoveCircleOutlineOutlined';
import MarkdownRawIcon from '@mui/icons-material/SimCardDownloadOutlined';
import SvgIcon from '@mui/material/SvgIcon';
-import TagsIcon from '@mui/icons-material/LocalOfferOutlined';
+export const RemoveIcon = (props) => <RemoveCircleOutlineOutlined {...props} />;
export const TagIcon = (props) => (
<TagsIcon sx={{ transform: 'rotate(90deg)' }} {...props} />
);
+export const OrIcon = (props) => (
+ <RemoveCircleOutlineOutlined sx={{ transform: 'rotate(90deg)' }} {...props} />
+);
+
export const TagLibraryIcon = (props) => (
<TagsIcon sx={{ transform: 'rotate(90deg)' }} {...props} />
);
@@ -71,8 +77,6 @@ export { default as InfoIcon } from '@mui/icons-material/InfoOutlined';
export { default as EntryPropertiesIcon } from '@mui/icons-material/InfoOutlined';
-export { default as RemoveIcon } from '@mui/icons-material/RemoveCircleOutlineOutlined';
-
export { default as RemoveTagIcon } from '@mui/icons-material/Close';
export { default as HistoryIcon } from '@mui/icons-material/History';
diff --git a/src/renderer/components/SearchAutocomplete.tsx b/src/renderer/components/SearchAutocomplete.tsx
index 41f9537e0..ff6e3b873 100644
--- a/src/renderer/components/SearchAutocomplete.tsx
+++ b/src/renderer/components/SearchAutocomplete.tsx
@@ -18,8 +18,11 @@
import AppConfig from '-/AppConfig';
import {
+ AddIcon,
ArrowDropDownIcon,
CloseIcon,
+ OrIcon,
+ RemoveIcon,
RemoveTagIcon,
} from '-/components/CommonIcons';
import {
@@ -1388,11 +1391,37 @@ function SearchAutocomplete(props: Props) {
const action = actionValues.current.find(
(a) => a.fullName === option || a.label === option,
);
+
+ let booleanTagIcon = option;
+ if (option.startsWith('+')) {
+ booleanTagIcon = (
+ <>
+ <AddIcon fontSize="small" sx={{ marginRight: '3px' }} />
+ {option.slice(1)}
+ </>
+ );
+ } else if (option.startsWith('-')) {
+ booleanTagIcon = (
+ <>
+ <RemoveIcon fontSize="small" />
+ {option.slice(1)}
+ </>
+ );
+ } else if (option.startsWith('|')) {
+ booleanTagIcon = (
+ <>
+ <OrIcon fontSize="small" />
+ {option.slice(1)}
+ </>
+ );
+ }
+
return (
<Box
key={'button_' + index}
sx={{
border: '1px solid gray',
+ display: 'flex',
minHeight: '0',
minWidth: '0',
margin: '2px',
@@ -1402,7 +1431,7 @@ function SearchAutocomplete(props: Props) {
paddingBottom: '0px',
paddingRight: '0px',
paddingLeft: '4px',
- borderRadius: AppConfig.defaultCSSRadius,
+ borderRadius: '7px', // AppConfig.defaultCSSRadius,
...(action &&
action.color && {
color: action.textcolor,
@@ -1417,10 +1446,12 @@ function SearchAutocomplete(props: Props) {
<Box
sx={{
fontSize: '13px',
- display: 'inline',
+ display: 'flex',
+ alignItems: 'center',
+ height: 20,
}}
>
- {option}
+ {booleanTagIcon}
</Box>
) : (
<TsButton