feat(android): add search to task list screen#312
Merged
Conversation
- Search icon in top bar expands to a full-width text field; X icon collapses it and clears the query - Substring match (case-insensitive) on task title; empty groups are hidden automatically - Search state stored in TaskListViewModel (survives back-navigation within the session, resets on cold start) - Cursor-jump bug prevented by keeping TextFieldValue (cursor included) as local remember state; only .text is pushed to the ViewModel. LaunchedEffect re-syncs on navigation restoration only when textFieldValue.text != searchQuery - Empty state shows context-aware message when search yields no results Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an in-memory (non-persisted) search experience to the Android task list screen, with ViewModel-backed query/state for navigation restoration and reactive filtering of grouped tasks.
Changes:
- Introduces
searchQuery/isSearchActiveStateFlows inTaskListViewModeland applies case-insensitive substring filtering before grouping. - Adds an animated top app bar swap on
TaskListScreento show a focused search field and a search-aware empty/no-results state. - Wires search state + handlers through
AppNavigationand adds the required string resources.
Show a summary per file
| File | Description |
|---|---|
| android/app/src/main/res/values/strings.xml | Adds search hint, no-results messaging, and icon content descriptions. |
| android/app/src/main/java/com/dkhalife/tasks/viewmodel/TaskListViewModel.kt | Adds search StateFlows + setters and filters tasks in the grouping combine pipeline. |
| android/app/src/main/java/com/dkhalife/tasks/ui/screen/TaskListScreen.kt | Implements animated search UI in the top app bar, focus management, and search-aware empty state. |
| android/app/src/main/java/com/dkhalife/tasks/ui/navigation/AppNavigation.kt | Collects and passes search state/handlers between ViewModel and TaskListScreen. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 1
…ssibility Switch the search input from BasicTextField with a manual hint overlay to TextField with a placeholder parameter. TextField exposes proper accessibility semantics (label/hint) to TalkBack automatically, whereas BasicTextField does not announce what the field is for to screen readers. Use transparent container + indicator colors to preserve the existing visual appearance inside the TopAppBar. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ensure the search TextField remains fully transparent if ever rendered in disabled state by adding disabledContainerColor = Color.Transparent alongside the other container/indicator color overrides. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds search functionality to the Android task list screen.
Behavior
Cursor-jump bug prevention
Previous patterns drove
TextFieldfrom a ViewModelString, which recreatedTextFieldValuewithout cursor info on every keystroke. This implementation keepsTextFieldValue(including cursor/selection) as localremember(isSearchActive)state. Only.textis pushed to the ViewModel. ALaunchedEffect(searchQuery)re-syncs the local value only whentextFieldValue.text != searchQuery(navigation restoration), never during normal typing.Files changed
TaskListViewModel.kt_searchQuery/_isSearchActiveStateFlows + setters; inject intocombinefor reactive filteringTaskListScreen.ktBasicTextField, focus management, search-aware empty stateAppNavigation.ktTaskListScreenstrings.xml