-
Notifications
You must be signed in to change notification settings - Fork 106
[MBL-19452][Student] Dashboard Redesign Infrastructure #3372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Implement Jetpack Compose-based dashboard foundation with feature flag routing: - Create DashboardUiState with loading, error, refresh, and empty states - Implement DashboardViewModel with pull-to-refresh and error retry callbacks - Build DashboardScreenContent composable with toolbar and state-based UI - Add DashboardFragment integrating with navigation drawer - Set up feature flag (dashboard_redesign) for conditional routing - Rename old DashboardFragment to OldDashboardFragment - Add comprehensive unit and instrumentation tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dashboard Redesign - Initial Implementation Review
This PR introduces the foundation for a new Compose-based dashboard implementation, along with useful base classes for use cases. The overall architecture follows good patterns with MVVM and Compose, though there are several issues that should be addressed.
Issues Found
- DashboardScreenTest.kt:16 - Missing Hilt test rule setup despite
@HiltAndroidTestannotation - DashboardScreenTest.kt:36 - Hardcoded test tags should be extracted to constants
- DashboardViewModel.kt:52 -
loadDashboard()is placeholder implementation with no actual data loading - DashboardViewModel.kt:33 -
networkStateProviderinjected but never used - DashboardViewModel.kt:67 -
_refreshSignalemitted but no subscribers handle it - DashboardUiState.kt:19 - Callbacks stored in UI state (anti-pattern - should be direct ViewModel methods)
- DashboardViewModelTest.kt:84 - Use
assertFalse()/assertNull()instead ofassertEquals(false/null, ...) - DashboardViewModelTest.kt:108 -
testCallbacksExist()doesn't provide meaningful verification - DashboardModule.kt:23 - Empty Dagger module serves no purpose
- UseCaseResult.kt:46 - Consider
data object Loadingfor consistency
Positive Aspects
✅ Good separation of concerns with Fragment, Screen, ViewModel, and UiState
✅ Proper use of Hilt for dependency injection
✅ Comprehensive test coverage including both unit and UI tests
✅ Feature flag (DASHBOARD_REDESIGN) allows safe rollout
✅ Clean migration strategy preserving old dashboard as OldDashboardFragment
✅ Well-documented base use case classes with clear usage examples
✅ Proper use of StateFlow for reactive UI updates
✅ Pull-to-refresh implementation follows Material Design patterns
Recommendations
-
Complete the implementation: The ViewModel currently doesn't load any actual dashboard data. Before merging, implement the data loading logic or clearly mark this as a WIP.
-
Fix the UI state pattern: Move callbacks out of
DashboardUiStateand expose them as ViewModel methods that the UI calls directly. -
Clean up unused code: Remove unused dependencies (
networkStateProvider,_refreshSignal) or implement their intended functionality. -
Improve test quality: Fix the Hilt setup in tests and make assertions more meaningful.
-
Consider accessibility: Ensure test tags also serve as content descriptions where appropriate.
Security & Performance
No security concerns identified. Performance should be good with Compose, but actual dashboard data loading will need performance consideration when implemented.
apps/student/src/androidTest/java/com/instructure/student/ui/rendertests/DashboardScreenTest.kt
Show resolved
Hide resolved
apps/student/src/androidTest/java/com/instructure/student/ui/rendertests/DashboardScreenTest.kt
Show resolved
Hide resolved
...udent/src/main/java/com/instructure/student/features/dashboard/compose/DashboardViewModel.kt
Show resolved
Hide resolved
...udent/src/main/java/com/instructure/student/features/dashboard/compose/DashboardViewModel.kt
Show resolved
Hide resolved
...udent/src/main/java/com/instructure/student/features/dashboard/compose/DashboardViewModel.kt
Show resolved
Hide resolved
...student/src/main/java/com/instructure/student/features/dashboard/compose/DashboardUiState.kt
Show resolved
Hide resolved
...t/src/test/java/com/instructure/student/features/dashboard/compose/DashboardViewModelTest.kt
Show resolved
Hide resolved
...t/src/test/java/com/instructure/student/features/dashboard/compose/DashboardViewModelTest.kt
Show resolved
Hide resolved
apps/student/src/main/java/com/instructure/student/features/dashboard/di/DashboardModule.kt
Show resolved
Hide resolved
libs/pandautils/src/main/java/com/instructure/pandautils/domain/usecase/UseCaseResult.kt
Show resolved
Hide resolved
📊 Code Coverage Report
|
Test plan:
refs: MBL-19452
affects: Student
release note: Dashboard redesign infrastructure with Jetpack Compose foundation
Checklist