Compare commits

..
Author SHA1 Message Date
Thomas SharedInboxandClaude Sonnet 4.6 b489ec6694 fix: disable Try connection button when no password is available (#235)
When no password is stored and no password has been typed, the Try
connection button is now disabled, preventing the crash path entirely
rather than relying solely on after-the-fact form validation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 14:12:31 +02:00
3 changed files with 3 additions and 32 deletions
+2 -2
View File
@@ -136,7 +136,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 100
fetch-depth: 1
- name: Check runner tools
run: |
@@ -178,7 +178,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 100
fetch-depth: 1
- name: Check runner tools
run: |
+1 -6
View File
@@ -360,12 +360,7 @@ class _EditAccountScreenState extends ConsumerState<EditAccountScreen> {
: null,
),
const SizedBox(height: 8),
FilledButton(
onPressed: _hasStoredPassword || _passwordCtrl.text.isNotEmpty
? _save
: null,
child: const Text('Save'),
),
FilledButton(onPressed: _save, child: const Text('Save')),
],
),
),
-24
View File
@@ -163,30 +163,6 @@ void main() {
expect(button.onPressed, isNotNull);
});
testWidgets('save button is disabled when no password stored or entered', (
tester,
) async {
tester.view.physicalSize = const Size(800, 1400);
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.resetPhysicalSize);
addTearDown(tester.view.resetDevicePixelRatio);
await tester.pumpWidget(
buildApp(
initialLocation: '/accounts/acc-1/edit',
overrides: baseOverrides(
accounts: [kTestAccount],
hasStoredPassword: false,
),
),
);
await tester.pumpAndSettle();
final button = tester
.widget<FilledButton>(find.widgetWithText(FilledButton, 'Save'));
expect(button.onPressed, isNull);
});
testWidgets('connection error shows error message', (tester) async {
tester.view.physicalSize = const Size(800, 1400);
tester.view.devicePixelRatio = 1.0;