Skip to content

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

chore: improve file editing usability

Ilian Sapundshiev9d731e7ee19d
diff --git a/src/renderer/components/EntryContainer.tsx b/src/renderer/components/EntryContainer.tsx
index fe304c1bb..d0fd999f6 100644
--- a/src/renderer/components/EntryContainer.tsx
+++ b/src/renderer/components/EntryContainer.tsx
@@ -574,31 +574,33 @@ function EntryContainer() {
color="primary"
startIcon={closeCancelIcon}
>
- {fileChanged ? t('core:cancel') : t('core:closeButton')}
+ {fileChanged ? t('core:cancel') : t('core:exitEditMode')}
</Button>
</Tooltip>
- <Tooltip
- title={
- t('core:saveFile') +
- ' (' +
- (AppConfig.isMacLike ? '⌘' : 'CTRL') +
- ' + S)'
- }
- >
- <LoadingButton
- disabled={false}
- onClick={startSavingFile}
- aria-label={t('core:saveFile')}
- data-tid="fileContainerSaveFile"
- size="small"
- variant="outlined"
- color="primary"
- startIcon={desktopMode && <SaveIcon />}
- loading={isSavingInProgress.current}
+ {fileChanged && (
+ <Tooltip
+ title={
+ t('core:saveFile') +
+ ' (' +
+ (AppConfig.isMacLike ? '⌘' : 'CTRL') +
+ ' + S)'
+ }
>
- {t('core:save')}
- </LoadingButton>
- </Tooltip>
+ <LoadingButton
+ disabled={false}
+ onClick={startSavingFile}
+ aria-label={t('core:saveFile')}
+ data-tid="fileContainerSaveFile"
+ size="small"
+ variant="outlined"
+ color="primary"
+ startIcon={desktopMode && <SaveIcon />}
+ loading={isSavingInProgress.current}
+ >
+ {t('core:save')}
+ </LoadingButton>
+ </Tooltip>
+ )}
</ButtonGroup>
);
} else {
diff --git a/src/renderer/locales/en/core.json b/src/renderer/locales/en/core.json
index 39788037a..24ab64b96 100644
--- a/src/renderer/locales/en/core.json
+++ b/src/renderer/locales/en/core.json
@@ -855,5 +855,6 @@
"toggleKeyVisibility": "Toggle key visibility",
"dragMode": "Enable dragging files outside of the application",
"dragOutsideApp": "Drag outside the app",
+ "exitEditMode": "Exit editing",
"-": "-"
}