Add option to give a review comment when approving / denying inactivity notices / resignations - #179
Conversation
📝 WalkthroughWalkthroughThe notices page now supports optional per-item reviewer comments for approving or denying notices and resignations, submits and clears them, and displays them on reviewed items. Prisma packages are updated to ChangesReview comment handling
Prisma package version update
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
package.jsonParsing error: Missing semicolon. (2:8) Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@package.json`:
- Line 85: Align all Prisma dependencies, including `@prisma/client`, prisma, and
`@prisma/adapter-pg`, to the same version across package.json and
package-lock.json; update the resolved lockfile entries and metadata
consistently.
In `@pages/workspace/`[id]/notices/index.tsx:
- Around line 415-416: Replace the page-level resignationReviewComment and
noticeReviewComment values with draft state keyed by each request’s
notice/resignation ID. Update each card’s textarea binding and change handlers
to read and write only that card’s ID entry, and ensure approval/denial handlers
submit the comment associated with their target request.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6e871a37-9987-4bbe-a717-ff57da570d0f
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
package.jsonpages/workspace/[id]/notices/index.tsx
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
package.json (1)
85-85: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winMove
@prisma/clienttodependencies.
utils/database.tsimports@prisma/clientat runtime, but it is currently listed underdevDependencieswhilenpm ci --omit=devbehavior keeps the@prisma/adapter-pgruntime dependency independencies. Promote@prisma/clientso production installs can resolve the runtime Prisma client; keep theprismaCLI indevDependencies.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package.json` at line 85, Move `@prisma/client` from devDependencies to dependencies in package.json so runtime imports from utils/database.ts resolve in production installs, while keeping the prisma CLI under devDependencies.pages/workspace/[id]/notices/index.tsx (2)
891-898: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winPreserve line breaks in displayed review comments. The new textareas accept multiline input, but both display paragraphs collapse newlines.
pages/workspace/[id]/notices/index.tsx#L891-L898: addwhitespace-pre-wrapor equivalent to the notice comment paragraph.pages/workspace/[id]/notices/index.tsx#L943-L951: addwhitespace-pre-wrapor equivalent to the resignation comment paragraph.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pages/workspace/`[id]/notices/index.tsx around lines 891 - 898, Preserve multiline formatting in both displayed comment paragraphs by adding whitespace-pre-wrap or an equivalent whitespace-preserving class to the notice review comment at pages/workspace/[id]/notices/index.tsx:891-898 and the resignation comment at pages/workspace/[id]/notices/index.tsx:943-951.
1011-1022: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAdd item-specific accessible names to the review textareas.
pages/workspace/[id]/notices/index.tsx#L1011-L1022: associate the resignation textarea with an item-specific<label>/idpair oraria-label.pages/workspace/[id]/notices/index.tsx#L1116-L1127: associate the notice textarea with an item-specific<label>/idpair oraria-label.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pages/workspace/`[id]/notices/index.tsx around lines 1011 - 1022, Add item-specific accessible names to both review textareas in pages/workspace/[id]/notices/index.tsx: update the resignation textarea near lines 1011-1022 and the notice textarea near lines 1116-1127 with unique IDs paired to descriptive labels or item-specific aria-label values, preserving their existing state and change handlers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@package.json`:
- Line 85: Move `@prisma/client` from devDependencies to dependencies in
package.json so runtime imports from utils/database.ts resolve in production
installs, while keeping the prisma CLI under devDependencies.
In `@pages/workspace/`[id]/notices/index.tsx:
- Around line 891-898: Preserve multiline formatting in both displayed comment
paragraphs by adding whitespace-pre-wrap or an equivalent whitespace-preserving
class to the notice review comment at
pages/workspace/[id]/notices/index.tsx:891-898 and the resignation comment at
pages/workspace/[id]/notices/index.tsx:943-951.
- Around line 1011-1022: Add item-specific accessible names to both review
textareas in pages/workspace/[id]/notices/index.tsx: update the resignation
textarea near lines 1011-1022 and the notice textarea near lines 1116-1127 with
unique IDs paired to descriptive labels or item-specific aria-label values,
preserving their existing state and change handlers.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 3a8a78f3-46e1-42f3-ac73-98046bb6470d
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
package.jsonpages/workspace/[id]/notices/index.tsx
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pages/workspace/[id]/notices/index.tsx (1)
491-506: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftFull-page reload loses unrelated per-item review drafts.
The new keyed state is correct, but successful approval/denial reloads the page and clears every unsaved draft, not just the submitted item.
pages/workspace/[id]/notices/index.tsx#L491-L506: update the notice collections locally or persistnoticeReviewCommentsacross reloads.pages/workspace/[id]/notices/index.tsx#L551-L565: update the resignation collections locally or persistresignationReviewCommentsacross reloads.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pages/workspace/`[id]/notices/index.tsx around lines 491 - 506, Replace the successful non-cancel full-page reload in the notice handler around setAllNotices with a local update to the affected notice collection, preserving unrelated noticeReviewComments drafts; apply the same local-update approach to the resignation handler around setAllResignations and resignationReviewComments. Both affected sites in pages/workspace/[id]/notices/index.tsx (lines 491-506 and 551-565) must avoid reloads that clear other per-item drafts while removing or updating only the submitted item.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@pages/workspace/`[id]/notices/index.tsx:
- Around line 491-506: Replace the successful non-cancel full-page reload in the
notice handler around setAllNotices with a local update to the affected notice
collection, preserving unrelated noticeReviewComments drafts; apply the same
local-update approach to the resignation handler around setAllResignations and
resignationReviewComments. Both affected sites in
pages/workspace/[id]/notices/index.tsx (lines 491-506 and 551-565) must avoid
reloads that clear other per-item drafts while removing or updating only the
submitted item.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 8ce6cf21-bc46-4159-a08a-352c78379bd6
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
package.jsonpages/workspace/[id]/notices/index.tsx
BuddyWinte
left a comment
There was a problem hiding this comment.
The review comment state is shared across all pending notices, so typing a comment on one request also updates every other textarea. Each request should have its own independent review comment state.
|
Coderabbit already noted that and I think I've addressed it in commit d4fe5d7 |
This feature actually makes the
reviewCommentoption in inactivity notices and resignations have useIt allows reviewers to add an optional comment as a textbox, which then gets displayed with the approved or denied message when checking its status on the Notices page.
When no review comment is added, the box with the review comment doesn't appear
Here are 9 attachments which show each function:
Demo8.mp4
Demo7.mp4
Demo6.mp4
Demo5.mp4
Demo4.mp4
Demo3.mp4
Demo2.mp4
Demo1.mp4
Summary by CodeRabbit
New Features
Bug Fixes
Chores