Bug #440 — WO/SO: JSA review comments blocked during co-review
Issue: #440 Reporter: Kang-Supreeya Date: 2026-02-18 Version: Preview35 Severity: Medium Frequency: Always
Description
Work Owner and Safety Officer cannot add review comments in the "Reviewer Comments" section during JSA co-review state. The comment textarea and "Add Comment" button are hidden. This is a regression from the review comments feature (#430).
Related: #430 (JSA review comments feature — implemented in Preview35)
Location
Tasks > JSA Preparation > Open JSA document > Reviewer Comments section (bottom of form)
Bug Details
| Role | Expected | Actual |
|---|---|---|
| Work Owner | Can add review comments during co-review | Comment area hidden |
| Safety Officer | Can add review comments during co-review | Comment area hidden |
Steps to Reproduce
- Login as Work Owner or Safety Officer
- Go to Tasks > JSA Preparation (during co-review state)
- Open a JSA document
- Scroll to "Reviewer Comments" section at bottom
- Observe — comment textarea and add button are missing
Root Cause
The review comments visibility depended on isFormEditable(), which returns false during co-review because the form is in read-only mode for approval. This blocked both editing AND commenting, but comments should still be allowed for WO/SO during review.
Fix Applied
| Layer | Change |
|---|---|
| Frontend | Changed canAddReviewComment to allow WO/SO comments during co-review state (when documentApprovalEnabled is true) |
| Frontend | Fixed workflow stepper showing step 1 instead of completed for approved JSA/Tool List tasks |
PR: (pending)
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Login as WO during co-review > Open JSA > Can add review comment | 🔍 In Review |
| 2 | Login as SO during co-review > Open JSA > Can add review comment | 🔍 In Review |
| 3 | Login as Contractor > Open JSA > Cannot add review comment (read-only) | 🔍 In Review |
| 4 | Task completed > Open JSA > No one can add comments | 🔍 In Review |
| 5 | Approved/completed task > Stepper shows all steps completed | 🔍 In Review |