Skip to content

Add option to give a review comment when approving / denying inactivity notices / resignations - #179

Open
raadtotheraad wants to merge 5 commits into
PlanetaryOrbit:mainfrom
raadtotheraad:feat/review-comments
Open

Add option to give a review comment when approving / denying inactivity notices / resignations#179
raadtotheraad wants to merge 5 commits into
PlanetaryOrbit:mainfrom
raadtotheraad:feat/review-comments

Conversation

@raadtotheraad

@raadtotheraad raadtotheraad commented Jul 30, 2026

Copy link
Copy Markdown

This feature actually makes the reviewComment option in inactivity notices and resignations have use

It 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
Demo9

Summary by CodeRabbit

  • New Features

    • Reviewers can enter per-item comments when approving or denying time-off notices and staff resignations (not a shared single comment).
    • Reviewed request/resignation cards now show the saved comment with color styling (green for approved, red for denied) and preserve line breaks.
  • Bug Fixes

    • Submitted comments are cleared after a successful update to avoid reuse on later decisions.
  • Chores

    • Updated Prisma package versions for consistency with the client/server setup.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The 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 ^7.9.1, with @prisma/client moved to runtime dependencies.

Changes

Review comment handling

Layer / File(s) Summary
Review comment state and submission
pages/workspace/[id]/notices/index.tsx
Adds keyed comment state, includes trimmed comments in update payloads, and clears each item’s state after success.
Manage-tab comment inputs
pages/workspace/[id]/notices/index.tsx
Adds per-item reviewer textareas beside pending resignation and notice controls.
Reviewed comment display
pages/workspace/[id]/notices/index.tsx
Displays non-empty comments with approved or denied styling on reviewed notices and resignations.

Prisma package version update

Layer / File(s) Summary
Prisma package dependencies
package.json
Updates Prisma packages to ^7.9.1 and moves @prisma/client from devDependencies to dependencies.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: breadddevv

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding optional review comments for approving or denying notices and resignations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

package.json

Parsing 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 873c0db and d69d676.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • package.json
  • pages/workspace/[id]/notices/index.tsx

Comment thread package.json Outdated
Comment thread pages/workspace/[id]/notices/index.tsx Outdated
@raadtotheraad

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Move @prisma/client to dependencies.

utils/database.ts imports @prisma/client at runtime, but it is currently listed under devDependencies while npm ci --omit=dev behavior keeps the @prisma/adapter-pg runtime dependency in dependencies. Promote @prisma/client so production installs can resolve the runtime Prisma client; keep the prisma CLI in devDependencies.

🤖 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 win

Preserve 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: add whitespace-pre-wrap or equivalent to the notice comment paragraph.
  • pages/workspace/[id]/notices/index.tsx#L943-L951: add whitespace-pre-wrap or 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 win

Add 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>/id pair or aria-label.
  • pages/workspace/[id]/notices/index.tsx#L1116-L1127: associate the notice textarea with an item-specific <label>/id pair or aria-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

📥 Commits

Reviewing files that changed from the base of the PR and between d69d676 and 1d751fd.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • package.json
  • pages/workspace/[id]/notices/index.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 lift

Full-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 persist noticeReviewComments across reloads.
  • pages/workspace/[id]/notices/index.tsx#L551-L565: update the resignation collections locally or persist resignationReviewComments across 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1d751fd and 6fcb262.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • package.json
  • pages/workspace/[id]/notices/index.tsx

@BuddyWinte BuddyWinte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@raadtotheraad

Copy link
Copy Markdown
Author

Coderabbit already noted that and I think I've addressed it in commit d4fe5d7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants