Implement HomeScreen with Vico dashboard (column chart + legend) #5
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?
Overview
Implements
HomeScreen— the root dashboard. Depends on #2, #3, #4.Prerequisites
Issues #1, #2, #3, #4 must all be merged first. This gives you:
inject()MainApplicationalready wiredWhat to do
1. Create
ui/screens/home/HomeScreenModel.ktUse
rememberScreenModel { HomeScreenModel() }pattern. Constructor params withinject()defaults:State:
expenses: StateFlow<List<ExpenseWithCategory>>— populated fromgetExpenses.subscribeByDateRange(currentRange)(default toDateRange.thisMonth()fromexpensePreference.defaultDateRange())summary: StateFlow<ExpenseSummary?>— driven bydateRange.flatMapLatest { getExpenseSummary.await(it) }(null whenbyCategoryis empty)recurringBanner: StateFlow<List<Expense>?>— populated ininit {}by callingprocessDueRecurring.await()onDispatchers.IO; non-null list shows a dismissable Material 3 bannerselectedDateRange: StateFlow<DateRangeOption>— used to drivegetExpenses.subscribeByDateRangeThe expanded-FAB state is hoisted to
HomeScreen.Content()(not part of the ScreenModel), soHomeScreenModelno longer carriesisFabExpandedor atoggleFab()method.2. Create
ui/screens/home/HomeScreen.ktScreenobject (singleton) — current stub is empty; replace.Icons.Outlined.Settings) →navigator.push(SettingsScreen), Export icon (Icons.Outlined.IosShare) via the sharedExportActioncomposable.summary.byCategory(one bar per category) viaCartesianChartHost(rememberCartesianChart(rememberColumnCartesianLayer(), startAxis, bottomAxis)). Per-category colors are carried by a smallRow { colored swatch; category name; amount }legend below the chart (Vico 2.0.0'scartesianpackage only exposesLine/Column/Candlesticklayers — there is no pie layer — so a column chart with a legend is the substitute, scoped to the existing Vico 2.0.0 dependency). x-axis labels are category names, y-axis labels are amounts, both viaCartesianValueFormatter.summary.totalAmountformatted.SingleSelectFilterChipGroupoverDateRangeOption.THIS_WEEK/THIS_MONTH).navigator.push(CategoryScreen).navigator.push(ExpenseListScreen).expenses).ui/components/ExpandedFab.kt:isFabExpanded.navigator.push(AddEditExpenseScreen(expenseId = null))navigator.push(ImportBankStatementScreen)ExpenseListScreenExpenses tab; both screens consume the same sharedExpandedFab+MiniFabhelpers fromui/components/.3. Recurring processor
In
HomeScreenModel.init {}:4. Theme awareness
The dashboard reads
appPreference.appTheme()to drive the existingAppThemecomposable (already inui/theme/). No new theme work needed in this issue.Acceptance
HomeScreenrenders column chart (with category legend below), total card, "Manage Categories" / "See all" buttons, recent expenses listSettingsScreenExportActionhelper (implemented in #7)initand shows a dismissable banner when new expenses are created$0.00between emissions./gradlew assembleDebugsucceedsImplementation rule
Per
AGENTS.md— do not start implementation without explicit user sign-off on this issue. When working, check for related issues in the remote repo first.Implement HomeScreen with Vico dashboardto Implement HomeScreen with Vico dashboard (column chart + legend)