feat(search-list): optional trailing widget beside the search field [REQ-177] - #209
feat(search-list): optional trailing widget beside the search field [REQ-177]#209rgulati-f2k wants to merge 3 commits into
Conversation
…REQ-177] IntegratedSearchTextField gains an optional, null-defaulted 'trailing' widget rendered after the search Card (e.g. a filter button). SearchList exposes it as 'searchBarTrailing' and threads it into both the SearchBarInBody and SearchWithAppBar call-sites. Null default means every existing consumer's widget tree is byte-identical. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Vipin9821
left a comment
There was a problem hiding this comment.
Changes requested — PR #209
Optional trailing / searchBarTrailing is additive and null-defaulted. Grep: the only other IntegratedSearchTextField call site (integrated_search_bar.dart) does not pass trailing → existing AppBar search is unchanged.
Production wiring to both SearchList body paths looks correct.
Blocking
- Null-path test does not prove the tree is unchanged. It looks for
Key('search-trailing')that is never in the tree — alwaysfindsNothing. A wrappingRowon the null path would still pass. - Positive test does not prove “beside the field”.
find.byType(Row)isfindsWidgetsbecausesuffixIconis already aRow. Trailing stuffed into the suffix would still pass. SearchList.searchBarTrailingis untested. PR claims bothSearchBarInBodyandSearchWithAppBarare covered via B7 — the test never pumpsSearchList.
Ran
flutter test test/integrated_search_textfield_test.dart → 2/2 passed (assertions are too weak to catch a layout regression).
Checklist
- Assert null path:
Paddingchild isCard, notRow - Assert supplied path: trailing is a sibling of
Expanded(Card), not insidesuffixIcon - Pump
SearchListwithsearchBarTrailingfor both search types
/cc @rgulati-f2k
…e + gap [REQ-177] The null-path test only asserted a Key that is never mounted regardless of implementation (always findsNothing), and the trailing-path test's find.byType(Row) also matches the suffixIcon Row inside the TextField's own decoration, so neither could actually fail. Rewrote both to assert the real structural invariant (Padding.child is the Card directly, or a Row of [Expanded(Card), trailing]). Added search_list_test.dart covering the two untested SearchList call sites (SearchBarInBody, SearchWithAppBar) that wire searchBarTrailing through. Also added an 8px gap between the search field and trailing widget so it doesn't sit flush against the Card edge. Addresses Vipin's CHANGES_REQUESTED review on PR #209. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
All 4 review findings addressed in commit 2b40c46:
All 4 threads replied + resolved. @Vipin9821 could you take another look when you have a moment? |
REQ-177 — Enhanced Beat & Route Selection for Hierarchical Retailing (2 of 3 PRs — shared UI kit, TECH-1)
What was built
SearchList(fa_flutter_ui_kit) renders its search field internally viaIntegratedSearchTextField,which has no slot beside the field —
actionWidgetlands in the app bar instead. This PR adds anoptional, null-defaulted trailing slot so a consumer (the
fa_flutter_gtPR in this set) can place afilter button beside the search bar without composing the screen locally.
IntegratedSearchTextFieldgainsfinal Widget? trailing— when non-null, the existing searchCardiswrapped in a
Rowwith the trailing widget after it.SearchListgainsfinal Widget? searchBarTrailing, threaded into bothIntegratedSearchTextFieldcall-sites (
SearchBarInBodyand theSearchWithAppBarsliver header).path returns exactly the prior
Padding(child: Card(...))structure).Traceability (§5 B)
IntegratedSearchTextField.trailinglib/src/modules/common/search_list/integrated_search_textfield.dartintegrated_search_textfield_test.dart(2 tests)SearchList.searchBarTrailinglib/src/modules/common/search_list/search_list.darttest/integrated_search_textfield_test.dartBuild/verify
flutter analyze --no-pubon changed files — 0 errors (1 pre-existingwithOpacitydeprecation info, untouched line).flutter test --no-pub test/integrated_search_textfield_test.dart— 2/2 passed.dart format— clean.flutter pub get/analyze/testwithout--no-pubfails to resolve./example's ownsub-workspace (
Could not find a file named "pubspec.yaml" in …fa_flutter_core.git@5208b4b…) —pre-existing, reproduced identically on unmodified
main(stashed this PR's diff and re-ran); notcaused by this change.
Blast radius
Both new fields are additive and null-defaulted. Searched the package for other
IntegratedSearchTextField/SearchListcall sites — the null-default keeps their rendered output identical.Sequencing
Part of a 3-PR deploy-ordered set:
FA_GT_APPAPI(A, independent, ADO PR) · this PR (B) ·fa_flutter_gt(C, depends on B —
pubspec.yamltracks this package atref: main, unpinned, so C won't compile the newfilter drawer until B merges).
Please Squash or Rebase-and-merge (no merge commit) so this task stays a single revertable unit.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com