Skip to content

Conversation

@sarafarajnasardi
Copy link

Implements the 'Filter direct messages' search box feature on the Direct Messages tab, matching the Figma design.

The search filtering is:

  • Real-time (updates as the user types)
  • Case-insensitive
  • Filters by recipient names (User display names)
  • Works for 1:1, Group, and Self DMs

The implementation includes:

  • '_FilterDmsSearchBox' widget in 'RecentDmConversationsPageBody'
  • 'TextEditingController' state and filter logic
  • 'CustomScrollView' adoption to support scrolling search box and list
  • New localization string 'recentDmConversationsFilterPlaceholder'
  • Comprehensive tests covering all filter scenarios and empty states

All existing tests continue to pass (34/34 passing).

WhatsApp.Video.2026-01-23.at.4.19.07.PM.mp4

Fixes: #1903

Implements issue zulip#2078, a follow-up to zulip#1406.

The Figma design for the Subscribed Channels page includes a 'Filter
channels' search box at the top. This feature allows users to quickly
find channels by typing a search query.

The search filtering is:
- Real-time (updates as the user types)
- Case-insensitive
- Partial match (searches within channel names)
- Works for both pinned and unpinned channels

The implementation includes:
- TextField widget with search icon at the top of the channels list
- TextEditingController and state management for search query
- Filtering logic in _filterSubscription helper method
- Styling that matches the Figma design specifications
- New localization string 'channelsPageFilterPlaceholder'
- Proper handling of empty search results (doesn't show the 'not
  subscribed' placeholder when filter returns no matches)
- 8 new comprehensive test cases covering various filter scenarios

All existing tests continue to pass (28/28 tests passing).

Fixes: zulip#2078
@sarafarajnasardi
Copy link
Author

@gnprice Should I include this DM filtering feature in the previous PR (#2092) instead, since it uses an identical search box UI and logic?

Sarafaraj Nasardi added 2 commits January 25, 2026 12:22
Extends the channel filtering feature to the 'All Channels' page and
refactors the search component for reusability.

Changes:
* Create reusable 'SearchBox' widget in 'lib/widgets/search.dart'
* Refactor 'subscription_list.dart' to use the shared 'SearchBox'
* Implement filtered search in 'all_channels.dart':
    * Add 'TextEditingController' for search state
    * Filter the list of streams based on search query
    * Updates real-time, case-insensitive
* Add 14 new tests in 'all_channels_test.dart'
* Verify existing 'subscription_list_test.dart' passes (no regressions)

The search behavior matches the Subscribed Channels page: real-time,
case-insensitive filtering by channel name.

Test Plan:
* 'flutter test test/widgets/all_channels_test.dart' (New tests)
* 'flutter test test/widgets/subscription_list_test.dart' (Regression)
* All 42 tests passed.

Fixes: zulip#2078
* Remove duplicate import in 'all_channels.dart'
* Remove invalid '@OverRide' on factory constructors in 'submessage.dart'

Verified with 'tools/check analyze'.
@gnprice
Copy link
Member

gnprice commented Jan 27, 2026

If the UI and logic are identical, then it'd be good to use the same code instead of having two copies of the code.

The usual way to do that would be to have this PR stacked on top of the other PR. That is, this PR branch would include all the commits of #2092, and then additional commits on top of that.

@sarafarajnasardi
Copy link
Author

Thanks! I'll rebase this PR on top of #2092 to stack them, so we can share the search box code without duplication.

Implements the 'Filter direct messages' search box feature on the
Direct Messages tab, matching the Figma design.

The search filtering is:
* Real-time (updates as the user types)
* Case-insensitive
* Filters by recipient names (User display names)
* Works for 1:1, Group, and Self DMs

The implementation includes:
* Reuse of shared 'SearchBox' widget from previous commits
* 'TextEditingController' state and filter logic in 'RecentDmConversationsPageBody'
* 'CustomScrollView' adoption to support scrolling search box and list
* New localization string 'recentDmConversationsFilterPlaceholder'
* Comprehensive tests covering all filter scenarios and empty states

All existing tests continue to pass (33/33 passing).

Fixes: zulip#1903
@sarafarajnasardi
Copy link
Author

Hi @gnprice,
I've rebased this PR on top of #2092 to share the SearchBox widget code as you suggested.

The branch now includes all commits from #2092 (channel search)+ the DM search commit on top. Once #2092 is merged, this PR will automatically show only the DM-specific changes.

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.

Search box in recent-DMs page

2 participants