From 5dda99d94338aa9b951eb19c340ad4c6bcd7292e Mon Sep 17 00:00:00 2001 From: Crazelu Date: Wed, 29 Jul 2026 14:47:05 +0100 Subject: [PATCH 1/3] feat: focus next button on the summary screen --- CHANGELOG.md | 4 ++++ lib/src/form/state.dart | 4 ++-- pubspec.yaml | 2 +- test/form/multi_screen_test.dart | 4 +++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1aec332..7a155f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.11.0 + +- **FEAT**: Multi screen forms now auto-focus `Next` button on the summary screen to prioritize form submission. + ## 0.10.0 - **BREAKING**: `ServerpodTerminalBackend`'s `preExit` now requires `exitCode`. diff --git a/lib/src/form/state.dart b/lib/src/form/state.dart index 7fde8e0..acc6e4a 100644 --- a/lib/src/form/state.dart +++ b/lib/src/form/state.dart @@ -396,8 +396,8 @@ class MultiScreenFormState extends FormState { updateFocusedConfigOption(-currentFocus); } } else { - // Focus action buttons on summary screen. - focusDown(); + // Focus action button on summary screen. + focusNextButton(); } } } diff --git a/pubspec.yaml b/pubspec.yaml index f68e46a..5864a5e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: serverpod_tui description: A collection of tools for building terminal user interfaces. -version: 0.10.0 +version: 0.11.0 repository: https://github.com/serverpod/serverpod_tui homepage: https://serverpod.dev issue_tracker: https://github.com/serverpod/serverpod_tui/issues diff --git a/test/form/multi_screen_test.dart b/test/form/multi_screen_test.dart index f96f975..fafe705 100644 --- a/test/form/multi_screen_test.dart +++ b/test/form/multi_screen_test.dart @@ -318,7 +318,7 @@ void main() { test( 'when navigating through all screens, ' - 'then the summary screen is reached', + 'then the summary screen is reached and the Next button is focused', () async { final configCount = state.configScreenCount; @@ -331,6 +331,7 @@ void main() { expect(state.isSummary, isTrue); expect(state.currentScreenIndex, configCount); + expect(state.focusedButtonIndex, 1); }, ); @@ -347,6 +348,7 @@ void main() { // Focus on buttons await _sendKey(tester, LogicalKey.arrowDown); + await _sendKey(tester, LogicalKey.arrowLeft); await _pump(tester); // Space to press back button From 45ca586f6117d53b91a33d9e7831931151e6defa Mon Sep 17 00:00:00 2001 From: Crazelu Date: Wed, 29 Jul 2026 14:48:08 +0100 Subject: [PATCH 2/3] chore: update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a155f2..14cae6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 0.11.0 -- **FEAT**: Multi screen forms now auto-focus `Next` button on the summary screen to prioritize form submission. +- **FEAT**: Multi screen forms now auto-focus `Next` button on the summary screen to prioritise form submission. ## 0.10.0 From 968ab63592a7229dfec26c0628e422f2d84c1e9c Mon Sep 17 00:00:00 2001 From: Crazelu Date: Wed, 29 Jul 2026 16:17:01 +0100 Subject: [PATCH 3/3] chore: update version number --- CHANGELOG.md | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14cae6e..3c913cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.11.0 +## 0.10.1 - **FEAT**: Multi screen forms now auto-focus `Next` button on the summary screen to prioritise form submission. diff --git a/pubspec.yaml b/pubspec.yaml index 5864a5e..cd3662f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: serverpod_tui description: A collection of tools for building terminal user interfaces. -version: 0.11.0 +version: 0.10.1 repository: https://github.com/serverpod/serverpod_tui homepage: https://serverpod.dev issue_tracker: https://github.com/serverpod/serverpod_tui/issues