show filter-box placeholders + make the search icon optional
The Search tab's Find mode stacked four ClideFilterBoxes (search, replace, include, exclude) that all looked identical: every box drew the magnifying glass and the hint was only a semantics label, never visible text — so they read as four blank search boxes. Render the hint as placeholder text while empty, and make the leading icon optional (the replace + glob fields pass icon: null). General win — every filter box now shows its placeholder. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import 'package:clide/clide.dart';
|
||||
import 'package:clide/extension/extension.dart';
|
||||
import 'package:clide/widgets/src/clide_column_hat.dart';
|
||||
import 'package:clide/widgets/src/clide_filter_box.dart';
|
||||
import 'package:clide/widgets/src/clide_icon.dart';
|
||||
import 'package:clide/widgets/src/clide_icon_rail.dart';
|
||||
import 'package:clide/widgets/src/clide_palette.dart';
|
||||
import 'package:clide/widgets/src/clide_resize_border.dart';
|
||||
@@ -291,6 +292,20 @@ void main() {
|
||||
await tester.pump();
|
||||
expect(submitted, 'submit-me');
|
||||
});
|
||||
|
||||
testWidgets('renders the hint as a placeholder (shown empty, hidden once typed); icon optional', (tester) async {
|
||||
await tester.pumpWidget(harness(
|
||||
f,
|
||||
ClideFilterBox(onChanged: (_) {}, hint: 'Replace', icon: null),
|
||||
));
|
||||
// Placeholder visible while empty; no leading search glyph (icon: null).
|
||||
expect(find.text('Replace'), findsOneWidget);
|
||||
expect(find.byType(ClideIcon), findsNothing);
|
||||
// Typing hides the placeholder.
|
||||
await tester.enterText(find.byType(EditableText), 'x');
|
||||
await tester.pump();
|
||||
expect(find.text('Replace'), findsNothing);
|
||||
});
|
||||
});
|
||||
|
||||
group('ColumnHat', () {
|
||||
|
||||
Reference in New Issue
Block a user