feat(ui): a question mark that keeps a section's explanation one tap away
HelpButton, beside a section's or a setting's title: the explanation opens in a small dialog, under its title where given, rather than standing in the everyday view (the developer's review of 3 Nov 2026). FieldInfoButton's tooltip stays for a field's short hint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
abac248b76
commit
55fc245859
1 changed files with 85 additions and 3 deletions
29
packages/halkyon_ui/test/widget/help_button_test.dart
Normal file
29
packages/halkyon_ui/test/widget/help_button_test.dart
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:halkyon_ui/halkyon_ui.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
|
||||
import '../support/test_app.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('the explanation stays hidden until the question mark is '
|
||||
'tapped, then shows under its title and closes again', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
testApp(
|
||||
const Scaffold(
|
||||
body: HelpButton('How sources are cited.', title: 'Citation style'),
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(find.text('How sources are cited.'), findsNothing);
|
||||
expect(find.byTooltip("What's this?"), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byType(HelpButton));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Citation style'), findsOneWidget);
|
||||
expect(find.text('How sources are cited.'), findsOneWidget);
|
||||
|
||||
await tester.tap(find.text('OK'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('How sources are cited.'), findsNothing);
|
||||
});
|
||||
}
|
||||
Loading…
Reference in a new issue