TagSpaces is an offline, open source, document manager with tagging support
chore: optimizing search ui
Ilian Sapundshiev9648671fdbca
diff --git a/app/components/FolderContainer.tsx b/app/components/FolderContainer.tsxindex 1618d01e3..9f111f5fb 100644--- a/app/components/FolderContainer.tsx+++ b/app/components/FolderContainer.tsx@@ -544,6 +544,7 @@ function FolderContainer(props: Props) {paddingLeft: 5,display: 'flex',overflowY: 'hidden',+ alignItems: 'center',// @ts-ignoreoverflowX: AppConfig.isFirefox ? 'auto' : 'overlay'}}diff --git a/app/components/PathBreadcrumbs.tsx b/app/components/PathBreadcrumbs.tsxindex b83f6b421..133369eed 100644--- a/app/components/PathBreadcrumbs.tsx+++ b/app/components/PathBreadcrumbs.tsx@@ -52,9 +52,6 @@ const StyledBreadcrumb = withStyles((theme: Theme) => ({}))(Chip) as typeof Chip;const NoWrapBreadcrumb = withStyles({- root: {- marginTop: 10- },ol: {flexWrap: 'nowrap'}diff --git a/app/components/SearchInline.tsx b/app/components/SearchInline.tsxindex 5f53ea58f..7c4072177 100644--- a/app/components/SearchInline.tsx+++ b/app/components/SearchInline.tsx@@ -404,7 +404,9 @@ function SearchInline(props: Props) {<divstyle={{width: '100%',- whiteSpace: 'nowrap'+ whiteSpace: 'nowrap',+ display: 'flex',+ alignItems: 'center'}}><MainSearchField@@ -418,7 +420,6 @@ function SearchInline(props: Props) {}}size="small"style={{- marginTop: 10,width: 'calc(100% - 80px)'}}inputRef={mainSearchField}@@ -430,39 +431,42 @@ function SearchInline(props: Props) {startAdornment: (<InputAdornment position="start" style={{ marginRight: 0 }}>{isDesktop ? (- <Tooltip- classes={{ tooltip: classes.customWidth }}- title={- <span style={{ fontSize: 14 }}>- {i18n.t('searchScope')}:- <br />- • {i18n.t('location')} -{' '}- {i18n.t('searchPlaceholder')}- <br />- • {i18n.t('folder')} -{' '}- {i18n.t('searchCurrentFolderWithSubFolders')}- <br />- • {i18n.t('globalSearch')} -{' '}- {i18n.t('searchInAllLocationTooltip')} (- {i18n.t('betaStatus')})<br />- </span>- }- >- <Typography- variant="overline"- display="block"- onClick={toggleSearchBoxing}- style={{- border: '1px solid gray',- borderRadius: 5,- lineHeight: 'inherit',- paddingLeft: 3,- paddingRight: 3- }}+ <>+ <Tooltip+ classes={{ tooltip: classes.customWidth }}+ title={+ <span style={{ fontSize: 14 }}>+ {i18n.t('searchScope')}:+ <br />+ • {i18n.t('location')} -{' '}+ {i18n.t('searchPlaceholder')}+ <br />+ • {i18n.t('folder')} -{' '}+ {i18n.t('searchCurrentFolderWithSubFolders')}+ <br />+ • {i18n.t('globalSearch')} -{' '}+ {i18n.t('searchInAllLocationTooltip')} (+ {i18n.t('betaStatus')})<br />+ </span>+ }>- {searchBoxingName}- </Typography>- </Tooltip>+ <Typography+ variant="overline"+ display="block"+ onClick={toggleSearchBoxing}+ style={{+ border: '1px solid gray',+ borderRadius: 5,+ lineHeight: 'inherit',+ paddingLeft: 3,+ paddingRight: 3+ }}+ >+ {searchBoxingName}+ </Typography>+ </Tooltip>+ <HelpTooltip classes={classes} />+ </>) : (<HelpTooltip classes={classes} />)}@@ -482,7 +486,6 @@ function SearchInline(props: Props) {<ExpandMoreIcon style={{ color: 'lightgray' }} /></IconButton></Tooltip>- <HelpTooltip classes={classes} /></>)}<Tooltip title={i18n.t('clearSearch') + ' (ESC)'}>@@ -510,8 +513,7 @@ function SearchInline(props: Props) {disabled={indexing}style={{marginRight: 10,- marginLeft: 10,- marginTop: 10+ marginLeft: 10}}color="primary"onClick={clickSearchButton}diff --git a/app/components/SearchPopover.tsx b/app/components/SearchPopover.tsxindex 5fde607a0..8ccda25dc 100644--- a/app/components/SearchPopover.tsx+++ b/app/components/SearchPopover.tsx@@ -570,6 +570,66 @@ function SearchPopover(props: Props) {</IconButton></div><div className={classes.searchArea} data-tid="searchAdvancedTID">+ <FormControl+ className={classes.formControl}+ style={{ marginTop: 5 }}+ disabled={indexing || !Pro}+ >+ <ProTooltip tooltip={i18n.t('storedSearchQueriesTooltip')}>+ <InputLabel shrink htmlFor="saved-searches">+ {i18n.t('core:savedSearchesTitle')}+ </InputLabel>+ <Select+ onChange={handleSavedSearchChange}+ input={+ <OutlinedInput+ name="savedSearch"+ id="saved-searches"+ label={i18n.t('core:savedSearchesTitle')}+ />+ }+ displayEmpty+ fullWidth+ value={props.searchQuery.uuid ? props.searchQuery.uuid : -1}+ >+ <MenuItem value={-1} style={{ display: 'none' }} />+ {props.searches.length < 1 && (+ <MenuItem>{i18n.t('noSavedSearches')}</MenuItem>+ )}+ {props.searches.map(search => (+ <MenuItem key={search.uuid} value={search.uuid}>+ <span style={{ width: '100%' }}>{search.title}</span>+ </MenuItem>+ ))}+ </Select>+ </ProTooltip>+ </FormControl>+ {Pro && (+ <FormControl className={classes.formControl}>+ <ButtonGroup fullWidth style={{ justifyContent: 'center' }}>+ <Button+ variant="outlined"+ color="secondary"+ size="small"+ style={{ flex: 1 }}+ onClick={() => saveSearch()}+ >+ {i18n.t('searchSaveBtn')}+ </Button>+ {props.searchQuery.uuid && (+ <Button+ variant="outlined"+ color="secondary"+ size="small"+ style={{ flex: 1 }}+ onClick={() => saveSearch(false)}+ >+ {i18n.t('searchEditBtn')}+ </Button>+ )}+ </ButtonGroup>+ </FormControl>+ )}<FormControl className={classes.formControl} disabled={indexing}><ToggleButtonGrouponChange={switchSearchBoxing}@@ -969,66 +1029,6 @@ function SearchPopover(props: Props) {}}/> */}</FormControl>- <FormControl- className={classes.formControl}- disabled={indexing || !Pro}- >- <ProTooltip tooltip={i18n.t('storedSearchQueriesTooltip')}>- <InputLabel shrink htmlFor="saved-searches">- {i18n.t('core:savedSearchesTitle')}- </InputLabel>- <Select- onChange={handleSavedSearchChange}- input={- <OutlinedInput- name="savedSearch"- id="saved-searches"- label={i18n.t('core:savedSearchesTitle')}- />- }- displayEmpty- fullWidth- value={props.searchQuery.uuid ? props.searchQuery.uuid : -1}- >- <MenuItem value={-1} style={{ display: 'none' }} />- {props.searches.length < 1 && (- <MenuItem>{i18n.t('noSavedSearches')}</MenuItem>- )}- {props.searches.map(search => (- <MenuItem key={search.uuid} value={search.uuid}>- <span style={{ width: '100%' }}>{search.title}</span>- </MenuItem>- ))}- </Select>- </ProTooltip>- </FormControl>- {Pro && (- <FormControl className={classes.formControl}>- <ButtonGroup fullWidth style={{ justifyContent: 'center' }}>- <Button- variant="outlined"- color="secondary"- size="small"- style={{ flex: 1 }}- onClick={() => saveSearch()}- >- {i18n.t('searchSaveBtn')}- </Button>- {props.searchQuery.uuid && (- <Button- variant="outlined"- color="secondary"- size="small"- style={{ flex: 1 }}- onClick={() => saveSearch(false)}- >- {i18n.t('searchEditBtn')}- </Button>- )}- </ButtonGroup>- </FormControl>- )}-{SaveSearchDialog && saveSearchDialogOpened !== undefined && (<SaveSearchDialogopen={true}diff --git a/app/perspectives/grid-perspective/components/MainContainer.tsx b/app/perspectives/grid-perspective/components/MainContainer.tsxindex 5918b1a17..93a398aa5 100644--- a/app/perspectives/grid-perspective/components/MainContainer.tsx+++ b/app/perspectives/grid-perspective/components/MainContainer.tsx@@ -881,15 +881,12 @@ function GridPerspective(props: Props) {gridPageLimit={gridPageLimit.current}style={{margin: 0,- // marginTop: 53,display: 'grid',gridGap: '5px 5px',padding: 5,paddingBottom: 10,gridTemplateColumns:- layoutType.current === 'grid'- ? 'repeat(auto-fit,minmax(' + entryWidth + 'px,1fr))'- : 'none'+ 'repeat(auto-fit,minmax(' + entryWidth + 'px,1fr))'}}theme={theme}directories={sortedDirectories}