Skip to content

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

chore: fixing small ui glitches

Ilian Sapundshievcc45dd8d3189
diff --git a/src/renderer/components/EditDescription.tsx b/src/renderer/components/EditDescription.tsx
index 723d83433..0af3c38a0 100644
--- a/src/renderer/components/EditDescription.tsx
+++ b/src/renderer/components/EditDescription.tsx
@@ -22,8 +22,9 @@ import { CrepeRef } from '-/components/md/useCrepeHandler';
import { useFilePropertiesContext } from '-/hooks/useFilePropertiesContext';
import { Pro } from '-/pro';
import { MilkdownProvider } from '@milkdown/react';
+import { Box } from '@mui/material';
import { useTheme } from '@mui/material/styles';
-import React, { useEffect, useRef } from 'react';
+import { useEffect, useRef } from 'react';
function EditDescription() {
const theme = useTheme();
@@ -50,8 +51,8 @@ function EditDescription() {
};
return (
- <div
- style={{
+ <Box
+ sx={{
height: 'calc(100% - 50px)',
}}
>
@@ -60,7 +61,7 @@ function EditDescription() {
resetMdContent={resetMdContent}
setEditMode={setEditMode}
/>
- <div
+ <Box
ref={milkdownDivRef}
className="descriptionEditor"
data-tid="descriptionTID"
@@ -70,7 +71,7 @@ function EditDescription() {
setEditMode(true);
}
}}
- style={{
+ sx={{
border: '1px solid lightgray',
borderRadius: AppConfig.defaultCSSRadius,
height: 'calc(100% - 20px)',
@@ -92,8 +93,8 @@ function EditDescription() {
<MilkdownProvider>
<DescriptionMdEditor ref={fileDescriptionRef} />
</MilkdownProvider>
- </div>
- </div>
+ </Box>
+ </Box>
);
}
diff --git a/src/renderer/components/chat/ChatView.tsx b/src/renderer/components/chat/ChatView.tsx
index 35099c4f5..a92c0e106 100644
--- a/src/renderer/components/chat/ChatView.tsx
+++ b/src/renderer/components/chat/ChatView.tsx
@@ -18,7 +18,7 @@
import { CloseIcon, MoreMenuIcon, OllamaIcon } from '-/components/CommonIcons';
import DragItemTypes from '-/components/DragItemTypes';
-import Tooltip from '-/components/Tooltip';
+import TooltipTS from '-/components/Tooltip';
import TsIconButton from '-/components/TsIconButton';
import TsTextField from '-/components/TsTextField';
import ChatDndTargetFile from '-/components/chat/ChatDndTargetFile';
@@ -359,15 +359,17 @@ function ChatView() {
input: {
startAdornment: (
<InputAdornment position="start" sx={{ height: 32 }}>
- <Tooltip
+ <TooltipTS
title={
aiDefaultProvider?.name +
' - ' +
- aiDefaultProvider?.engine
+ aiDefaultProvider?.url
}
>
- <OllamaIcon />
- </Tooltip>
+ <Box>
+ <OllamaIcon />
+ </Box>
+ </TooltipTS>
</InputAdornment>
),
endAdornment: (
@@ -376,16 +378,15 @@ function ChatView() {
<CircularProgress size={24} color="inherit" />
)}
{isLoading.current && (
- <Tooltip title={t('Cancel answer generation')}>
- <TsIconButton
- onClick={() => {
- isLoading.current = false;
- cancelMessage();
- }}
- >
- <CancelIcon />
- </TsIconButton>
- </Tooltip>
+ <TsIconButton
+ tooltip={t('core:cancelAnswerGeneration')}
+ onClick={() => {
+ isLoading.current = false;
+ cancelMessage();
+ }}
+ >
+ <CancelIcon />
+ </TsIconButton>
)}
<TsIconButton
tooltip={t('core:send')}
diff --git a/src/renderer/components/dialogs/KeyboardDialog.tsx b/src/renderer/components/dialogs/KeyboardDialog.tsx
index 211bf9169..c5b690698 100644
--- a/src/renderer/components/dialogs/KeyboardDialog.tsx
+++ b/src/renderer/components/dialogs/KeyboardDialog.tsx
@@ -19,8 +19,10 @@
import AppConfig from '-/AppConfig';
import DraggablePaper from '-/components/DraggablePaper';
import TsButton from '-/components/TsButton';
+import { SettingsTab } from '-/components/dialogs/SettingsDialog';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import { useSettingsDialogContext } from '-/components/dialogs/hooks/useSettingsDialogContext';
import { getKeyBindingObject } from '-/reducers/settings';
import Box from '@mui/material/Box';
import Dialog from '@mui/material/Dialog';
@@ -33,8 +35,6 @@ import { useTheme } from '@mui/material/styles';
import useMediaQuery from '@mui/material/useMediaQuery';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
-import { SettingsTab } from './SettingsDialog';
-import { useSettingsDialogContext } from './hooks/useSettingsDialogContext';
export function adjustKeyBinding(keyBinding: string) {
if (!keyBinding || !keyBinding.length) return '';
@@ -74,20 +74,6 @@ function KeyboardDialog(props: Props) {
const theme = useTheme();
const { openSettingsDialog } = useSettingsDialogContext();
const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
- const okButton = (
- <TsButton
- data-tid="closeKeyboardDialog"
- onClick={onClose}
- variant="outlined"
- sx={
- {
- WebkitAppRegion: 'no-drag',
- } as React.CSSProperties & { WebkitAppRegion?: string }
- }
- >
- {t('core:ok')}
- </TsButton>
- );
return (
<Dialog
@@ -102,7 +88,6 @@ function KeyboardDialog(props: Props) {
dialogTitle={t('core:shortcutKeys')}
closeButtonTestId="closeKeyboardTID"
onClose={onClose}
- actionSlot={okButton}
/>
<DialogContent
data-tid="keyboardShortCutsDialog"
@@ -117,13 +102,13 @@ function KeyboardDialog(props: Props) {
<ListItem key={shortcutKey}>
<ListItemText primary={t('core:' + shortcutKey)} />
<Box
- style={{
- backgroundColor: 'gray',
+ sx={{
+ backgroundColor: theme.palette.primary.main,
color: 'white',
font: 'Console',
fontFamily: 'monospace',
- padding: '5px',
- borderRadius: '5px',
+ padding: '5px 10px 5px 10px',
+ borderRadius: AppConfig.defaultCSSRadius,
}}
>
{adjustKeyBinding(keyBindings[shortcutKey])}
@@ -148,7 +133,9 @@ function KeyboardDialog(props: Props) {
>
{t('core:manageShortcutKeys')}
</TsButton>
- {okButton}
+ <TsButton data-tid="closeKeyboardDialog" onClick={onClose}>
+ {t('core:ok')}
+ </TsButton>
</TsDialogActions>
)}
</Dialog>
diff --git a/src/renderer/components/md/DescriptionMenu.tsx b/src/renderer/components/md/DescriptionMenu.tsx
index fb0c453ec..a742820ac 100644
--- a/src/renderer/components/md/DescriptionMenu.tsx
+++ b/src/renderer/components/md/DescriptionMenu.tsx
@@ -16,11 +16,10 @@
*
*/
-import React from 'react';
-import { ListItemIcon, Menu, MenuItem } from '@mui/material';
+import { HTMLFileIcon, MarkdownFileIcon } from '-/components/CommonIcons';
+import TsMenuList from '-/components/TsMenuList';
+import { ListItemIcon, ListItemText, Menu, MenuItem } from '@mui/material';
import { useTranslation } from 'react-i18next';
-import HtmlIcon from '@mui/icons-material/Html';
-import RttIcon from '@mui/icons-material/Rtt';
interface DescriptionMenuProps {
anchorEl: null | HTMLElement;
@@ -43,18 +42,20 @@ function DescriptionMenu(props: DescriptionMenuProps) {
transformOrigin={{ horizontal: 'right', vertical: 'top' }}
anchorOrigin={{ horizontal: 'right', vertical: 'bottom' }}
>
- <MenuItem onClick={saveAsHtml}>
- <ListItemIcon>
- <HtmlIcon fontSize="small" />
- </ListItemIcon>
- {t('core:saveAsHtml')}
- </MenuItem>
- <MenuItem onClick={saveAsMarkdown}>
- <ListItemIcon>
- <RttIcon fontSize="small" />
- </ListItemIcon>
- {t('core:saveAsMd')}
- </MenuItem>
+ <TsMenuList>
+ <MenuItem onClick={saveAsHtml}>
+ <ListItemIcon>
+ <HTMLFileIcon />
+ </ListItemIcon>
+ <ListItemText primary={t('core:saveAsHtml')} />
+ </MenuItem>
+ <MenuItem onClick={saveAsMarkdown}>
+ <ListItemIcon>
+ <MarkdownFileIcon />
+ </ListItemIcon>
+ <ListItemText primary={t('core:saveAsMd')} />
+ </MenuItem>
+ </TsMenuList>
</Menu>
);
}
diff --git a/src/renderer/locales/en/core.json b/src/renderer/locales/en/core.json
index 830f6eb4c..4abb53e29 100644
--- a/src/renderer/locales/en/core.json
+++ b/src/renderer/locales/en/core.json
@@ -927,6 +927,7 @@
"startDownload": "Start download",
"createdIn": "Created in",
"confirmHistoryDeletion": "Do you want to delete the AI-chat history?",
+ "cancelAnswerGeneration": "Cancel answer generation",
"doubleClickToOpen": "Double-click to open",
"tip": "Tip",
"generateSummary": "Generate Summary",