Projects page ui lazy loads audit, codebooks and teams#180
Conversation
- Installed laravel debugbar to better understand number of queries executed, use only on dev. - Optimized Audit Loading: Audits are no longer pre-loaded on the project list and project overview pages. Instead, they are now fetched on-demand, which dramatically reduces the number of initial database queries and improves page load times. - Accurate Filter Counts: The audit filter counts now accurately reflect the total number of audits for each filter type, rather than just the count for the current page. This is achieved by calculating the counts on the backend. These changes result in a faster, more efficient, and more user-friendly experience when working with projects and audits.
Team data is no longer pre-loaded on the project overview page. Instead, it is now fetched from a dedicated API endpoint when the "Collaboration" tab is clicked. This reduces the number of initial database queries and improves page load times. In addition to that, I removed the "ownTeams" from HandleInertiaRequests.php so we don't load that in every page, but only when it's needed.
|
Codebooks were already lazy loaded as for #164 , now I optimized the audits and the teams by also removing some data load that wasn't needed in every page. |
|
@alessandrobelli please install this branch on staging and send the link to @kadewe so @kadewe can test and add their review here. We should not merge before its not approved by @kadewe |
There was a problem hiding this comment.
Pull Request Overview
Implements comprehensive lazy loading for project-related data (audits, codebooks, and teams) to improve performance by loading data only when needed instead of upfront.
- Removes server-side data preloading for audits, teams, and owned teams from initial page renders
- Introduces client-side composables (
useAudit,useTeam) to manage lazy-loaded data - Adds new API endpoints for fetching team data and user-owned teams on demand
Reviewed Changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
web/routes/web.php |
Adds new API routes for project team data and user owned teams |
web/resources/js/domain/teams/useTeam.js |
Implements team data lazy loading with reactive state management |
web/resources/js/domain/project/Project.js |
Adds project update method for client-side operations |
web/resources/js/domain/audit/useAudit.js |
New composable for managing audit data with lazy loading |
web/resources/js/Pages/Teams/ProjectTeams.vue |
Updates to use lazy-loaded team data instead of props |
web/resources/js/Components/global/Audit.vue |
Refactors to use audit composable and removes prop dependencies |
web/app/Http/Controllers/ProjectController.php |
Removes audit preloading and adds team data endpoint |
web/app/Http/Controllers/UserController.php |
New controller for serving user-owned teams data |
web/app/Services/AuditService.php |
Adds audit count aggregation functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
kadewe
left a comment
There was a problem hiding this comment.
Looks ok to me – this will be a performance boost without introducing any security concerns.
Implements full lazy loading of project related data.
Progress: