Skip to content

feat(search-list): optional trailing widget beside the search field [REQ-177] - #209

Open
rgulati-f2k wants to merge 3 commits into
mainfrom
ai_agent/REQ-177
Open

feat(search-list): optional trailing widget beside the search field [REQ-177]#209
rgulati-f2k wants to merge 3 commits into
mainfrom
ai_agent/REQ-177

Conversation

@rgulati-f2k

Copy link
Copy Markdown

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 via IntegratedSearchTextField,
which has no slot beside the field — actionWidget lands in the app bar instead. This PR adds an
optional, null-defaulted trailing slot so a consumer (the fa_flutter_gt PR in this set) can place a
filter button beside the search bar without composing the screen locally.

  • IntegratedSearchTextField gains final Widget? trailing — when non-null, the existing search Card is
    wrapped in a Row with the trailing widget after it.
  • SearchList gains final Widget? searchBarTrailing, threaded into both IntegratedSearchTextField
    call-sites (SearchBarInBody and the SearchWithAppBar sliver header).
  • Null default → every existing consumer's widget tree is byte-identical (verified: the null-trailing
    path returns exactly the prior Padding(child: Card(...)) structure).

Traceability (§5 B)

§5 item File Test
B7 IntegratedSearchTextField.trailing lib/src/modules/common/search_list/integrated_search_textfield.dart integrated_search_textfield_test.dart (2 tests)
B8 SearchList.searchBarTrailing lib/src/modules/common/search_list/search_list.dart covered via B7 widget test (renders through both paths)
B9 widget test: trailing renders when supplied / absent when null test/integrated_search_textfield_test.dart 2/2 passing

Build/verify

  • flutter analyze --no-pub on changed files — 0 errors (1 pre-existing withOpacity deprecation info, untouched line).
  • flutter test --no-pub test/integrated_search_textfield_test.dart2/2 passed.
  • dart format — clean.
  • Note: flutter pub get/analyze/test without --no-pub fails to resolve ./example's own
    sub-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); not
    caused by this change.

Blast radius

Both new fields are additive and null-defaulted. Searched the package for other IntegratedSearchTextField/
SearchList call 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.yaml tracks this package at ref: main, unpinned, so C won't compile the new
filter 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

rgulati-f2k and others added 2 commits September 1, 2026 13:57
…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 Vipin9821 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Null-path test does not prove the tree is unchanged. It looks for Key('search-trailing') that is never in the tree — always findsNothing. A wrapping Row on the null path would still pass.
  2. Positive test does not prove “beside the field”. find.byType(Row) is findsWidgets because suffixIcon is already a Row. Trailing stuffed into the suffix would still pass.
  3. SearchList.searchBarTrailing is untested. PR claims both SearchBarInBody and SearchWithAppBar are covered via B7 — the test never pumps SearchList.

Ran

flutter test test/integrated_search_textfield_test.dart2/2 passed (assertions are too weak to catch a layout regression).

Checklist

  • Assert null path: Padding child is Card, not Row
  • Assert supplied path: trailing is a sibling of Expanded(Card), not inside suffixIcon
  • Pump SearchList with searchBarTrailing for both search types

/cc @rgulati-f2k

Comment thread test/integrated_search_textfield_test.dart Outdated
Comment thread test/integrated_search_textfield_test.dart Outdated
Comment thread lib/src/modules/common/search_list/search_list.dart
Comment thread lib/src/modules/common/search_list/integrated_search_textfield.dart
…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>
@rgulati-f2k

Copy link
Copy Markdown
Author

All 4 review findings addressed in commit 2b40c46:

  • Null-path test rewritten to assert the actual structural invariant (Padding.child isA<Card>()) instead of an unmountable key.
  • Trailing-path test rewritten to assert Padding.child isA<Row>() with Expanded(Card) + the trailing widget, instead of find.byType(Row) (which also matched the suffixIcon's own Row).
  • Added test/search_list_test.dart covering both untested SearchList call sites (SearchBarInBody, SearchWithAppBar).
  • Added an 8px gap between the search field and the trailing widget.

All 4 threads replied + resolved. flutter test (via --no-pub to avoid this repo's pre-existing, unrelated example/ git-dependency resolution failure) — 4/4 pass. flutter analyze clean (one pre-existing, unrelated deprecation note on line 90).

@Vipin9821 could you take another look when you have a moment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants