From f35069acce5c8252d8710321c7ef41574fb358e6 Mon Sep 17 00:00:00 2001 From: James Brunton Date: Thu, 18 Dec 2025 16:02:40 +0000 Subject: [PATCH] Fixes from self-review --- .../shared/config/LoginRequiredBanner.tsx | 2 +- .../config/configSections/GeneralSection.tsx | 2 +- .../shared/rightRail/RightRail.README.md | 6 ++-- .../core/components/toast/ToastRenderer.tsx | 4 +-- .../addAttachments/AddAttachmentsSettings.tsx | 2 +- .../tools/sign/SavedSignaturesSection.tsx | 28 +++++++++---------- .../components/tools/sign/SignSettings.tsx | 4 +-- .../core/data/useTranslatedToolRegistry.tsx | 2 +- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/frontend/src/core/components/shared/config/LoginRequiredBanner.tsx b/frontend/src/core/components/shared/config/LoginRequiredBanner.tsx index de611b64b..f16e38f4e 100644 --- a/frontend/src/core/components/shared/config/LoginRequiredBanner.tsx +++ b/frontend/src/core/components/shared/config/LoginRequiredBanner.tsx @@ -17,7 +17,7 @@ export default function LoginRequiredBanner({ show }: LoginRequiredBannerProps) return ( } + icon={} title={t('admin.settings.loginDisabled.title', 'Login Mode Required')} color="blue" variant="light" diff --git a/frontend/src/core/components/shared/config/configSections/GeneralSection.tsx b/frontend/src/core/components/shared/config/configSections/GeneralSection.tsx index e8f37a286..ef01f9b35 100644 --- a/frontend/src/core/components/shared/config/configSections/GeneralSection.tsx +++ b/frontend/src/core/components/shared/config/configSections/GeneralSection.tsx @@ -193,7 +193,7 @@ const GeneralSection: React.FC = ({ hideTitle = false }) => size="sm" color={updateSummary.max_priority === 'urgent' ? 'red' : 'blue'} onClick={() => setUpdateModalOpened(true)} - leftSection={} + leftSection={} > {t('settings.general.updates.viewDetails', 'View Details')} diff --git a/frontend/src/core/components/shared/rightRail/RightRail.README.md b/frontend/src/core/components/shared/rightRail/RightRail.README.md index a6aab574a..6ee453014 100644 --- a/frontend/src/core/components/shared/rightRail/RightRail.README.md +++ b/frontend/src/core/components/shared/rightRail/RightRail.README.md @@ -14,7 +14,7 @@ A dynamic vertical toolbar on the right side of the application that supports bo ```tsx import { useRightRailButtons } from '../hooks/useRightRailButtons'; -import PlayArrowIcon from '@mui/icons-material/PlayArrow'; +import LocalIcon from '@app/components/shared/LocalIcon'; function MyTool() { const handleAction = useCallback(() => { @@ -24,7 +24,7 @@ function MyTool() { useRightRailButtons([ { id: 'my-action', - icon: , + icon: , tooltip: 'Execute Action', onClick: handleAction, }, @@ -137,7 +137,7 @@ useRightRailButtons([ ## Best Practices - Use descriptive IDs: `'compress-optimize'`, `'ocr-process'` -- Choose appropriate Material-UI icons +- Choose appropriate Material Symbols icons via LocalIcon - Keep tooltips concise: `'Compress PDF'`, `'Process with OCR'` - Use `useCallback` for click handlers to prevent re-registration - Reach for `render` when you need popovers or multi-control groups inside the rail diff --git a/frontend/src/core/components/toast/ToastRenderer.tsx b/frontend/src/core/components/toast/ToastRenderer.tsx index 09891099f..9fdd74dd8 100644 --- a/frontend/src/core/components/toast/ToastRenderer.tsx +++ b/frontend/src/core/components/toast/ToastRenderer.tsx @@ -86,7 +86,7 @@ export default function ToastRenderer() { }} className={`toast-button toast-expand-button ${t.isExpanded ? 'toast-expand-button--expanded' : ''}`} > - + )} diff --git a/frontend/src/core/components/tools/addAttachments/AddAttachmentsSettings.tsx b/frontend/src/core/components/tools/addAttachments/AddAttachmentsSettings.tsx index 33d9e8b33..01df6c3a0 100644 --- a/frontend/src/core/components/tools/addAttachments/AddAttachmentsSettings.tsx +++ b/frontend/src/core/components/tools/addAttachments/AddAttachmentsSettings.tsx @@ -42,7 +42,7 @@ const AddAttachmentsSettings = ({ parameters, onParameterChange, disabled = fals component="label" htmlFor="attachments-input" disabled={disabled} - leftSection={} + leftSection={} > {parameters.attachments?.length > 0 ? t("AddAttachmentsRequest.addMoreFiles", "Add more files...") diff --git a/frontend/src/core/components/tools/sign/SavedSignaturesSection.tsx b/frontend/src/core/components/tools/sign/SavedSignaturesSection.tsx index 95a8a7e77..13b828498 100644 --- a/frontend/src/core/components/tools/sign/SavedSignaturesSection.tsx +++ b/frontend/src/core/components/tools/sign/SavedSignaturesSection.tsx @@ -234,7 +234,7 @@ export const SavedSignaturesSection = ({ {groupedSignatures.personal.length > 0 && activePersonalSignature && ( - + {translate('saved.personalHeading', 'Personal Signatures')} @@ -257,7 +257,7 @@ export const SavedSignaturesSection = ({ onClick={() => setActivePersonalIndex(prev => Math.max(0, prev - 1))} disabled={disabled || activePersonalIndex === 0} > - + setActivePersonalIndex(prev => Math.min(groupedSignatures.personal.length - 1, prev + 1))} disabled={disabled || activePersonalIndex >= groupedSignatures.personal.length - 1} > - + @@ -284,7 +284,7 @@ export const SavedSignaturesSection = ({ onClick={() => onUseSignature(activePersonalSignature)} disabled={disabled} > - + onDeleteSignature(activePersonalSignature)} disabled={disabled} > - + @@ -317,7 +317,7 @@ export const SavedSignaturesSection = ({ {groupedSignatures.shared.length > 0 && activeSharedSignature && ( - + {translate('saved.sharedHeading', 'Shared Signatures')} @@ -340,7 +340,7 @@ export const SavedSignaturesSection = ({ onClick={() => setActiveSharedIndex(prev => Math.max(0, prev - 1))} disabled={disabled || activeSharedIndex === 0} > - + setActiveSharedIndex(prev => Math.min(groupedSignatures.shared.length - 1, prev + 1))} disabled={disabled || activeSharedIndex >= groupedSignatures.shared.length - 1} > - + @@ -367,7 +367,7 @@ export const SavedSignaturesSection = ({ onClick={() => onUseSignature(activeSharedSignature)} disabled={disabled} > - + {isAdmin && ( @@ -378,7 +378,7 @@ export const SavedSignaturesSection = ({ onClick={() => onDeleteSignature(activeSharedSignature)} disabled={disabled} > - + )} @@ -424,7 +424,7 @@ export const SavedSignaturesSection = ({ onClick={() => setActiveLocalStorageIndex(prev => Math.max(0, prev - 1))} disabled={disabled || activeLocalStorageIndex === 0} > - + setActiveLocalStorageIndex(prev => Math.min(groupedSignatures.localStorage.length - 1, prev + 1))} disabled={disabled || activeLocalStorageIndex >= groupedSignatures.localStorage.length - 1} > - + @@ -451,7 +451,7 @@ export const SavedSignaturesSection = ({ onClick={() => onUseSignature(activeLocalStorageSignature)} disabled={disabled} > - + onDeleteSignature(activeLocalStorageSignature)} disabled={disabled} > - + diff --git a/frontend/src/core/components/tools/sign/SignSettings.tsx b/frontend/src/core/components/tools/sign/SignSettings.tsx index 12de2cadd..ec429775d 100644 --- a/frontend/src/core/components/tools/sign/SignSettings.tsx +++ b/frontend/src/core/components/tools/sign/SignSettings.tsx @@ -964,7 +964,7 @@ const SignSettings = ({ gap: '0.4rem', }} > - + {translate('mode.pause', 'Pause placement')} @@ -987,7 +987,7 @@ const SignSettings = ({ gap: '0.4rem', }} > - + {translate('mode.resume', 'Resume placement')} diff --git a/frontend/src/core/data/useTranslatedToolRegistry.tsx b/frontend/src/core/data/useTranslatedToolRegistry.tsx index 3208e4ef7..0afbb500b 100644 --- a/frontend/src/core/data/useTranslatedToolRegistry.tsx +++ b/frontend/src/core/data/useTranslatedToolRegistry.tsx @@ -223,7 +223,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog { supportsAutomate: false, //TODO make support Sign }, addText: { - icon: , + icon: , name: t('home.addText.title', 'Add Text'), component: AddText, description: t('home.addText.desc', 'Add custom text anywhere in your PDF'),