Merged
Conversation
Collaborator
|
Great job! |
Collaborator
|
One of the best descriptions I have seen in a pr, good work |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds role-based visibility for an "Assigned Moderators" section on the Feeding Point Details screen. The implementation introduces a reactive user role system that decodes Cognito JWT tokens to determine if users are volunteers, moderators, or admins, and conditionally displays moderators only to authorized users.
Changes:
- Introduced
UserRoleenum (volunteer, moderator, admin) with reactive role updates viauserRolePublisher - Added moderators section to Feeding Point Details with shimmer loading state and expand/collapse functionality
- Created
ArrowButtonViewcomponent andModeratorsShimmerViewfor the new UI elements
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| UserProfileServiceProtocol.swift | Defines UserRole enum and UserRoleObservable protocol for reactive role updates |
| UserProfileService.swift | Exposes userRolePublisher to propagate role changes |
| UserValidationModel.swift | Decodes Cognito groups from JWT ID token and publishes role changes |
| FeedingPointDetailsContract.swift | Adds onModeratorsChange callback and tapShowMoreModerators event |
| FeedingPointDetailsModel.swift | Subscribes to role changes and fetches moderators from feeding history |
| FeedingPointDetailsModelMapper.swift | Adds moderators field to domain model |
| FeedingPointDetailsViewModel.swift | Manages moderator list state and expand/collapse logic |
| FeedingPointDetailsViewMapper.swift | Maps moderators to UI models |
| FeedingPointDetailsViewController.swift | Renders moderators UI with shimmer and expand button |
| ModeratorsShimmerView.swift | Custom shimmer view for loading state |
| ArrowButtonView.swift | Reusable chevron button component |
| ButtonViewFactory.swift | Factory method for arrow button |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
animeal/src/Flows/Main/Modules/Home/FeedingPointDetails/Model/FeedingPointDetailsModel.swift
Show resolved
Hide resolved
animeal/src/Flows/Main/Modules/Home/FeedingPointDetails/Model/FeedingPointDetailsModel.swift
Outdated
Show resolved
Hide resolved
animeal/src/Business/Services/Profile/UserValidationModel.swift
Outdated
Show resolved
Hide resolved
animeal/src/Flows/Main/Modules/Home/FeedingPointDetails/Model/FeedingPointDetailsModel.swift
Show resolved
Hide resolved
animeal/src/Flows/Main/Modules/Home/FeedingPointDetails/FeedingPointDetailsViewModel.swift
Outdated
Show resolved
Hide resolved
animeal/src/Business/Services/Profile/UserValidationModel.swift
Outdated
Show resolved
Hide resolved
animeal/src/Flows/Main/Modules/Home/FeedingPointDetails/Model/FeedingPointDetailsModel.swift
Show resolved
Hide resolved
Services/Sources/Services/UserProfile/UserProfileServiceProtocol.swift
Outdated
Show resolved
Hide resolved
...eal/src/Flows/Main/Modules/Home/FeedingPointDetails/View/FeedingPointDetailsViewMapper.swift
Outdated
Show resolved
Hide resolved
...eal/src/Flows/Main/Modules/Home/FeedingPointDetails/View/FeedingPointDetailsViewMapper.swift
Outdated
Show resolved
Hide resolved
steryokhin
reviewed
Jan 17, 2026
UIComponents/Sources/UIComponents/Components/Buttons/ArrowButtonView.swift
Outdated
Show resolved
Hide resolved
steryokhin
reviewed
Jan 17, 2026
steryokhin
reviewed
Jan 17, 2026
animeal/src/Flows/Main/Modules/Home/FeedingPointDetails/FeedingPointDetailsViewModel.swift
Outdated
Show resolved
Hide resolved
steryokhin
reviewed
Jan 17, 2026
animeal/src/Flows/Main/Modules/Home/FeedingPointDetails/FeedingPointDetailsViewModel.swift
Show resolved
Hide resolved
steryokhin
reviewed
Jan 24, 2026
animeal/src/Flows/Main/Modules/Home/FeedingPointDetails/Model/FeedingPointDetailsModel.swift
Show resolved
Hide resolved
steryokhin
approved these changes
Jan 25, 2026
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
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.
Pull Request overview
Assigned Moderators & Role-Based Visibility
Problem
We needed a reliable way to detect if the current user is moderator/admin and conditionally show “Assigned moderators” on the details screen. Previously we only had user mode, but no reactive role updates.
Summary
This PR introduces observable user roles (volunteer / moderator / admin) and uses them to show a new “Assigned moderators” section on Feeding Point Details. The moderators list is fetched from feeding history, displayed only for moderator/admin, and includes a shimmer loading state plus an expand (chevron) button when there are more than 5 moderators.
Changes
UserRole(volunteer, moderator, admin) and addedUserRoleObservablewithuserRolePublisheruserRolePublisherso business logic can react to role changesUserRole, and publishes updates reactivelyonModeratorsChangeandtapShowMoreModeratorsevent to support moderators sectionuserRolePublisher, fetches assigned moderators from feeding history, and exposes them viaonModeratorsChange🧠 How it works (High level)
userRolePublisherHow to test
Volunteer
→ Assigned moderators section should be hidden
Moderator / Admin
→ Moderators shimmer appears first (while loading)
→ Then “Assigned moderators” appears with up to 5 names
→ If total moderators > 5 → chevron down shows → tap to expand and reveal up to 10