TagSpaces is an offline, open source, document manager with tagging support
chore: changes in the loading button
Ilian Sapundshiev7c02a0733828
diff --git a/package-lock.json b/package-lock.jsonindex d00716e45..06fdad4a9 100644--- a/package-lock.json+++ b/package-lock.json@@ -18,9 +18,9 @@"@milkdown/crepe": "^7.6.3","@milkdown/kit": "^7.6.3","@milkdown/react": "^7.6.3",- "@mui/icons-material": "^6.4.4",+ "@mui/icons-material": "^6.4.8","@mui/lab": "6.0.0-beta.31",- "@mui/material": "^6.4.4",+ "@mui/material": "^6.4.8","@mui/x-date-pickers": "^7.26.0","@tagspaces/tagspaces-common": "4.5.54","@tagspaces/tagspaces-common-aws3": "4.5.54",@@ -16281,9 +16281,9 @@}},"node_modules/@mui/icons-material": {- "version": "6.4.7",- "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-6.4.7.tgz",- "integrity": "sha512-Rk8cs9ufQoLBw582Rdqq7fnSXXZTqhYRbpe1Y5SAz9lJKZP3CIdrj0PfG8HJLGw1hrsHFN/rkkm70IDzhJsG1g==",+ "version": "6.4.8",+ "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-6.4.8.tgz",+ "integrity": "sha512-LKGWiLWRyoOw3dWxZQ+lV//mK+4DVTTAiLd2ljmJdD6XV0rDB8JFKjRD9nyn9cJAU5XgWnii7ZR3c93ttUnMKg==","license": "MIT","dependencies": {"@babel/runtime": "^7.26.0"@@ -16296,7 +16296,7 @@"url": "https://opencollective.com/mui-org"},"peerDependencies": {- "@mui/material": "^6.4.7",+ "@mui/material": "^6.4.8","@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0","react": "^17.0.0 || ^18.0.0 || ^19.0.0"},diff --git a/package.json b/package.jsonindex c8e66f685..5e2dccfc8 100644--- a/package.json+++ b/package.json@@ -165,9 +165,9 @@"@emotion/react": "11.11.1","@emotion/styled": "11.11.0","@gorillastack/jmespath": "^1.3.0",- "@mui/icons-material": "^6.4.4",+ "@mui/icons-material": "^6.4.8","@mui/lab": "6.0.0-beta.31",- "@mui/material": "^6.4.4",+ "@mui/material": "^6.4.8","@mui/x-date-pickers": "^7.26.0","@milkdown/crepe": "^7.6.3","@milkdown/kit": "^7.6.3",diff --git a/src/renderer/components/TsButton.tsx b/src/renderer/components/TsButton.tsxindex b7caa2095..39c7be140 100644--- a/src/renderer/components/TsButton.tsx+++ b/src/renderer/components/TsButton.tsx@@ -19,7 +19,6 @@import AppConfig from '-/AppConfig';import TooltipTS from '-/components/Tooltip';import { isDesktopMode } from '-/reducers/settings';-import LoadingButton from '@mui/lab/LoadingButton';import Button, {ButtonProps,ButtonPropsVariantOverrides,@@ -41,48 +40,24 @@ export type TSButtonProps = ButtonProps & {function TsButton(props: TSButtonProps) {const { children, style, tooltip, loading, startIcon, ...rest } = props;const desktopMode = useSelector(isDesktopMode);- let button;- if (loading !== undefined) {- button = (- <LoadingButton- loading={loading}- size={desktopMode ? 'small' : 'medium'}- variant="outlined"- {...(startIcon && { startIcon: startIcon, loadingPosition: 'start' })}- {...rest}- style={{- borderRadius: AppConfig.defaultCSSRadius,- textTransform: 'none', // 'capitalize',- fontSize: 14,- fontWeight: 'normal',- // width: 100,- // textOverflow: 'ellipsis',- // overflow: 'hidden',- ...style,- }}- >- {children}- </LoadingButton>- );- } else {- button = (- <Button- size={desktopMode ? 'small' : 'medium'}- {...(startIcon && { startIcon: startIcon })}- variant="outlined" // text outlined contained- {...rest}- style={{- borderRadius: AppConfig.defaultCSSRadius,- textTransform: 'none', //'capitalize',- fontSize: 14,- fontWeight: 'normal',- ...style,- }}- >- {children}- </Button>- );- }+ const button = (+ <Button+ loading={loading}+ size={desktopMode ? 'small' : 'medium'}+ {...(startIcon && { startIcon: startIcon })}+ variant="outlined" // text outlined contained+ {...rest}+ style={{+ borderRadius: AppConfig.defaultCSSRadius,+ textTransform: 'none', //'capitalize',+ fontSize: 14,+ fontWeight: 'normal',+ ...style,+ }}+ >+ {children}+ </Button>+ );return tooltip ? <TooltipTS title={tooltip}>{button}</TooltipTS> : button;}diff --git a/src/renderer/components/chat/AiGenDescButton.tsx b/src/renderer/components/chat/AiGenDescButton.tsxindex 9a00d836f..2f6c4aaab 100644--- a/src/renderer/components/chat/AiGenDescButton.tsx+++ b/src/renderer/components/chat/AiGenDescButton.tsx@@ -84,12 +84,10 @@ function AiGenDescButton(props: Props) {loading={isLoading}disabled={isLoading || disabled}// tooltip="Uses currently configured AI model to generate description for this file"- // startIcon={<AIIcon />}data-tid="generateDescriptionAITID"style={{borderTopRightRadius: 0,borderBottomRightRadius: 0,- paddingLeft: 28,}}onClick={() => {setIsLoading(true);diff --git a/src/renderer/components/chat/AiGenTagsButton.tsx b/src/renderer/components/chat/AiGenTagsButton.tsxindex 0c0fa60d3..d5bf1d16f 100644--- a/src/renderer/components/chat/AiGenTagsButton.tsx+++ b/src/renderer/components/chat/AiGenTagsButton.tsx@@ -21,6 +21,7 @@ import TsButton, { TSButtonProps } from '-/components/TsButton';import { AIProvider } from '-/components/chat/ChatTypes';import { useAiGenerationDialogContext } from '-/components/dialogs/hooks/useAiGenerationDialogContext';import { useChatContext } from '-/hooks/useChatContext';+import { useNotificationContext } from '-/hooks/useNotificationContext';import { useOpenedEntryContext } from '-/hooks/useOpenedEntryContext';import { getDefaultAIProvider } from '-/reducers/settings';import { TS } from '-/tagspaces.namespace';@@ -31,7 +32,6 @@ import { useState } from 'react';import { useTranslation } from 'react-i18next';import { useSelector } from 'react-redux';import { AIIcon } from '../CommonIcons';-import { useNotificationContext } from '-/hooks/useNotificationContext';type Props = TSButtonProps & {variant?: OverridableStringUnion<@@ -105,14 +105,12 @@ function AiGenTagsButton(props: Props) {loading={isLoading}disabled={isLoading || disabled}// tooltip="Uses currently configured AI model to generate tags for this file"- // startIcon={<AIIcon />}data-tid="generateTagsAITID"onClick={handleGeneration}variant={variant}style={{borderTopRightRadius: 0,borderBottomRightRadius: 0,- paddingLeft: 28,}}>{t(