feat(settings): split Settings tab from Profile screen - #341
Conversation
Two view models compute the avatar fallback the same way GroupParticipant already does; one definition instead of three.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughThe PR separates profile account content from settings content. It adds a Settings screen and state model, moves Settings into top-level navigation, updates guest-account flows and localized resources, and adds view-model tests. ChangesProfile and Settings split
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant SettingsRoot
participant SettingsViewModel
participant AuthService
participant AppPreferencesRepository
User->>SettingsRoot: Open Settings
SettingsRoot->>SettingsViewModel: Collect state and refresh
SettingsViewModel->>AuthService: Refresh account
SettingsViewModel->>AppPreferencesRepository: Read settings
SettingsViewModel-->>SettingsRoot: Emit SettingsState
User->>SettingsRoot: Select theme or notifications
SettingsRoot->>SettingsViewModel: Persist selection
SettingsViewModel->>AppPreferencesRepository: Save preference
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@features/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/MainNavKeys.kt`:
- Around line 93-101: Make the Settings navigation key implement LoggedIn in
addition to its existing LoggableNavKey and TopLevelTab interfaces, so App.kt
selects the logged-in shell and resolves the Settings route for tab navigation
and post-upgrade continuation.
In
`@features/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/profile/ProfileScreen.kt`:
- Around line 128-192: The profile content in
features/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/profile/ProfileScreen.kt:128-192
and settings content in
features/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/settings/SettingsScreen.kt:126-176
must be gated on state.isLoading; render the existing loading state while
loading, and only render ProfileIdentity, account rows/actions, the profile
card, and settings content after loading completes.
In
`@features/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/settings/SettingsScreen.kt`:
- Line 36: Remove the direct AppBuildInfo dependency from SettingsScreen. Pass
the app version through the screen’s presentation state or an existing
domain-level contract, and update the rendering logic around SettingsScreen to
consume that presentation-safe value instead of the data-layer type.
In
`@features/tabgroup/presentation/src/commonTest/kotlin/de/tabmates/features/tabgroup/presentation/navigation/settings/SettingsViewModelTest.kt`:
- Around line 158-162: Update the SettingsViewModelTest helper subscribeToState
to use Turbine’s test collection instead of launching a manual background
collector; make the subscription lifetime explicit and assert the expected
StateFlow emissions with Turbine while preserving the test’s WhileSubscribed
behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 9220a2c7-14d7-42fd-86df-430ec01de25e
📒 Files selected for processing (20)
composeApp/src/commonMain/kotlin/de/tabmates/composeapp/App.ktcore/domain/src/commonMain/kotlin/de/tabmates/core/domain/auth/User.ktfeatures/authentication/presentation/src/commonMain/composeResources/values-de/string.xmlfeatures/authentication/presentation/src/commonMain/composeResources/values/string.xmlfeatures/tabgroup/presentation/src/commonMain/composeResources/values-de/string.xmlfeatures/tabgroup/presentation/src/commonMain/composeResources/values/string.xmlfeatures/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/MainGraph.ktfeatures/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/MainNavKeys.ktfeatures/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/profile/PendingMigrationBanner.ktfeatures/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/profile/ProfileEvent.ktfeatures/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/profile/ProfileScreen.ktfeatures/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/profile/ProfileState.ktfeatures/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/profile/ProfileViewModel.ktfeatures/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/settings/OssLicensesScreen.ktfeatures/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/settings/SettingsRow.ktfeatures/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/settings/SettingsScreen.ktfeatures/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/settings/SettingsState.ktfeatures/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/settings/SettingsViewModel.ktfeatures/tabgroup/presentation/src/commonTest/kotlin/de/tabmates/features/tabgroup/presentation/navigation/profile/ProfileViewModelTest.ktfeatures/tabgroup/presentation/src/commonTest/kotlin/de/tabmates/features/tabgroup/presentation/navigation/settings/SettingsViewModelTest.kt
💤 Files with no reviewable changes (2)
- features/tabgroup/presentation/src/commonMain/kotlin/de/tabmates/features/tabgroup/presentation/navigation/profile/ProfileEvent.kt
- features/tabgroup/presentation/src/commonTest/kotlin/de/tabmates/features/tabgroup/presentation/navigation/profile/ProfileViewModelTest.kt
The bottom tab called Profile was a settings screen. It is now Settings — profile card, preferences, about — and the account it used to carry moves behind the card into its own Profile screen with sign out and delete. The card doubles as the guest prompt: tinted, with the upgrade inline, so the one thing a guest should do is not a tap deeper. Also drops the tablet two-pane; three sections did not earn a master list. The NavKey rename changes the serialized discriminator, so a back stack persisted by an older build no longer restores.
The upgrade no longer lives under Profile.
e5b816b to
2293afc
Compare
Summary by CodeRabbit
New Features
Bug Fixes