Skip to content

Conversation

@GreenVenom77
Copy link
Owner

@GreenVenom77 GreenVenom77 commented Dec 7, 2025

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

  • Notifications Screen: Implemented a new screen for displaying hub invitations, allowing users to view and respond to invitations. The screen uses a LazyColumn to display a list of invitations, with each item representing a single invitation.
  • HubInvitation Data Model: Created a new data model to represent a hub invitation, including properties for the invitation ID, hub ID, hub name, description, inviter name, email, role, and creation date.
  • Notifications Repository: Implemented a new repository for managing hub invitations, providing functions for getting invitations and responding to invitations. The repository uses the Supabase backend to fetch and update invitation data.
  • SupabaseHubInvitations: Created a new class for interacting with the Supabase backend, providing functions for getting invitations and responding to invitations.
  • NotificationsViewModel: Implemented a new view model for managing the notifications screen, handling user input and updating the screen state accordingly.
  • Navigation Graph: Updated the app's navigation graph to include the new notifications screen, with support for navigating to the screen from the bottom navigation bar.
  • UI Components: Updated various UI components, including the bottom navigation bar, to support the new notifications feature.
  • String Resources: Added new string resources to support the notifications feature, including strings for the notifications screen and invitation items.
  • Build Configuration: Updated the app's build configuration to include the new notifications feature, with changes to the build.gradle files and settings.gradle file.
  • Dependencies: Updated the app's dependencies to include the required libraries for the notifications feature, including the Supabase library.

Generated by AI - please review and edit as needed

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.
@huly-for-github
Copy link

Connected to Huly®: TRACK-22

@GreenVenom77 GreenVenom77 merged commit a75226f into development Dec 7, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants