From 865b69f9603fd7d19f54edc4ec00dc4e0bbcd936 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Wed, 31 Dec 2025 15:03:48 +0100 Subject: [PATCH] fix: enable scrolling in CodeEditor widget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wrap CodeField in SingleChildScrollView with minLines: 1 to prevent overflow when YAML content exceeds available height. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../components/code_editor/code_editor.dart | 51 ++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/lib/shared/components/code_editor/code_editor.dart b/lib/shared/components/code_editor/code_editor.dart index 84968bb..63a21c4 100644 --- a/lib/shared/components/code_editor/code_editor.dart +++ b/lib/shared/components/code_editor/code_editor.dart @@ -97,31 +97,34 @@ class CodeEditorState extends State { return CodeTheme( data: isDark ? _darkTheme(colorScheme) : _lightTheme(colorScheme), - child: CodeField( - controller: _controller, - readOnly: widget.readOnly, - gutterStyle: widget.showLineNumbers - ? GutterStyle( - showLineNumbers: true, - showErrors: false, - showFoldingHandles: false, - margin: 0, - textStyle: TextStyle( - fontFamily: 'monospace', - fontSize: 12, - color: colorScheme.outline, - ), - background: colorScheme.surfaceContainerLow, - ) - : GutterStyle.none, - textStyle: TextStyle( - fontFamily: 'monospace', - fontSize: 13, - height: 1.5, - color: colorScheme.onSurface, + child: SingleChildScrollView( + child: CodeField( + controller: _controller, + readOnly: widget.readOnly, + minLines: 1, + gutterStyle: widget.showLineNumbers + ? GutterStyle( + showLineNumbers: true, + showErrors: false, + showFoldingHandles: false, + margin: 0, + textStyle: TextStyle( + fontFamily: 'monospace', + fontSize: 12, + color: colorScheme.outline, + ), + background: colorScheme.surfaceContainerLow, + ) + : GutterStyle.none, + textStyle: TextStyle( + fontFamily: 'monospace', + fontSize: 13, + height: 1.5, + color: colorScheme.onSurface, + ), + padding: const EdgeInsets.all(16), + background: colorScheme.surfaceContainerLowest, ), - padding: const EdgeInsets.all(16), - background: colorScheme.surfaceContainerLowest, ), ); }