Skip to content

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

chore: adding icons to the setting tabs

Ilian Sapundshievf64f88cc9180
diff --git a/src/renderer/components/CommonIcons.tsx b/src/renderer/components/CommonIcons.tsx
index a8b35a5ae..6b427cef3 100644
--- a/src/renderer/components/CommonIcons.tsx
+++ b/src/renderer/components/CommonIcons.tsx
@@ -16,7 +16,6 @@
*
*/
-import React from 'react';
import KeyboardReturnIcon from '@mui/icons-material/KeyboardReturn';
import MarkdownRawIcon from '@mui/icons-material/SimCardDownload';
@@ -45,7 +44,6 @@ export { default as GoBackIcon } from '@mui/icons-material/ArrowBack';
export { default as GoForwardIcon } from '@mui/icons-material/ArrowForward';
export { default as HelpIcon } from '@mui/icons-material/Help';
-
export { default as InfoIcon } from '@mui/icons-material/InfoOutlined';
export { default as FolderPropertiesIcon } from '@mui/icons-material/Info';
@@ -176,3 +174,13 @@ export { default as ThemingIcon } from '@mui/icons-material/InvertColors';
export { default as TagLibraryIcon } from '@mui/icons-material/LocalOfferOutlined';
export { default as RecentThingsIcon } from '@mui/icons-material/BookmarksOutlined';
+
+export { default as AIIcon } from '@mui/icons-material/Memory';
+
+export { default as ExtensionIcon } from '@mui/icons-material/Extension';
+
+export { default as KeyboardIcon } from '@mui/icons-material/Keyboard';
+
+export { default as OptionsIcon } from '@mui/icons-material/FactCheck';
+
+export { default as AdvancedSettingsIcon } from '@mui/icons-material/DisplaySettings';
diff --git a/src/renderer/components/dialogs/SettingsDialog.tsx b/src/renderer/components/dialogs/SettingsDialog.tsx
index efc8c6c90..70911be21 100644
--- a/src/renderer/components/dialogs/SettingsDialog.tsx
+++ b/src/renderer/components/dialogs/SettingsDialog.tsx
@@ -17,7 +17,16 @@
*/
import AppConfig from '-/AppConfig';
+import {
+ AIIcon,
+ AdvancedSettingsIcon,
+ ExtensionIcon,
+ FileIcon,
+ KeyboardIcon,
+ OptionsIcon,
+} from '-/components/CommonIcons';
import DraggablePaper from '-/components/DraggablePaper';
+import { BetaLabel } from '-/components/HelperComponents';
import TsButton from '-/components/TsButton';
import ConfirmDialog from '-/components/dialogs/ConfirmDialog';
import SettingsAdvanced from '-/components/dialogs/components/SettingsAdvanced';
@@ -27,7 +36,7 @@ import SettingsGeneral from '-/components/dialogs/components/SettingsGeneral';
import SettingsKeyBindings from '-/components/dialogs/components/SettingsKeyBindings';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
-import { isDesktopMode } from '-/reducers/settings';
+import { isDesktopMode, isDevMode } from '-/reducers/settings';
import { openURLExternally } from '-/services/utils-io';
import { clearAllURLParams } from '-/utils/dom';
import Dialog from '@mui/material/Dialog';
@@ -52,6 +61,7 @@ function SettingsDialog(props: Props) {
const { t } = useTranslation();
const [currentTab, setCurrentTab] = useState<number>(0);
const desktopMode = useSelector(isDesktopMode);
+ const devMode = useSelector(isDevMode);
const [isResetSettingsDialogOpened, setIsResetSettingsDialogOpened] =
useState<boolean>(false);
const { open, onClose } = props;
@@ -100,53 +110,70 @@ function SettingsDialog(props: Props) {
<Tab
style={{
textTransform: 'unset',
- fontSize: 16,
- alignItems: 'baseline',
- paddingLeft: 0,
+ justifyContent: 'flex-start',
}}
+ iconPosition="start"
+ icon={!smallScreen && <OptionsIcon />}
data-tid="generalSettingsDialog"
label={t('core:generalTab')}
/>
<Tab
style={{
textTransform: 'unset',
- fontSize: 16,
- alignItems: 'baseline',
- paddingLeft: 0,
+ justifyContent: 'flex-start',
}}
+ iconPosition="start"
+ icon={!smallScreen && <FileIcon />}
data-tid="fileTypeSettingsDialog"
label={t('core:fileTypeTab')}
/>
<Tab
style={{
textTransform: 'unset',
- fontSize: 16,
- alignItems: 'baseline',
- paddingLeft: 0,
+ justifyContent: 'flex-start',
}}
+ iconPosition="start"
+ icon={!smallScreen && <KeyboardIcon />}
data-tid="keyBindingsSettingsDialog"
label={t('core:keyBindingsTab')}
/>
<Tab
style={{
textTransform: 'unset',
- fontSize: 16,
- alignItems: 'baseline',
- paddingLeft: 0,
+ justifyContent: 'flex-start',
}}
+ iconPosition="start"
+ icon={!smallScreen && <ExtensionIcon />}
data-tid="extensionsSettingsDialog"
label={t('core:extensionsTab')}
/>
<Tab
style={{
textTransform: 'unset',
- fontSize: 16,
- alignItems: 'baseline',
- paddingLeft: 0,
+ justifyContent: 'flex-start',
}}
+ iconPosition="start"
+ icon={!smallScreen && <AdvancedSettingsIcon />}
data-tid="advancedSettingsDialogTID"
label={t('core:advancedSettingsTab')}
/>
+ {devMode && (
+ <Tab
+ style={{
+ textTransform: 'unset',
+ justifyContent: 'flex-start',
+ }}
+ data-tid="aiSettingsDialogTID"
+ iconPosition="start"
+ icon={!smallScreen && <AIIcon />}
+ label={
+ <span style={{ whiteSpace: 'nowrap' }}>
+ {t('core:aiSettingsTab')}
+ <BetaLabel />
+ </span>
+ }
+ />
+ )}
</Tabs>
<div
data-tid="settingsDialog"
@@ -167,6 +194,7 @@ function SettingsDialog(props: Props) {
showResetSettings={setIsResetSettingsDialogOpened}
/>
)}
+ {/* {currentTab === 5 && <SettingsAI />} */}
</div>
{isResetSettingsDialogOpened && (
<ConfirmDialog
diff --git a/src/renderer/components/dialogs/components/SettingsExtensions.tsx b/src/renderer/components/dialogs/components/SettingsExtensions.tsx
index f51d5cd1f..1a63c9d1a 100644
--- a/src/renderer/components/dialogs/components/SettingsExtensions.tsx
+++ b/src/renderer/components/dialogs/components/SettingsExtensions.tsx
@@ -16,30 +16,30 @@
*
*/
-import React, { ChangeEvent, useRef, useState } from 'react';
-import { useSelector, useDispatch } from 'react-redux';
-import { Accordion, AccordionDetails, AccordionSummary } from '@mui/material';
-import Typography from '@mui/material/Typography';
+import AppConfig from '-/AppConfig';
+import InfoIcon from '-/components/InfoIcon';
+import TsButton from '-/components/TsButton';
+import TsIconButton from '-/components/TsIconButton';
+import ConfirmDialog from '-/components/dialogs/ConfirmDialog';
+import { useFileUploadDialogContext } from '-/components/dialogs/hooks/useFileUploadDialogContext';
+import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
+import { useExtensionsContext } from '-/hooks/useExtensionsContext';
+import { useIOActionsContext } from '-/hooks/useIOActionsContext';
+import { actions as AppActions, AppDispatch } from '-/reducers/app';
+import { actions as SettingsActions, isDevMode } from '-/reducers/settings';
+import { getUserDataDir, loadExtensions, unZip } from '-/services/utils-io';
+import { TS } from '-/tagspaces.namespace';
+import DeleteIcon from '@mui/icons-material/Delete';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
+import { Accordion, AccordionDetails, AccordionSummary } from '@mui/material';
import Box from '@mui/material/Box';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
-import TsIconButton from '-/components/TsIconButton';
import Switch from '@mui/material/Switch';
-import TsButton from '-/components/TsButton';
-import DeleteIcon from '@mui/icons-material/Delete';
-import { actions as SettingsActions, isDevMode } from '-/reducers/settings';
-import { actions as AppActions, AppDispatch } from '-/reducers/app';
-import { TS } from '-/tagspaces.namespace';
-import ConfirmDialog from '-/components/dialogs/ConfirmDialog';
-import InfoIcon from '-/components/InfoIcon';
+import Typography from '@mui/material/Typography';
+import { ChangeEvent, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
-import { useIOActionsContext } from '-/hooks/useIOActionsContext';
-import { getUserDataDir, loadExtensions, unZip } from '-/services/utils-io';
-import AppConfig from '-/AppConfig';
-import { useFileUploadDialogContext } from '-/components/dialogs/hooks/useFileUploadDialogContext';
-import { useExtensionsContext } from '-/hooks/useExtensionsContext';
+import { useDispatch, useSelector } from 'react-redux';
function SettingsExtensions() {
const { t } = useTranslation();
@@ -51,8 +51,6 @@ function SettingsExtensions() {
const fileInputRef = useRef<HTMLInputElement>(null);
const [removeExtDialogOpened, setRemoveExtDialogOpened] =
useState<TS.Extension>(undefined);
-
- //const extension = useSelector(getExtensions);
const devMode = useSelector(isDevMode);
const dispatch: AppDispatch = useDispatch();
@@ -103,15 +101,22 @@ function SettingsExtensions() {
};
return (
- <div style={{ overflowX: 'hidden', overflowY: 'auto', height: '100%' }}>
+ <div
+ style={{
+ overflowX: 'hidden',
+ overflowY: 'auto',
+ height: '100%',
+ padding: 10,
+ }}
+ >
<Accordion defaultExpanded>
<AccordionSummary
expandIcon={<ExpandMoreIcon />}
aria-controls="internal-content"
id="internal-header"
>
- <Typography variant="h6" style={{ marginRight: 10 }}>
- Core Extensions
+ <Typography style={{ fontWeight: 'bold' }}>
+ {t('core:coreExtensions')}
</Typography>
<InfoIcon tooltip="These are extensions which are packaged with the current version of the app" />
</AccordionSummary>
@@ -135,8 +140,8 @@ function SettingsExtensions() {
aria-controls="installed-content"
id="installed-header"
>
- <Typography variant="h6" style={{ marginRight: 10 }}>
- Installed Extensions
+ <Typography style={{ fontWeight: 'bold' }}>
+ {t('core:thirdPartyExtensions')}
</Typography>
<InfoIcon tooltip="Extensions manually installed on top of the current app installation" />
</AccordionSummary>
diff --git a/src/renderer/locales/en/core.json b/src/renderer/locales/en/core.json
index 6f421c126..3ea365a63 100644
--- a/src/renderer/locales/en/core.json
+++ b/src/renderer/locales/en/core.json
@@ -875,5 +875,12 @@
"tagPreview": "Tag Preview",
"generateNewLocationId": "Generates new unique identifier for this location",
"abort": "Abort",
+ "coreExtensions": "Core Extensions",
+ "thirdPartyExtensions": "Third-party Extensions",
+ "aiSettingsTab": "AI",
+ "serviceStatus": "Service Status",
+ "available": "Available",
+ "defaultAImodelText": "Default model for text-based tasks",
+ "defaultAImodelImages": "Default model for image-based tasks",
"-": "-"
}