Skip to content

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

chore: various ui improvements in the quick access area

Ilian Sapundshievc523861982e7
diff --git a/app/components/EntryContainer.tsx b/app/components/EntryContainer.tsx
index f8a7098cb..52f5b5dce 100644
--- a/app/components/EntryContainer.tsx
+++ b/app/components/EntryContainer.tsx
@@ -114,7 +114,7 @@ const styles: any = (theme: any) => ({
flexDirection: 'row',
flex: '1 1',
display: 'flex',
- alignItems: 'center',
+ alignItems: 'baseline',
overflowX: AppConfig.isFirefox ? 'auto' : 'overlay',
overflowY: 'hidden',
paddingRight: 100
@@ -946,7 +946,8 @@ function EntryContainer(props: Props) {
className={classes.fileBadge}
title={i18n.t('core:toggleEntryProperties')}
style={{
- backgroundColor: openedFile.color
+ backgroundColor: openedFile.color,
+ textTransform: 'uppercase'
}}
>
{'.' +
diff --git a/app/components/HelpFeedbackPanel.tsx b/app/components/HelpFeedbackPanel.tsx
index 7f39f75fb..e7d0d1f77 100644
--- a/app/components/HelpFeedbackPanel.tsx
+++ b/app/components/HelpFeedbackPanel.tsx
@@ -80,6 +80,7 @@ function HelpFeedbackPanel(props: Props) {
<Typography
className={classNames(classes.panelTitle, classes.header)}
variant="subtitle1"
+ style={{ paddingLeft: 14 }}
>
{i18n.t('core:helpFeedback')}
</Typography>
diff --git a/app/components/MobileNavigation.tsx b/app/components/MobileNavigation.tsx
index 737b12a2f..e9433bab3 100644
--- a/app/components/MobileNavigation.tsx
+++ b/app/components/MobileNavigation.tsx
@@ -176,7 +176,7 @@ function MobileNavigation(props: Props) {
textAlign: 'center',
display: 'block',
whiteSpace: 'nowrap',
- marginBottom: 20
+ marginBottom: 10
}}
>
<Tooltip title={i18n.t('core:createFileTitle')}>
@@ -303,7 +303,7 @@ function MobileNavigation(props: Props) {
</CardActions>
</>
)}
- <Tooltip title={i18n.t('core:settings')}>
+ <Tooltip title={i18n.t('core:settings')} arrow>
<IconButton
id="verticalNavButton"
data-tid="settings"
@@ -317,7 +317,7 @@ function MobileNavigation(props: Props) {
</IconButton>
</Tooltip>
<ToggleButtonGroup exclusive>
- <Tooltip title={i18n.t('core:locationManager')}>
+ <Tooltip title={i18n.t('core:locationManager')} arrow>
<ToggleButton
onClick={openLocationManagerPanel}
className={
@@ -331,7 +331,7 @@ function MobileNavigation(props: Props) {
<LocationsIcon />
</ToggleButton>
</Tooltip>
- <Tooltip title={i18n.t('core:tagLibrary')}>
+ <Tooltip title={i18n.t('core:tagLibrary')} arrow>
<ToggleButton
data-tid="tagLibrary"
onClick={openTagLibraryPanel}
@@ -345,7 +345,7 @@ function MobileNavigation(props: Props) {
<TagLibraryIcon />
</ToggleButton>
</Tooltip>
- <Tooltip title={i18n.t('core:searchTitle')}>
+ <Tooltip title={i18n.t('core:quickAccess')} arrow>
<ToggleButton
data-tid="search"
onClick={openSearchPanel}
@@ -359,7 +359,7 @@ function MobileNavigation(props: Props) {
<RecentThingsIcon />
</ToggleButton>
</Tooltip>
- <Tooltip title={i18n.t('core:helpFeedback')}>
+ <Tooltip title={i18n.t('core:helpFeedback')} arrow>
<ToggleButton
data-tid="helpFeedback"
onClick={openHelpFeedbackPanel}
@@ -376,7 +376,7 @@ function MobileNavigation(props: Props) {
</ToggleButtonGroup>
{user ? (
<>
- <Tooltip title={i18n.t('core:userAccount')}>
+ <Tooltip title={i18n.t('core:userAccount')} arrow>
<IconButton
data-tid="accountCircleIconTID"
onClick={(event: React.MouseEvent<HTMLButtonElement>) =>
@@ -405,7 +405,7 @@ function MobileNavigation(props: Props) {
</Popover>
</>
) : (
- <Tooltip title={i18n.t('core:switchTheme')}>
+ <Tooltip title={i18n.t('core:switchTheme')} arrow>
<IconButton
data-tid="switchTheme"
onClick={switchTheme}
diff --git a/app/components/StoredSearches.tsx b/app/components/StoredSearches.tsx
index df8df09ac..0e781e65a 100644
--- a/app/components/StoredSearches.tsx
+++ b/app/components/StoredSearches.tsx
@@ -19,6 +19,9 @@
import React, { useReducer, useRef, useState } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
+import classNames from 'classnames';
+import withStyles from '@mui/styles/withStyles';
+import styles from './SidePanels.css';
import IconButton from '@mui/material/IconButton';
import Button from '@mui/material/Button';
import Grid from '@mui/material/Grid';
@@ -62,6 +65,7 @@ import HistoryMenu from '-/components/menus/HistoryMenu';
interface Props {
style?: any;
+ classes?: any;
searchQuery: TS.SearchQuery;
setSearchQuery: (searchQuery: TS.SearchQuery) => void;
searches: Array<TS.SearchQuery>;
@@ -165,7 +169,7 @@ function StoredSearches(props: Props) {
const noSearchesFound = props.searches.length < 1;
- const { reduceHeightBy } = props;
+ const { reduceHeightBy, classes } = props;
const fileOpenHistoryItems: Array<TS.HistoryItem> = getHistory(
historyKeys.fileOpenKey
@@ -265,217 +269,233 @@ function StoredSearches(props: Props) {
return (
<div
+ className={classes.panel}
style={{
- paddingTop: 0,
- marginTop: 0,
- height: 'calc(100% - ' + reduceHeightBy + 'px)',
- // @ts-ignore
- overflowY: AppConfig.isFirefox ? 'auto' : 'overlay'
+ display: 'flex',
+ flexDirection: 'column'
}}
>
- <Grid container direction="row">
- <Grid item xs={10} style={{ alignSelf: 'center' }}>
- <IconButton
- style={{ minWidth: 'auto', padding: 7 }}
- onClick={() => setStoredSearchesVisible(!storedSearchesVisible)}
- size="large"
- >
- {storedSearchesVisible ? <ArrowDownIcon /> : <ArrowRightIcon />}
- </IconButton>
- <Typography
- variant="inherit"
- // className={props.classes.header}
- style={{ display: 'inline' }}
- noWrap
- onClick={() => setStoredSearchesVisible(!storedSearchesVisible)}
- >
- {i18n.t('core:savedSearchesTitle')}
- </Typography>
- </Grid>
- <Grid item xs={2} style={{ alignSelf: 'center' }}>
- <SearchMenu
- anchorEl={searchMenuAnchorEl}
- open={Boolean(searchMenuAnchorEl)}
- onClose={handleCloseSearchMenu}
- openURLExternally={props.openURLExternally}
- exportSearches={() => {
- setExportSearchesDialogOpened(true);
- }}
- importSearches={() => {
- fileInputRef.current.click();
- }}
- />
- <IconButton
- style={{ minWidth: 'auto', padding: 7 }}
- onClick={handleSearchMenu}
- size="large"
- >
- <MenuIcon />
- </IconButton>
- </Grid>
- </Grid>
- <Grid container direction="row">
- {storedSearchesVisible && noSearchesFound && (
- <Grid item xs={12} style={{ display: 'flex', padding: 10 }}>
- {i18n.t('noSavedSearches')}
+ <div className={classes.toolbar}>
+ <Typography
+ className={classNames(classes.panelTitle, classes.header)}
+ variant="subtitle1"
+ style={{ paddingLeft: 14 }}
+ >
+ {i18n.t('core:quickAccess')}
+ </Typography>
+ </div>
+ <div
+ style={{
+ paddingTop: 0,
+ marginTop: 0,
+ height: 'calc(100% - ' + reduceHeightBy + 'px)',
+ // @ts-ignore
+ overflowY: AppConfig.isFirefox ? 'auto' : 'overlay'
+ }}
+ >
+ <Grid container direction="row">
+ <Grid item xs={10} style={{ alignSelf: 'center' }}>
+ <IconButton
+ style={{ minWidth: 'auto', padding: 7 }}
+ onClick={() => setStoredSearchesVisible(!storedSearchesVisible)}
+ size="large"
+ >
+ {storedSearchesVisible ? <ArrowDownIcon /> : <ArrowRightIcon />}
+ </IconButton>
+ <Typography
+ variant="inherit"
+ // className={props.classes.header}
+ style={{ display: 'inline' }}
+ noWrap
+ onClick={() => setStoredSearchesVisible(!storedSearchesVisible)}
+ >
+ {i18n.t('core:savedSearchesTitle')}
+ </Typography>
+ </Grid>
+ <Grid item xs={2} style={{ alignSelf: 'center' }}>
+ <SearchMenu
+ anchorEl={searchMenuAnchorEl}
+ open={Boolean(searchMenuAnchorEl)}
+ onClose={handleCloseSearchMenu}
+ openURLExternally={props.openURLExternally}
+ exportSearches={() => {
+ setExportSearchesDialogOpened(true);
+ }}
+ importSearches={() => {
+ fileInputRef.current.click();
+ }}
+ />
+ <IconButton
+ style={{ minWidth: 'auto', padding: 7 }}
+ onClick={handleSearchMenu}
+ size="large"
+ >
+ <MenuIcon />
+ </IconButton>
</Grid>
- )}
- </Grid>
- <Grid container direction="row">
- {storedSearchesVisible &&
- props.searches.map(search => (
- <React.Fragment key={search.uuid}>
- <Grid item xs={10} style={{ display: 'flex' }}>
- <Button
- style={{
- textTransform: 'none',
- fontWeight: 'normal',
- marginLeft: 5,
- width: '100%',
- justifyContent: 'start'
- }}
- onClick={() => handleSavedSearchClick(search.uuid)}
- >
- <SearchIcon />
- &nbsp;
- {search.title}
- </Button>
- </Grid>
- <Grid item xs={2} style={{ display: 'flex' }}>
- <IconButton
- aria-label={i18n.t('core:searchEditBtn')}
- onClick={() => editSearch(search.uuid)}
- data-tid="editSearchTID"
- size="small"
- >
- <EditIcon />
- </IconButton>
- </Grid>
- </React.Fragment>
- ))}
- </Grid>
- <Grid container direction="row">
- <Grid item xs={10} style={{ alignSelf: 'center' }}>
- <IconButton
- style={{ minWidth: 'auto', padding: 7 }}
- onClick={() => setFileOpenHistory(!fileOpenHistory)}
- size="large"
- >
- {fileOpenHistory ? <ArrowDownIcon /> : <ArrowRightIcon />}
- </IconButton>
- <Typography
- variant="inherit"
- style={{ display: 'inline' }}
- noWrap
- onClick={() => setFileOpenHistory(!fileOpenHistory)}
- >
- {i18n.t('core:fileOpenHistory')}
- </Typography>
</Grid>
- <Grid item xs={2} style={{ alignSelf: 'center' }}>
- <IconButton
- style={{ minWidth: 'auto', padding: 7 }}
- onClick={(event: any) => {
- menuHistoryKey.current = historyKeys.fileOpenKey;
- setHistoryMenuAnchorEl(event.currentTarget);
- }}
- size="large"
- >
- <MenuIcon />
- </IconButton>
+ <Grid container direction="row">
+ {storedSearchesVisible && noSearchesFound && (
+ <Grid item xs={12} style={{ display: 'flex', padding: 10 }}>
+ {i18n.t('noSavedSearches')}
+ </Grid>
+ )}
</Grid>
- </Grid>
- {fileOpenHistory &&
- renderHistory(historyKeys.fileOpenKey, fileOpenHistoryItems)}
- <Grid container direction="row">
- <Grid item xs={10} style={{ alignSelf: 'center' }}>
- <IconButton
- style={{ minWidth: 'auto', padding: 7 }}
- onClick={() => setFileEditHistory(!fileEditHistory)}
- size="large"
- >
- {fileEditHistory ? <ArrowDownIcon /> : <ArrowRightIcon />}
- </IconButton>
- <Typography
- variant="inherit"
- // className={props.classes.header}
- style={{ display: 'inline' }}
- noWrap
- onClick={() => setFileEditHistory(!fileEditHistory)}
- >
- {i18n.t('core:fileEditHistory')}
- </Typography>
+ <Grid container direction="row">
+ {storedSearchesVisible &&
+ props.searches.map(search => (
+ <React.Fragment key={search.uuid}>
+ <Grid item xs={10} style={{ display: 'flex' }}>
+ <Button
+ style={{
+ textTransform: 'none',
+ fontWeight: 'normal',
+ marginLeft: 5,
+ width: '100%',
+ justifyContent: 'start'
+ }}
+ onClick={() => handleSavedSearchClick(search.uuid)}
+ >
+ <SearchIcon />
+ &nbsp;
+ {search.title}
+ </Button>
+ </Grid>
+ <Grid item xs={2} style={{ display: 'flex' }}>
+ <IconButton
+ aria-label={i18n.t('core:searchEditBtn')}
+ onClick={() => editSearch(search.uuid)}
+ data-tid="editSearchTID"
+ size="small"
+ >
+ <EditIcon />
+ </IconButton>
+ </Grid>
+ </React.Fragment>
+ ))}
</Grid>
- <Grid item xs={2} style={{ alignSelf: 'center' }}>
- <IconButton
- style={{ minWidth: 'auto', padding: 7 }}
- onClick={(event: any) => {
- menuHistoryKey.current = historyKeys.fileEditKey;
- setHistoryMenuAnchorEl(event.currentTarget);
- }}
- size="large"
- >
- <MenuIcon />
- </IconButton>
+ <Grid container direction="row">
+ <Grid item xs={10} style={{ alignSelf: 'center' }}>
+ <IconButton
+ style={{ minWidth: 'auto', padding: 7 }}
+ onClick={() => setFileOpenHistory(!fileOpenHistory)}
+ size="large"
+ >
+ {fileOpenHistory ? <ArrowDownIcon /> : <ArrowRightIcon />}
+ </IconButton>
+ <Typography
+ variant="inherit"
+ style={{ display: 'inline' }}
+ noWrap
+ onClick={() => setFileOpenHistory(!fileOpenHistory)}
+ >
+ {i18n.t('core:fileOpenHistory')}
+ </Typography>
+ </Grid>
+ <Grid item xs={2} style={{ alignSelf: 'center' }}>
+ <IconButton
+ style={{ minWidth: 'auto', padding: 7 }}
+ onClick={(event: any) => {
+ menuHistoryKey.current = historyKeys.fileOpenKey;
+ setHistoryMenuAnchorEl(event.currentTarget);
+ }}
+ size="large"
+ >
+ <MenuIcon />
+ </IconButton>
+ </Grid>
</Grid>
- </Grid>
- {fileEditHistory &&
- renderHistory(historyKeys.fileEditKey, fileEditHistoryItems)}
- <Grid container direction="row">
- <Grid item xs={10} style={{ alignSelf: 'center' }}>
- <IconButton
- style={{ minWidth: 'auto', padding: 7 }}
- onClick={() => setFolderOpenHistory(!folderOpenHistory)}
- size="large"
- >
- {folderOpenHistory ? <ArrowDownIcon /> : <ArrowRightIcon />}
- </IconButton>
- <Typography
- variant="inherit"
- style={{ display: 'inline' }}
- noWrap
- onClick={() => setFolderOpenHistory(!folderOpenHistory)}
- >
- {i18n.t('core:folderOpenHistory')}
- </Typography>
+ {fileOpenHistory &&
+ renderHistory(historyKeys.fileOpenKey, fileOpenHistoryItems)}
+ <Grid container direction="row">
+ <Grid item xs={10} style={{ alignSelf: 'center' }}>
+ <IconButton
+ style={{ minWidth: 'auto', padding: 7 }}
+ onClick={() => setFileEditHistory(!fileEditHistory)}
+ size="large"
+ >
+ {fileEditHistory ? <ArrowDownIcon /> : <ArrowRightIcon />}
+ </IconButton>
+ <Typography
+ variant="inherit"
+ // className={props.classes.header}
+ style={{ display: 'inline' }}
+ noWrap
+ onClick={() => setFileEditHistory(!fileEditHistory)}
+ >
+ {i18n.t('core:fileEditHistory')}
+ </Typography>
+ </Grid>
+ <Grid item xs={2} style={{ alignSelf: 'center' }}>
+ <IconButton
+ style={{ minWidth: 'auto', padding: 7 }}
+ onClick={(event: any) => {
+ menuHistoryKey.current = historyKeys.fileEditKey;
+ setHistoryMenuAnchorEl(event.currentTarget);
+ }}
+ size="large"
+ >
+ <MenuIcon />
+ </IconButton>
+ </Grid>
</Grid>
- <Grid item xs={2} style={{ alignSelf: 'center' }}>
- <IconButton
- style={{ minWidth: 'auto', padding: 7 }}
- onClick={(event: any) => {
- menuHistoryKey.current = historyKeys.folderOpenKey;
- setHistoryMenuAnchorEl(event.currentTarget);
- }}
- size="large"
- >
- <MenuIcon />
- </IconButton>
+ {fileEditHistory &&
+ renderHistory(historyKeys.fileEditKey, fileEditHistoryItems)}
+ <Grid container direction="row">
+ <Grid item xs={10} style={{ alignSelf: 'center' }}>
+ <IconButton
+ style={{ minWidth: 'auto', padding: 7 }}
+ onClick={() => setFolderOpenHistory(!folderOpenHistory)}
+ size="large"
+ >
+ {folderOpenHistory ? <ArrowDownIcon /> : <ArrowRightIcon />}
+ </IconButton>
+ <Typography
+ variant="inherit"
+ style={{ display: 'inline' }}
+ noWrap
+ onClick={() => setFolderOpenHistory(!folderOpenHistory)}
+ >
+ {i18n.t('core:folderOpenHistory')}
+ </Typography>
+ </Grid>
+ <Grid item xs={2} style={{ alignSelf: 'center' }}>
+ <IconButton
+ style={{ minWidth: 'auto', padding: 7 }}
+ onClick={(event: any) => {
+ menuHistoryKey.current = historyKeys.folderOpenKey;
+ setHistoryMenuAnchorEl(event.currentTarget);
+ }}
+ size="large"
+ >
+ <MenuIcon />
+ </IconButton>
+ </Grid>
</Grid>
- </Grid>
- <HistoryMenu
- anchorEl={historyMenuAnchorEl}
- open={Boolean(historyMenuAnchorEl)}
- onClose={() => setHistoryMenuAnchorEl(null)}
- refreshHistory={() => forceUpdate()}
- clearAll={() => {
- delAllHistory(menuHistoryKey.current); //historyKeys.fileOpenKey);
- forceUpdate();
- }}
- />
- {folderOpenHistory &&
- renderHistory(historyKeys.folderOpenKey, folderOpenHistoryItems)}
- {SaveSearchDialog && saveSearchDialogOpened !== undefined && (
- <SaveSearchDialog
- open={true}
- onClose={(searchQuery: TS.SearchQuery) => {
- setSaveSearchDialogOpened(undefined);
- if (searchQuery) {
- props.setSearchQuery({
- ...searchQuery,
- showUnixHiddenEntries: props.showUnixHiddenEntries
- });
+ <HistoryMenu
+ anchorEl={historyMenuAnchorEl}
+ open={Boolean(historyMenuAnchorEl)}
+ onClose={() => setHistoryMenuAnchorEl(null)}
+ refreshHistory={() => forceUpdate()}
+ clearAll={() => {
+ delAllHistory(menuHistoryKey.current); //historyKeys.fileOpenKey);
+ forceUpdate();
+ }}
+ />
+ {folderOpenHistory &&
+ renderHistory(historyKeys.folderOpenKey, folderOpenHistoryItems)}
+ {SaveSearchDialog && saveSearchDialogOpened !== undefined && (
+ <SaveSearchDialog
+ open={true}
+ onClose={(searchQuery: TS.SearchQuery) => {
+ setSaveSearchDialogOpened(undefined);
+ if (searchQuery) {
+ props.setSearchQuery({
+ ...searchQuery,
+ showUnixHiddenEntries: props.showUnixHiddenEntries
+ });
- /* if (searchQuery.searchBoxing === 'global') {
+ /* if (searchQuery.searchBoxing === 'global') {
props.searchAllLocations({
...searchQuery,
showUnixHiddenEntries: props.showUnixHiddenEntries
@@ -486,12 +506,14 @@ function StoredSearches(props: Props) {
showUnixHiddenEntries: props.showUnixHiddenEntries
});
} */
- }
- }}
- onClearSearch={() => console.log('search deleted')}
- searchQuery={saveSearchDialogOpened}
- />
- )}
+ }
+ }}
+ onClearSearch={() => console.log('search deleted')}
+ searchQuery={saveSearchDialogOpened}
+ />
+ )}
+ <div style={{ height: 40 }} />
+ </div>
<input
style={{ display: 'none' }}
ref={fileInputRef}
@@ -557,4 +579,4 @@ const areEqual = (prevProp, nextProp) =>
export default connect(
mapStateToProps,
mapDispatchToProps
-)(React.memo(StoredSearches, areEqual));
+)(React.memo(withStyles(styles)(StoredSearches), areEqual));
diff --git a/app/locales/en/core.json b/app/locales/en/core.json
index 91525e3d9..e0e737414 100644
--- a/app/locales/en/core.json
+++ b/app/locales/en/core.json
@@ -668,5 +668,6 @@
"fileEditHistory": "Last edited files history",
"refreshHistory": "Refresh History",
"deleteHistory": "Delete History",
+ "quickAccess": "Quick access",
"-": "-"
}
diff --git a/app/perspectives/grid-perspective/components/MainContainer.tsx b/app/perspectives/grid-perspective/components/MainContainer.tsx
index e32c48a55..1f3ef9bc6 100644
--- a/app/perspectives/grid-perspective/components/MainContainer.tsx
+++ b/app/perspectives/grid-perspective/components/MainContainer.tsx
@@ -851,13 +851,18 @@ function GridPerspective(props: Props) {
>
<GridPagination
gridPageLimit={gridPageLimit.current}
- className={
- layoutType.current === 'grid'
- ? classes.gridContainer
- : classes.rowContainer
- }
+ // className={
+ // layoutType.current === 'grid'
+ // ? classes.gridContainer
+ // : classes.rowContainer
+ // }
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))'