From a7485cadb5a0a555bcdbbd87663dfc00d2f71e8c Mon Sep 17 00:00:00 2001 From: flemming-it Date: Sun, 31 May 2026 23:29:00 +0200 Subject: [PATCH] fix(editor): always top-align content, even for short files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Row was using CrossAxisAlignment.center by default, so a short YAML file appeared visually centered in the editor viewport — uncomfortable in any IDE-style surface where content is expected to start at the top edge regardless of how much of the viewport it fills. Set CrossAxisAlignment.stretch on the outer Row so the SingleChildScrollView fills the full vertical extent. The SCV's default scroll origin is the top, so once the viewport is taller than the content the file renders at the top with empty space below. Version 0.1.2 -> 0.1.3. Signed-off-by: flemming-it --- lib/src/flow_editor_page.dart | 8 ++++++++ pubspec.yaml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/src/flow_editor_page.dart b/lib/src/flow_editor_page.dart index ca9e865..d89645a 100644 --- a/lib/src/flow_editor_page.dart +++ b/lib/src/flow_editor_page.dart @@ -609,6 +609,14 @@ class _EditorPane extends StatelessWidget { color: theme.colorScheme.onSurface, ); return Row( + // Stretch so the editor's scroll viewport fills the row's + // full vertical extent. Without this the Row defaults to + // CrossAxisAlignment.center, which centers a short file + // vertically — uncomfortable in an IDE where readers + // expect content to always start at the top. Default + // SingleChildScrollView origin is top, so stretching the + // viewport is enough to anchor content at the top edge. + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Expanded( flex: 3, diff --git a/pubspec.yaml b/pubspec.yaml index 7fd16db..3532f53 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: fai_studio_flow_editor description: Swappable inline YAML editor for F∆I Studio flows. -version: 0.1.2 +version: 0.1.3 publish_to: 'none' repository: https://git.flemming.ai/fai/studio-flow-editor