-
Notifications
You must be signed in to change notification settings - Fork 0
Manage Invitations TRACK-20 #22
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
Merged
Merged
Conversation
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
This commit introduces a new "Notifications" screen that allows users to view and respond to Hub invitations. It replaces the previous "Activity" tab in the bottom navigation.
### Key Changes:
* **New Modules:**
* `notifications:core-notifications`: Contains core domain models, data transfer objects (DTOs), and mappers for notifications.
* `notifications:feat-notifications`: Implements the UI, ViewModel, and data layers for the notifications feature.
* **Notifications Screen:**
* A new screen (`NotificationsScreen.kt`) displays a list of pending hub invitations.
* Each invitation is shown in a `Card` with details like hub name, description, inviter's name, and assigned role.
* Users can `Accept` or `Reject` invitations. Rejecting an invitation shows a confirmation dialog.
* An empty state is displayed when there are no pending invitations.
* Success and error dialogs are used to provide feedback on actions.
* **Data and Domain Layer:**
* `SupabaseHubInvitations` is the new data source for fetching and responding to invitations via Supabase RPC calls (`get_user_invitations`, `respond_to_invitation`).
* `NotificationsRepository` and `NotificationsRepositoryImpl` manage data retrieval and map network responses to domain models.
* `InvitationAcceptanceResponseParser` is added to parse server messages into localized, user-friendly string resources.
* **Navigation and Integration:**
* The bottom navigation bar now has a "Notifications" tab instead of "Activity", with a new icon and string resources.
* The `notificationsGraph` is integrated into the main navigation structure.
* The `notificationsModule` for Koin is created and added to `MainApplication` to provide dependencies for this feature.
* **Minor Fixes & Refinements:**
* In `HubListScreen`, the `LaunchedEffect` now correctly re-triggers when the `areHubsOwned` parameter changes.
* The `SuccessDialog` icon is updated for better visibility, and its `onDismiss` callback now properly clears state variables.
* In `HubDetailsViewModel`, the logic for updating the hub after a successful edit has been streamlined.
This commit introduces a major refactoring of the navigation architecture by consolidating multiple navigation graphs into a unified `MainGraph`. It also updates several dependencies and refines navigation logic for a more robust user experience.
### Key Changes:
* **Navigation Graph Consolidation:**
* Deleted `OwnedHubsGraph.kt`, `SharedHubsGraph.kt`, and `NotificationsGraph.kt`.
* Renamed `MenuGraph.kt` to `MainGraph.kt` and moved the composable destinations for owned hubs, shared hubs, and notifications into it.
* This centralizes the primary navigation flow within a single `MainGraph` and removes redundant graph files.
* The `AppNavHost` has been updated to use the new `mainGraph`.
* **Navigation Route & SubGraph Refactoring:**
* `Screen.MyHubs` was renamed to `Screen.OwnedHubs`.
* The `MyHubDetails` screen route was removed, and navigation to hub details now uses a `HubDetails` subgraph.
* Redundant `SubGraph` definitions (`OwnedHubs`, `SharedHubs`, `Notifications`) were removed in favor of the new `Main` subgraph.
* **Bottom Navigation Enhancement:**
* Logic in `BottomNavigationBar` was updated to prevent redundant navigation events by checking if the destination is already the current one.
* `AppNavigator`'s `navigateFromBottomBar` function now correctly clears the back stack up to the start destination to prevent unexpected screen stacking.
* **Bug Fixes & UX Improvements:**
* **OTP Screen:** Added a `LaunchedEffect` to automatically request focus for the first OTP input field when the `OtpScreen` appears.
* **Notifications:** The invitation list now refreshes immediately after accepting or declining an invitation.
* **Hub Ownership:** The logic for determining if a hub is owned (`isOwned` flag) is now correctly based on the user's `HubRole`.
* **Dependency Updates:**
* Upgraded several libraries, including:
* `composeNavigation` to `2.9.6`
* `coreSplashscreen` to `1.2.0`
* `ktor` to `3.3.3`
This commit introduces several UI enhancements, bug fixes, and refactors across the application. Key changes include adding detailed empty state screens, refining dialog behavior, and improving the user experience during logout.
### Key Changes:
* **UI/UX Enhancements:**
* **Empty State Screens**: Implemented detailed and user-friendly empty state screens with icons and descriptive messages for:
* No items found in Hub Details (`HubDetailsScreen`).
* No owned or shared hubs in the Hub List (`HubListScreen`).
* **Dialog Behavior**: Refined `WarningDialog` and `SuccessDialog` logic in `HubDetailsScreen` and `NotificationsScreen`. State is now cleared in the `onDismiss` callback to prevent stale data, and actions are correctly triggered.
* **Card Elevation**: Removed the card elevation (`defaultElevation`) from the "About" and "Members" cards in the `AboutHub` component for a flatter, more modern UI.
* **Refinements & Fixes:**
* **Logout Flow**: Added a loading indicator (`ShowLoading`) when the user initiates logout from the `MenuScreen` to provide visual feedback.
* **Navigation**: Removed commented-out and unused code related to the "Forgot Password" link on the `LoginScreen` and cleaned up navigation logic in `AuthGraph`.
* **Localization:**
* Added Arabic translations for the new empty state strings to maintain localization consistency.
* **Cleanup:**
* A temporary debugging log statement has been removed from `SupabaseSessionRepository`.
* Commented out the "Profile" `MenuCard` from the `MenuScreen` as it is not currently implemented.
|
Connected to Huly®: TRACK-22 |
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.
AI-Generated Pull Request Summary
Summary
This pull request introduces a new feature for managing hub invitations, including a notifications screen, data models, and repository implementation. The feature allows users to view and respond to invitations, with support for accepting or rejecting invitations. The implementation includes a new navigation graph, updated UI components, and integration with the Supabase backend. The code changes also include updates to the app's build configuration, dependencies, and string resources.
Technical Changes
Generated by AI - please review and edit as needed