Skip to content

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

fix: show description in folder details

Ilian Sapundshiev3dac9f0ee1a7
diff --git a/app/components/EntryProperties.tsx b/app/components/EntryProperties.tsx
index 0e0dabcc0..2bfe95248 100644
--- a/app/components/EntryProperties.tsx
+++ b/app/components/EntryProperties.tsx
@@ -1098,16 +1098,18 @@ function EntryProperties(props: Props) {
<InputAdornment position="end">
<Stack direction="row" spacing={1}>
{defaultBackgrounds.map((background, cnt) => (
- <IconButton
- key={cnt}
- aria-label="fingerprint"
- onClick={() => handleChangeColor(background)}
- style={{
- backgroundImage: background
- }}
- >
- <SetBackgroundIcon />
- </IconButton>
+ <ProTooltip tooltip={i18n.t('changeBackgroundColor')}>
+ <IconButton
+ key={cnt}
+ aria-label="fingerprint"
+ onClick={() => handleChangeColor(background)}
+ style={{
+ backgroundImage: background
+ }}
+ >
+ <SetBackgroundIcon />
+ </IconButton>
+ </ProTooltip>
))}
{currentEntry.color && (
<>
diff --git a/app/perspectives/grid-perspective/components/CellContent.tsx b/app/perspectives/grid-perspective/components/CellContent.tsx
index c45e7ea22..346827fc3 100644
--- a/app/perspectives/grid-perspective/components/CellContent.tsx
+++ b/app/perspectives/grid-perspective/components/CellContent.tsx
@@ -116,7 +116,7 @@ function CellContent(props: Props) {
description = removeMarkDown(description);
if (description && description.length > maxDescriptionPreviewLength) {
- description = description.substr(0, maxDescriptionPreviewLength) + '...';
+ description = description.substring(0, maxDescriptionPreviewLength) + '...';
}
if (description && layoutType === 'row' && fsEntry.isFile) {
diff --git a/app/perspectives/grid-perspective/components/GridPagination.tsx b/app/perspectives/grid-perspective/components/GridPagination.tsx
index 4f7920d72..a13b1a13e 100644
--- a/app/perspectives/grid-perspective/components/GridPagination.tsx
+++ b/app/perspectives/grid-perspective/components/GridPagination.tsx
@@ -48,8 +48,13 @@ import {
} from '-/reducers/app';
import EntryIcon from '-/components/EntryIcon';
import TagsPreview from '-/components/TagsPreview';
+import TagContainer from '-/components/TagContainer';
import { TS } from '-/tagspaces.namespace';
-import { getMetaForEntry, convertMarkDown } from '-/services/utils-io';
+import {
+ getMetaForEntry,
+ convertMarkDown,
+ removeMarkDown
+} from '-/services/utils-io';
import PlatformIO from '-/services/platform-facade';
interface Props {
@@ -97,6 +102,7 @@ function GridPagination(props: Props) {
showDirectories,
showDetails,
showDescription,
+ showTags,
renderCell,
isAppLoading,
currentDirectoryColor,
@@ -344,6 +350,18 @@ function GridPagination(props: Props) {
);
}
+ let shortDescription = '';
+ if (currentDirectoryDescription) {
+ shortDescription = removeMarkDown(currentDirectoryDescription);
+ if (shortDescription && shortDescription.length > 200) {
+ shortDescription = shortDescription.substring(0, 200) + '...';
+ }
+ }
+
+ function renderTags(tags: Array<TS.Tag>) {
+ return;
+ }
+
return (
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions,jsx-a11y/no-static-element-interactions
<div
@@ -390,6 +408,7 @@ function GridPagination(props: Props) {
alignItems: 'center',
overflow: 'auto',
padding: 10,
+ marginRight: 160,
width: 'fit-content',
background: theme.palette.background.default,
// background: alpha(theme.palette.background.default, 0.9),
@@ -397,30 +416,57 @@ function GridPagination(props: Props) {
color: theme.palette.text.primary
}}
>
- <ButtonBase
- style={{ fontSize: '1.5rem' }}
- onClick={openRenameEntryDialog}
- >
- {folderName}
- </ButtonBase>
- <TagsPreview tags={currentDirectoryTags} />
+ <Tooltip title={i18n.t('core:renameDirectory')}>
+ <ButtonBase
+ style={{ fontSize: '1.5rem' }}
+ onClick={openRenameEntryDialog}
+ >
+ {folderName}
+ </ButtonBase>
+ </Tooltip>
+ {showTags ? (
+ <span style={{ paddingLeft: 5 }}>
+ {currentDirectoryTags.map((tag: TS.Tag) => {
+ return <TagContainer tag={tag} tagMode="display" />;
+ })}
+ </span>
+ ) : (
+ <TagsPreview tags={currentDirectoryTags} />
+ )}
+ </Box>
+ <Box
+ style={{
+ paddingBottom: 5,
+ background: theme.palette.background.default,
+ marginTop: -12,
+ marginRight: 160,
+ padding: 10,
+ borderRadius: 8,
+ width: 'fit-content',
+ color: theme.palette.text.primary
+ }}
+ >
+ {(directories.length > 0 || pageFiles.length > 0) && (
+ <Typography
+ style={{
+ fontSize: '0.9rem'
+ }}
+ >
+ {folderSummary}
+ </Typography>
+ )}
+ {!showDescription && shortDescription && (
+ <Tooltip title={i18n.t('core:filePropertiesDescription')}>
+ <Typography
+ style={{
+ fontSize: '0.8rem'
+ }}
+ >
+ {shortDescription}
+ </Typography>
+ </Tooltip>
+ )}
</Box>
- {(directories.length > 0 || pageFiles.length > 0) && (
- <Typography
- style={{
- fontSize: '0.9rem',
- paddingBottom: 5,
- background: theme.palette.background.default,
- marginTop: -12,
- padding: 10,
- borderRadius: 8,
- width: 'fit-content',
- color: theme.palette.text.primary
- }}
- >
- {folderSummary}
- </Typography>
- )}
<Tooltip title={i18n.t('core:thumbnail')}>
<div
style={{