Review feedback to user projects page#164
Open
bbarni2020 wants to merge 1 commit intohackclub:stagingfrom
Open
Review feedback to user projects page#164bbarni2020 wants to merge 1 commit intohackclub:stagingfrom
bbarni2020 wants to merge 1 commit intohackclub:stagingfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds the ability for users to view their project review history directly on the project page. Users can now see reviews and print history that were previously only visible to admins, improving transparency and providing users with feedback on their projects.
Changes:
- Added a "Show reviews" button on the project page for project owners when reviews exist
- Implemented a modal dialog to display review and print history
- Modified the review fetching logic to optionally exclude reviewer information for privacy
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/routes/dashboard/projects/[id]/+page.svelte |
Added modal dialog with ReviewHistory component, state management for showing/hiding the dialog, and a button to trigger it |
src/routes/dashboard/projects/[id]/+page.server.ts |
Fetches review history for project owners using getReviewHistory(id, false) |
src/routes/dashboard/admin/getReviewHistory.server.ts |
Added includeUser parameter to optionally filter out reviewer information |
src/routes/dashboard/admin/ReviewHistory.svelte |
Added showReviewer prop to conditionally display reviewer information |
Comments suppressed due to low confidence (1)
src/routes/dashboard/admin/getReviewHistory.server.ts:20
- When includeUser is false, the function still performs an innerJoin with the user table on lines 18, 35, and 52, then filters it out later. This is inefficient. Consider conditionally building the query to avoid joining the user table when includeUser is false, which will improve performance by reducing unnecessary database operations.
const t1Reviews = await db
.select({
user: {
id: user.id,
name: user.name
},
action: t1Review.action,
notes: t1Review.notes,
feedback: t1Review.feedback,
timestamp: t1Review.timestamp
})
.from(t1Review)
.innerJoin(user, eq(user.id, t1Review.userId))
.where(eq(t1Review.projectId, id))
.orderBy(asc(t1Review.timestamp));
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.