TagSpaces is an offline, open source, document manager with tagging support
core: adding tooltip and usability improvments
Ilian Sapundshieva752e9c5dfe8
diff --git a/app/components/CustomLogo.tsx b/app/components/CustomLogo.tsxindex 58984cb60..5575f6659 100644--- a/app/components/CustomLogo.tsx+++ b/app/components/CustomLogo.tsx@@ -22,6 +22,7 @@ import { bindActionCreators } from 'redux';import IconButton from '@material-ui/core/IconButton';import { withStyles } from '@material-ui/core/styles';import Badge from '@material-ui/core/Badge';+import Tooltip from '@material-ui/core/Tooltip';import { Pro } from '../pro';import TextLogoIcon from '../assets/images/text-logo.svg';import WebLogoIcon from '../assets/images/text-logo-web.svg';@@ -59,38 +60,39 @@ if (AppConfig.customLogo) {}const CustomLogo = (props: Props) => (- <AppVersionBadge- title="App Version"- badgeContent={'v' + versionMeta.version}- color="primary"- >- <IconButton+ <Tooltip title={i18n.t('core:aboutTitle')}>+ <AppVersionBadgeonClick={props.toggleAboutDialog}- style={{ padding: 0, paddingLeft: 5, height: 50 }}- title={i18n.t('core:aboutTitle')}- data-tid="aboutTagSpaces"+ badgeContent={'v' + versionMeta.version}+ color="primary">- <img- style={{- width: 40- // color: props.theme.palette.text.primary- }}- src={LogoIcon}- alt="TagSpaces Logo"- />- </IconButton>- <IconButton- style={{ height: 50, padding: 0, marginBottom: 15 }}- data-tid="aboutTagSpaces"- onClick={props.toggleAboutDialog}- >- <img- style={{ maxHeight: 50, maxWidth: 200 }}- src={logo}- alt="TagSpaces"- />- </IconButton>- </AppVersionBadge>+ <IconButton+ onClick={props.toggleAboutDialog}+ style={{ padding: 0, paddingLeft: 5, height: 50 }}+ data-tid="aboutTagSpaces"+ >+ <img+ style={{+ width: 40+ // color: props.theme.palette.text.primary+ }}+ src={LogoIcon}+ alt="TagSpaces Logo"+ />+ </IconButton>+ <IconButton+ style={{ height: 50, padding: 0, marginBottom: 15 }}+ data-tid="aboutTagSpaces"+ onClick={props.toggleAboutDialog}+ >+ <img+ style={{ maxHeight: 50, maxWidth: 200 }}+ src={logo}+ alt="TagSpaces"+ />+ </IconButton>+ </AppVersionBadge>+ </Tooltip>);function mapActionCreatorsToProps(dispatch) {diff --git a/app/components/FolderContainer.tsx b/app/components/FolderContainer.tsxindex 09ec03c23..e045ffa41 100644--- a/app/components/FolderContainer.tsx+++ b/app/components/FolderContainer.tsx@@ -34,7 +34,11 @@ import ToggleButton from '@material-ui/lab/ToggleButton';import ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';import LocationMenu from './menus/LocationMenu';import i18n from '../services/i18n';-import { getMaxSearchResults, getDesktopMode } from '-/reducers/settings';+import {+ getMaxSearchResults,+ getDesktopMode,+ getKeyBindingObject+} from '-/reducers/settings';import {actions as AppActions,getDirectoryContent,@@ -213,6 +217,7 @@ interface Props {setSearchQuery: (searchQuery: TS.SearchQuery) => void;openCurrentDirectory: () => void;openURLExternally?: (url: string, skipConfirmation: boolean) => void;+ keyBindings: Array<any>;}const FolderContainer = (props: Props) => {@@ -391,7 +396,8 @@ const FolderContainer = (props: Props) => {openDirectory,reflectCreateEntry,openFsEntry,- isLoading+ isLoading,+ keyBindings} = props;/* let searchResultCounterText = searchResultCount + ' ' + i18n.t('entries');@@ -543,20 +549,29 @@ const FolderContainer = (props: Props) => {openSearchPanel();}}/> */}- <CustomButton- data-tid="toggleSearch"- onClick={() => {- if (isSearchVisible) {- props.setSearchQuery({});- props.openCurrentDirectory();- } else {- setSearchVisible(!isSearchVisible);- }- return true;- }}+ <Tooltip+ title={+ i18n.t('showSearch')+ // ++ // ' - ' ++ // keyBindings['openSearch'].toUpperCase()+ }>- <SearchIcon />- </CustomButton>+ <CustomButton+ data-tid="toggleSearch"+ onClick={() => {+ if (isSearchVisible) {+ props.setSearchQuery({});+ props.openCurrentDirectory();+ } else {+ setSearchVisible(!isSearchVisible);+ }+ return true;+ }}+ >+ <SearchIcon />+ </CustomButton>+ </Tooltip>{isSearchVisible ? (<><SearchInline />@@ -716,7 +731,8 @@ function mapStateToProps(state) {isReadOnlyMode: isReadOnlyMode(state),progress: getProgress(state),searchQuery: getSearchQuery(state),- isLoading: isLoading(state)+ isLoading: isLoading(state),+ keyBindings: getKeyBindingObject(state)};}diff --git a/app/components/PathBreadcrumbs.tsx b/app/components/PathBreadcrumbs.tsxindex 976b108f8..c4093f818 100644--- a/app/components/PathBreadcrumbs.tsx+++ b/app/components/PathBreadcrumbs.tsx@@ -19,6 +19,7 @@import React, { useState } from 'react';import { emphasize, withStyles, Theme } from '@material-ui/core/styles';import Breadcrumbs from '@material-ui/core/Breadcrumbs';+import Tooltip from '@material-ui/core/Tooltip';import Chip from '@material-ui/core/Chip';import ExpandMoreIcon from '@material-ui/icons/MoreVert';import PlatformIO from '../services/platform-facade';@@ -169,36 +170,40 @@ export default function PathBreadcrumbs(props: Props) {{/* <LocationMenu /> */}{pathParts.length > 0 &&pathParts.map(pathPart => (- <StyledBreadcrumb- key={pathPart}- component="a"- href="#"- label={extractShortDirectoryName(- pathPart,- PlatformIO.getDirSeparator()- )}- onClick={() => loadDirectoryContent(pathPart, false)}- title={'Navigate to: ' + pathPart}- />+ <Tooltip title={i18n.t('core:navigateTo') + ' ' + pathPart}>+ <StyledBreadcrumb+ key={pathPart}+ component="a"+ href="#"+ label={extractShortDirectoryName(+ pathPart,+ PlatformIO.getDirSeparator()+ )}+ onClick={() => loadDirectoryContent(pathPart, false)}+ />+ </Tooltip>))}{props.currentDirectoryPath && (- <StyledBreadcrumb- data-tid="folderContainerOpenDirMenu"+ <Tooltiptitle={i18n.t('core:openDirectoryMenu') +' - ' +(currentDirectoryPath || '')}- label={extractShortDirectoryName(- normalizePath(normalizedCurrentDirPath),- '/'- )}- deleteIcon={<ExpandMoreIcon />}- //onClick={handleClick}- onDelete={openDirectoryMenu}- onClick={openDirectoryMenu}- onContextMenu={openDirectoryMenu}- />+ >+ <StyledBreadcrumb+ data-tid="folderContainerOpenDirMenu"+ label={extractShortDirectoryName(+ normalizePath(normalizedCurrentDirPath),+ '/'+ )}+ deleteIcon={<ExpandMoreIcon />}+ //onClick={handleClick}+ onDelete={openDirectoryMenu}+ onClick={openDirectoryMenu}+ onContextMenu={openDirectoryMenu}+ />+ </Tooltip>)}</NoWrapBreadcrumb><DirectoryMenudiff --git a/app/components/dialogs/KeyboardDialog.tsx b/app/components/dialogs/KeyboardDialog.tsxindex ad9bb0b19..7939c5698 100644--- a/app/components/dialogs/KeyboardDialog.tsx+++ b/app/components/dialogs/KeyboardDialog.tsx@@ -80,7 +80,7 @@ const KeyboardDialog = (props: Props) => {<ListItem key={shortcutKey}><ListItemText primary={i18n.t('core:' + shortcutKey)} /><ListItemSecondaryAction className={props.classes.shortcutKey}>- {props.keyBindings[shortcutKey]}+ {props.keyBindings[shortcutKey].toUpperCase()}</ListItemSecondaryAction></ListItem>))}diff --git a/app/components/menus/DirectoryMenu.tsx b/app/components/menus/DirectoryMenu.tsxindex cb82d090e..ccd523661 100644--- a/app/components/menus/DirectoryMenu.tsx+++ b/app/components/menus/DirectoryMenu.tsx@@ -620,7 +620,7 @@ Do you want to continue?`)key={perspective.key}data-tid={perspective.key}onClick={() => switchPerspective(perspective.id)}- title={perspective.tooltip}+ // title={perspective.tooltip}><ListItemIcon>{perspective.icon}</ListItemIcon><ListItemTextdiff --git a/app/components/menus/LocationMenu.tsx b/app/components/menus/LocationMenu.tsxindex 8eb444027..15a420b37 100644--- a/app/components/menus/LocationMenu.tsx+++ b/app/components/menus/LocationMenu.tsx@@ -26,6 +26,7 @@ import CloudLocationIcon from '@material-ui/icons/CloudQueue';import ListItemIcon from '@material-ui/core/ListItemIcon';import ListItemText from '@material-ui/core/ListItemText';import ListSubHeader from '@material-ui/core/ListSubheader';+import Tooltip from '@material-ui/core/Tooltip';import { withTheme } from '@material-ui/core/styles';import Button from '@material-ui/core/Button';import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown';@@ -75,24 +76,30 @@ const LocationMenu = (props: Props) => {backgroundColor: theme.palette.background.default}}>- <Button- data-tid="folderContainerLocationChooser"- id="locationMenuButton"- onClick={event => setLocationChooserMenuAnchorEl(event.currentTarget)}- title={currentLocation && currentLocation.name}- style={{- marginTop: 5,- paddingRight: 0,- paddingLeft: 0,- marginRight: 5,- borderRadius: 15- }}+ <Tooltip+ title={+ currentLocation &&+ i18n.t('currentLocation') + ': ' + currentLocation.name+ }>- {currentLocation- ? locationIcon // this.state.currentLocation.name- : i18n.t('core:pleaseOpenLocation')}- <ArrowDropDownIcon />- </Button>+ <Button+ data-tid="folderContainerLocationChooser"+ id="locationMenuButton"+ onClick={event => setLocationChooserMenuAnchorEl(event.currentTarget)}+ style={{+ marginTop: 5,+ paddingRight: 0,+ paddingLeft: 0,+ marginRight: 5,+ borderRadius: 15+ }}+ >+ {currentLocation+ ? locationIcon // this.state.currentLocation.name+ : i18n.t('core:pleaseOpenLocation')}+ <ArrowDropDownIcon />+ </Button>+ </Tooltip>{Boolean(locationChooserMenuAnchorEl) && (<Menuid="simple-menu"diff --git a/app/locales/en/core.json b/app/locales/en/core.jsonindex 090ce444b..d225baa91 100644--- a/app/locales/en/core.json+++ b/app/locales/en/core.json@@ -636,5 +636,7 @@"advancedSearch": "Advanced Search","new": "New","perspectiveInPro": "This perspective is part of TagSpaces Pro. Do you want to learn more about it?",+ "currentLocation": "Current Location",+ "navigateTo": "Navigate to","-": "-"}diff --git a/app/perspectives/grid-perspective/components/CellContent.tsx b/app/perspectives/grid-perspective/components/CellContent.tsxindex d7a96422c..55515721f 100644--- a/app/perspectives/grid-perspective/components/CellContent.tsx+++ b/app/perspectives/grid-perspective/components/CellContent.tsx@@ -21,6 +21,7 @@ import classNames from 'classnames';import Grid from '@material-ui/core/Grid';import Typography from '@material-ui/core/Typography';import Paper from '@material-ui/core/Paper';+import Tooltip from '@material-ui/core/Tooltip';import FolderIcon from '@material-ui/icons/Folder';import SelectedIcon from '@material-ui/icons/CheckBox';import UnSelectedIcon from '@material-ui/icons/CheckBoxOutlineBlank';@@ -182,53 +183,56 @@ const CellContent = (props: Props) => {{showTags && entryTags ? renderTags(entryTags) : tagPlaceholder}</div>{description && (- <Typography- id="gridCellDescription"- className={classes.gridCellDescription}- title={i18n.t('core:filePropertiesDescription')}- variant="caption"- >- {description}- </Typography>+ <Tooltip title={i18n.t('core:entryDescription')}>+ <Typography+ id="gridCellDescription"+ className={classes.gridCellDescription}+ variant="caption"+ >+ {description}+ </Typography>+ </Tooltip>)}</div>- <Typography- className={classes.gridCellTitle}- data-tid={'fsEntryName_' + fsEntry.name}- title={fsEntry.path}- noWrap={true}- variant="body1"- >- {entryTitle}- </Typography>- <div className={classes.gridDetails}>+ <Tooltip title={fsEntry.path}><Typography- className={classes.gridFileExtension}- style={{- backgroundColor: fsEntryColor,- textShadow: '1px 1px #8f8f8f',- maxWidth: fsEntry.isFile ? 50 : 100- }}+ className={classes.gridCellTitle}+ data-tid={'fsEntryName_' + fsEntry.name}noWrap={true}- variant="button"- title={fsEntry.path}+ variant="body1">- {fsEntry.isFile ? fsEntry.extension : i18n.t('core:folder')}+ {entryTitle}</Typography>+ </Tooltip>+ <div className={classes.gridDetails}>+ <Tooltip title={fsEntry.path}>+ <Typography+ className={classes.gridFileExtension}+ style={{+ backgroundColor: fsEntryColor,+ textShadow: '1px 1px #8f8f8f',+ maxWidth: fsEntry.isFile ? 50 : 100+ }}+ noWrap={true}+ variant="button"+ >+ {fsEntry.isFile ? fsEntry.extension : i18n.t('core:folder')}+ </Typography>+ </Tooltip>{fsEntry.isFile && fsEntry.lmdt && (<Typography className={classes.gridSizeDate} variant="caption">- <span+ <Tooltiptitle={i18n.t('core:modifiedDate') +': ' +formatDateTime(fsEntry.lmdt, true)}>- {formatDateTime(fsEntry.lmdt, false)}- </span>- <span title={fsEntry.size + ' ' + i18n.t('core:sizeInBytes')}>- {' | ' + formatFileSize(fsEntry.size)}- </span>+ <span>{formatDateTime(fsEntry.lmdt, false)}</span>+ </Tooltip>+ <Tooltip title={fsEntry.size + ' ' + i18n.t('core:sizeInBytes')}>+ <span>{' | ' + formatFileSize(fsEntry.size)}</span>+ </Tooltip></Typography>)}</div>@@ -278,32 +282,33 @@ const CellContent = (props: Props) => {display: 'flex'}}>- <div- data-tid="rowCellTID"- className={classes.rowFileExtension}- role="presentation"- title={fsEntry.path}- onClick={e => {- e.stopPropagation();- if (selected) {- deselectEntry(fsEntry);- } else {- selectEntry(fsEntry);- }- }}- style={{- backgroundColor: fsEntryColor,- alignSelf: entrySize === 'small' ? 'center' : 'auto'- }}- >- {fsEntry.isFile ? fsEntry.extension : <FolderIcon />}- {entrySize !== 'small' &&- (selected ? (- <SelectedIcon style={{ paddingTop: 5 }} />- ) : (- <UnSelectedIcon style={{ paddingTop: 5 }} />- ))}- </div>+ <Tooltip title={fsEntry.path}>+ <div+ data-tid="rowCellTID"+ className={classes.rowFileExtension}+ role="presentation"+ onClick={e => {+ e.stopPropagation();+ if (selected) {+ deselectEntry(fsEntry);+ } else {+ selectEntry(fsEntry);+ }+ }}+ style={{+ backgroundColor: fsEntryColor,+ alignSelf: entrySize === 'small' ? 'center' : 'auto'+ }}+ >+ {fsEntry.isFile ? fsEntry.extension : <FolderIcon />}+ {entrySize !== 'small' &&+ (selected ? (+ <SelectedIcon style={{ paddingTop: 5 }} />+ ) : (+ <UnSelectedIcon style={{ paddingTop: 5 }} />+ ))}+ </div>+ </Tooltip></Grid>{entrySize === 'small' ? (<Grid@@ -313,15 +318,20 @@ const CellContent = (props: Props) => {style={{display: 'flex'}}- title={- fsEntry.isFile ? entrySizeFormatted + entryLMDTFormatted : ''- }>- <Typography style={{ wordBreak: 'break-all', alignSelf: 'center' }}>- {entryTitle}- - {showTags && entryTags ? renderTags(entryTags) : tagPlaceholder}- </Typography>+ <Tooltip+ title={+ fsEntry.isFile ? entrySizeFormatted + entryLMDTFormatted : ''+ }+ >+ <Typography+ style={{ wordBreak: 'break-all', alignSelf: 'center' }}+ >+ {entryTitle}+ + {showTags && entryTags ? renderTags(entryTags) : tagPlaceholder}+ </Typography>+ </Tooltip></Grid>) : (<Grid item xs zeroMinWidth>@@ -335,19 +345,21 @@ const CellContent = (props: Props) => {}}variant="body2">- <span title={fsEntry.size + ' ' + i18n.t('core:sizeInBytes')}>- {entrySizeFormatted}- </span>- <span+ <Tooltip title={fsEntry.size + ' ' + i18n.t('core:sizeInBytes')}>+ <span>{entrySizeFormatted}</span>+ </Tooltip>+ <Tooltiptitle={i18n.t('core:modifiedDate') +': ' +formatDateTime(fsEntry.lmdt, true)}>- {entryLMDTFormatted}- </span>- <span title={i18n.t('core:entryDescription')}>{description}</span>+ <span>{entryLMDTFormatted}</span>+ </Tooltip>+ <Tooltip title={i18n.t('core:entryDescription')}>+ <span>{description}</span>+ </Tooltip></Typography></Grid>)}diff --git a/app/perspectives/grid-perspective/components/MainToolbar.tsx b/app/perspectives/grid-perspective/components/MainToolbar.tsxindex b2ab80fe2..f7d15b1ad 100644--- a/app/perspectives/grid-perspective/components/MainToolbar.tsx+++ b/app/perspectives/grid-perspective/components/MainToolbar.tsx@@ -41,6 +41,7 @@ import {actions as LocationIndexActions,getSearchQuery} from '-/reducers/location-index';+import { getKeyBindingObject } from '-/reducers/settings';import { getAllPropertiesPromise } from '-/services/utils-io';import { TS } from '-/tagspaces.namespace';import { actions as AppActions } from '-/reducers/app';@@ -66,6 +67,7 @@ interface Props {setSearchQuery: (searchQuery: TS.SearchQuery) => void;openCurrentDirectory: () => void;directoryPath: string;+ keyBindings: Array<any>;}const MainToolbar = (props: Props) => {@@ -83,7 +85,8 @@ const MainToolbar = (props: Props) => {openDeleteFileDialog,fileOperationsEnabled,handleSortingMenu,- openSettings+ openSettings,+ keyBindings} = props;function showProperties() {@@ -104,7 +107,13 @@ const MainToolbar = (props: Props) => {return (<Toolbar className={classes.topToolbar} data-tid="perspectiveGridToolbar">- <Tooltip title={i18n.t('core:toggleSelectAllFiles')}>+ <Tooltip+ title={+ i18n.t('core:toggleSelectAllFiles') ++ ' - ' ++ keyBindings['selectAll'].toUpperCase()+ }+ ><IconButtondata-tid="gridPerspectiveSelectAllFiles"onClick={toggleSelectAllFiles}@@ -112,7 +121,13 @@ const MainToolbar = (props: Props) => {{someFileSelected ? <SelectAllIcon /> : <DeSelectAllIcon />}</IconButton></Tooltip>- <Tooltip title={i18n.t('core:navigateToParentDirectory')}>+ <Tooltip+ title={+ i18n.t('core:navigateToParentDirectory') ++ ' - ' ++ keyBindings['openParentDirectory'].toUpperCase()+ }+ ><IconButtonaria-label={i18n.t('core:navigateToParentDirectory')}data-tid="gridPerspectiveOnBackButton"@@ -166,45 +181,51 @@ const MainToolbar = (props: Props) => {</Tooltip>)} */}{!isReadOnlyMode && (- <Tooltip title={i18n.t('core:tagSelectedEntries')}>- <span>- <IconButton- aria-label={i18n.t('core:tagSelectedEntries')}- data-tid="gridPerspectiveAddRemoveTags"- disabled={selectedEntries.length < 1}- onClick={openAddRemoveTagsDialog}- >- <TagIcon />- </IconButton>- </span>+ <Tooltip+ title={+ i18n.t('core:tagSelectedEntries') ++ ' - ' ++ keyBindings['addRemoveTags'].toUpperCase()+ }+ >+ <IconButton+ aria-label={i18n.t('core:tagSelectedEntries')}+ data-tid="gridPerspectiveAddRemoveTags"+ disabled={selectedEntries.length < 1}+ onClick={openAddRemoveTagsDialog}+ >+ <TagIcon />+ </IconButton></Tooltip>)}{!isReadOnlyMode && (<Tooltip title={i18n.t('core:copyMoveSelectedEntries')}>- <span>- <IconButton- aria-label={i18n.t('core:copyMoveSelectedEntries')}- data-tid="gridPerspectiveCopySelectedFiles"- disabled={!fileOperationsEnabled}- onClick={openMoveCopyFilesDialog}- >- <CopyIcon />- </IconButton>- </span>+ <IconButton+ aria-label={i18n.t('core:copyMoveSelectedEntries')}+ data-tid="gridPerspectiveCopySelectedFiles"+ disabled={!fileOperationsEnabled}+ onClick={openMoveCopyFilesDialog}+ >+ <CopyIcon />+ </IconButton></Tooltip>)}{!isReadOnlyMode && (- <Tooltip title={i18n.t('core:deleteSelectedEntries')}>- <span>- <IconButton- aria-label={i18n.t('core:deleteSelectedEntries')}- data-tid="gridPerspectiveDeleteMultipleFiles"- disabled={!fileOperationsEnabled}- onClick={openDeleteFileDialog}- >- <DeleteIcon />- </IconButton>- </span>+ <Tooltip+ title={+ i18n.t('core:deleteSelectedEntries') ++ ' - ' ++ keyBindings['deleteDocument'].toUpperCase()+ }+ >+ <IconButton+ aria-label={i18n.t('core:deleteSelectedEntries')}+ data-tid="gridPerspectiveDeleteMultipleFiles"+ disabled={!fileOperationsEnabled}+ onClick={openDeleteFileDialog}+ >+ <DeleteIcon />+ </IconButton></Tooltip>)}<Tooltip title={i18n.t('core:sort')}>@@ -245,7 +266,8 @@ const MainToolbar = (props: Props) => {function mapStateToProps(state) {return {- searchQuery: getSearchQuery(state)+ searchQuery: getSearchQuery(state),+ keyBindings: getKeyBindingObject(state)};}function mapDispatchToProps(dispatch) {