Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds user-based filtering to community links, introduces an endpoint and action for fetching community users, and updates the frontend UI to support selecting and filtering by user, along with dark-mode and accessibility improvements.
- Backend:
- Extend
GetCommunityLinksto filter by user UUID and validate the newuserrequest parameter. - Add
GetCommunityUsersaction andCommunityUserControllerto fetch users with public links.
- Extend
- Frontend:
- Enhance the community links page to include a user filter with autocomplete.
- Update multiple UI components (
suggest,autocomplete,pill, etc.) for dark mode and styling consistency.
- Tests & Routes:
- Update unit and feature tests to cover user filtering and the new API.
- Register a new
/api/usersroute for community users.
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/Actions/GetCommunityUsersTest.php | Adds unit tests for fetching community users |
| tests/Unit/Actions/GetCommunityLinksTest.php | Updates unit tests to include and test user-based filtering |
| tests/Feature/CommunityUserControllerTest.php | Adds feature tests for CommunityUserController |
| tests/Feature/CommunityLinkControllerTest.php | Updates feature tests to assert user support in links API |
| routes/api.php | Registers community-users.index API route |
| app/Actions/GetCommunityUsers.php | New action to fetch community users |
| app/Http/Controllers/CommunityUserController.php | New controller for community users endpoint |
| app/Actions/GetCommunityLinks.php | Extends link-fetching action with filterUser |
| app/Data/Requests/GetCommunityLinksRequest.php | Adds user parameter and validation |
| app/Http/Controllers/CommunityLinkController.php | Passes selected user to Inertia view |
| resources/js/pages/community-links/index.tsx | Implements user filter UI, state, and routing |
| resources/js/components/ui/suggest.tsx | Improves dark-mode dropdown styling |
| resources/js/components/ui/remote-multi-autocomplete.tsx | Updates onValueAdded typing |
| resources/js/components/ui/remote-autocomplete.tsx | Updates onValueChanged typing and dropdown styling |
| resources/js/components/ui/pill.tsx | Refines pill close button styling |
| resources/js/components/ui/multi-suggest.tsx | Refines dropdown styling for multi-suggest |
| resources/js/components/ui/autocomplete.tsx | Refines dropdown styling for autocomplete |
| resources/js/components/community-link-card.tsx | Adds user link for filtering in card header |
Comments suppressed due to low confidence (3)
resources/js/pages/community-links/index.tsx:55
- Since you’re now also filtering by
user, consider updating theonlyarray to['links', 'user']so Inertia will only reload the relevant props and avoid unnecessary rerenders.
router.get(route('community-links.index'), clearFormData(data), {
app/Http/Controllers/CommunityUserController.php:14
- The parameter
$getCommunityAuthorsis misnamed since it’s an instance ofGetCommunityUsers. Rename it to$getCommunityUsersfor clarity and consistency.
public function index(SearchRequest $data, GetCommunityUsers $getCommunityAuthors): JsonResource
app/Actions/GetCommunityLinks.php:90
- The closure’s parameter
$user(UUID) is shadowed by this local$uservariable (a model). Consider renaming the constructor argument to$userUuidand this variable to$useror$foundUserto avoid confusion.
$user = User::query()->where('uuid', $user)->first();
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.
This pull request introduces enhancements to the community links feature, focusing on filtering by user, improving the user interface, and adding new functionality for fetching community users. The most significant changes include updates to support user-based filtering, modifications to UI components for better accessibility and styling, and the addition of a new controller and action for fetching community users.
Backend Changes
User-based filtering for community links:
filterUsermethod inapp/Actions/GetCommunityLinks.phpto filter links by user UUID.GetCommunityLinksRequestto include auserparameter and validation rules for UUID format. [1] [2]New community users feature:
GetCommunityUsersaction to fetch users associated with public and published links.CommunityUserControllerto handle fetching community users via an API endpoint.Frontend Changes
User search and filtering:
resources/js/pages/community-links/index.tsxto support user selection and search functionality, including fetching users via the new API endpoint. [1] [2]UI improvements:
autocomplete.tsx,multi-suggest.tsx,remote-autocomplete.tsx,suggest.tsx) for better accessibility and dark mode support. [1] [2] [3] [4]pill.tsxto improve hover and focus states for the close button.These changes collectively improve the functionality and user experience of the community links feature, enabling more precise filtering and enhancing the UI for better usability.