From 6942b0b0a45e6c8d069d5763c798aa902c47c862 Mon Sep 17 00:00:00 2001 From: Bhavesh Kshatriya Date: Sat, 19 Jul 2025 18:32:33 +0530 Subject: [PATCH 1/2] fix(ui): improve code editor styling to match MUI components --- src/components/input/ToolCodeInput.tsx | 65 ++++++++++++++++++++++---- src/config/uiConfig.ts | 1 + 2 files changed, 57 insertions(+), 9 deletions(-) diff --git a/src/components/input/ToolCodeInput.tsx b/src/components/input/ToolCodeInput.tsx index c23553b..18f5ee8 100644 --- a/src/components/input/ToolCodeInput.tsx +++ b/src/components/input/ToolCodeInput.tsx @@ -5,7 +5,10 @@ import InputHeader from '../InputHeader'; import InputFooter from './InputFooter'; import { useTranslation } from 'react-i18next'; import Editor from '@monaco-editor/react'; -import { globalInputHeight } from '../../config/uiConfig'; +import { + globalInputHeight, + codeInputHeightOffset +} from '../../config/uiConfig'; export default function ToolCodeInput({ value, @@ -53,14 +56,58 @@ export default function ToolCodeInput({ return ( - - onChange(value ?? '')} - /> + + ({ + height: '100%', + display: 'flex', + flexDirection: 'column', + backgroundColor: 'background.paper', + '.monaco-editor': { + height: '100% !important', + outline: 'none !important', + '.overflow-guard': { + height: '100% !important', + border: + theme.palette.mode === 'light' + ? '1px solid rgba(0, 0, 0, 0.23)' + : '1px solid rgba(255, 255, 255, 0.23)', + borderRadius: 1, + transition: theme.transitions.create( + ['border-color', 'background-color'], + { + duration: theme.transitions.duration.shorter + } + ) + }, + '&:hover .overflow-guard': { + borderColor: theme.palette.text.primary + } + }, + '.decorationsOverviewRuler': { + display: 'none !important' + } + })} + > + onChange(value ?? '')} + options={{ + overviewRuler: { + enabled: false + } + }} + /> + Date: Sat, 19 Jul 2025 18:38:38 +0530 Subject: [PATCH 2/2] fix: configure scrollbar settings for Monaco Editor --- src/components/input/ToolCodeInput.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/input/ToolCodeInput.tsx b/src/components/input/ToolCodeInput.tsx index 18f5ee8..bc3ce4a 100644 --- a/src/components/input/ToolCodeInput.tsx +++ b/src/components/input/ToolCodeInput.tsx @@ -102,8 +102,12 @@ export default function ToolCodeInput({ value={value} onChange={(value) => onChange(value ?? '')} options={{ - overviewRuler: { - enabled: false + scrollbar: { + vertical: 'visible', + horizontal: 'visible', + verticalScrollbarSize: 10, + horizontalScrollbarSize: 10, + alwaysConsumeMouseWheel: false } }} />