Expenses screen: replace inline search with SearchToolbar
#26
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Enhancement / bug
The Expenses screen implements search via an
OutlinedTextFieldplaced as the first item inside theLazyColumn(app/src/main/java/dev/achmad/ledgerr/ui/screens/expenses/ExpenseListScreen.kt:259-272). This is wrong on two counts:SearchToolbarcomposable defined inapp/src/main/java/dev/achmad/ledgerr/ui/components/AppBar.kt:306.Expected behavior
Replace the inline search field with the
SearchToolbarcomposable:SearchToolbarinto thetopBarslot of theScaffoldinExpenseListScreen(replacing the currentAppBarfor the Expenses/Recurring tab content).searchQuery = screenModel.searchQuery.collectAsState().valueandonChangeSearchQuery = screenModel::setSearchQuery.ExportAction) via theactions = { … }parameter ofSearchToolbar.OutlinedTextFieldfromExpensesTabContentand remove the now-unusedOutlinedTextFieldimport. (Icons.Outlined.Searchis not removed — it is still used bySearchToolbar.)SEARCH_DEBOUNCE_MILLISconstant inAppBar.kt:65(wire via the screen model so a fast typist doesn't re-query on every keystroke — confirm whether the currentsetSearchQueryalready debounces; if not, add it).Search semantics
The search query must filter both tabs:
expensesbysearchQuerymatching (case-insensitive, substring) against the category name and the expense note. (The current inline search already does this — keep that behavior.)recurringbysearchQuerymatching (case-insensitive, substring) against the category name and the recurring note. (Add the filter toRecurringTabContent/ the screen model — note that recurring may not currently have anotecolumn; if not, filter on category name only.)DateRangeFilter) continues to apply only to the Expenses tab; it does not affectRecurring.SearchToolbar); switching tabs preserves the active query and the filtered list on the other tab.Acceptance criteria