Skip to content

Conversation

@ishira-web
Copy link
Collaborator

@ishira-web ishira-web commented Nov 19, 2025

image

Summary by CodeRabbit

  • Style
    • Updated Surgery Status Report form controls with improved responsive layout and optimized width adjustments for enhanced visual presentation.

@ishira-web ishira-web self-assigned this Nov 19, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 19, 2025

Walkthrough

CSS layout classes are added to form and menu components in a surgery status report view for responsive width adjustments. No logic, data binding, or control flow modifications were made.

Changes

Cohort / File(s) Change Summary
UI Layout Styling
src/main/webapp/reports/managementReports/surgery_status.xhtml
Adds responsive width classes to form (w-100) and dropdown select menus (w-50 each) for layout consistency

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • The changes are purely presentational—CSS class additions to existing UI elements
  • No functional logic modifications or data binding changes to validate
  • Minimal risk of unintended side effects

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Set Inputs into same size' directly matches the main change, which adds layout classes to UI components to adjust their widths for consistent sizing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch #16677-create-a-wireframe-to-surgery-status

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/webapp/reports/managementReports/surgery_status.xhtml (1)

34-42: Fix empty target attributes causing runtime errors in Print/Export buttons.

The p:printer (line 35) and p:dataExporter components (lines 38, 41) have empty target="" attributes. These must reference the ID of the data table to function correctly. Currently, clicking these buttons will either fail silently or throw JavaScript/JSF errors.

First, add an id to the data table (line 47):

-<p:dataTable value="null" var="c">
+<p:dataTable id="surgeryStatusTable" value="null" var="c">

Then, update all three target attributes:

-<p:printer target=""/>
+<p:printer target="surgeryStatusTable"/>
-<p:dataExporter fileName="Surgery_Report" type="xlsx" target="" />
+<p:dataExporter fileName="Surgery_Report" type="xlsx" target="surgeryStatusTable" />
-<p:dataExporter fileName="Surgery_Report" type="pdf" target="" />
+<p:dataExporter fileName="Surgery_Report" type="pdf" target="surgeryStatusTable" />

Based on learnings

🧹 Nitpick comments (2)
src/main/webapp/reports/managementReports/surgery_status.xhtml (2)

19-19: Inconsistent class attribute formatting with leading space.

The class attribute has a leading space (class=" w-50") which is inconsistent with line 13's class="w-100". While both are valid, consistent formatting improves maintainability.

Apply this diff to remove the leading space:

-<p:selectOneMenu value="#{reportController.currentSpeciality}" class=" w-50">
+<p:selectOneMenu value="#{reportController.currentSpeciality}" class="w-50">

26-26: Inconsistent class attribute formatting with leading space.

Same as line 19, the class attribute has a leading space for consistency.

Apply this diff to remove the leading space:

-<p:selectOneMenu  class=" w-50" >
+<p:selectOneMenu class="w-50" >
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1d2d99b and ad94036.

📒 Files selected for processing (1)
  • src/main/webapp/reports/managementReports/surgery_status.xhtml (1 hunks)
🧰 Additional context used
🧠 Learnings (16)
📓 Common learnings
Learnt from: buddhika75
Repo: hmislk/hmis PR: 15166
File: src/main/webapp/pharmacy/adjustments/pharmacy_adjustment_purchase_rate.xhtml:71-72
Timestamp: 2025-08-27T14:48:54.210Z
Learning: In the HMIS project (hmislk/hmis), buddhika75 explained that both `class` and `styleClass` attributes work correctly on PrimeFaces components due to JSF's internal compatibility alias mechanism. Existing code using `class` is valid and doesn't need refactoring, but future development should prefer `styleClass` for clarity and documentation alignment.
Learnt from: buddhika75
Repo: hmislk/hmis PR: 15166
File: src/main/webapp/pharmacy/adjustments/pharmacy_adjustment_department.xhtml:82-83
Timestamp: 2025-08-27T13:19:42.906Z
Learning: In the HMIS project (hmislk/hmis), using the `class` attribute on PrimeFaces components is perfectly allowed and works correctly, so there's no need to convert `class` to `styleClass` for styling to be applied.
Learnt from: buddhika75
Repo: hmislk/hmis PR: 13441
File: src/main/webapp/resources/pharmacy/history.xhtml:56-122
Timestamp: 2025-06-28T00:58:21.722Z
Learning: In src/main/webapp/resources/pharmacy/history.xhtml, the Stock data table is intentionally duplicated between the block layout and tab layout sections to support dynamic rendering based on user preferences. The conditional rendering allows users to choose between different UI layouts, so both versions need to exist and should not be refactored into a shared component.
Learnt from: damithdeshan98
Repo: hmislk/hmis PR: 13897
File: src/main/webapp/lab/patient_report_without_sample_sending_process.xhtml:247-249
Timestamp: 2025-07-13T18:41:53.231Z
Learning: In src/main/webapp/lab/patient_report_without_sample_sending_process.xhtml, damithdeshan98 prefers using explicit Save buttons rather than adding AJAX listeners for immediate auto-saving on flag select menus, even though other similar fields in the form have auto-save functionality.
📚 Learning: 2025-10-12T05:32:34.145Z
Learnt from: CR
Repo: hmislk/hmis PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-12T05:32:34.145Z
Learning: Applies to **/*.xhtml : For UI improvements, limit changes to XHTML/CSS/PrimeFaces unless backend changes are explicitly requested

Applied to files:

  • src/main/webapp/reports/managementReports/surgery_status.xhtml
📚 Learning: 2025-07-13T18:41:53.231Z
Learnt from: damithdeshan98
Repo: hmislk/hmis PR: 13897
File: src/main/webapp/lab/patient_report_without_sample_sending_process.xhtml:247-249
Timestamp: 2025-07-13T18:41:53.231Z
Learning: In src/main/webapp/lab/patient_report_without_sample_sending_process.xhtml, damithdeshan98 prefers using explicit Save buttons rather than adding AJAX listeners for immediate auto-saving on flag select menus, even though other similar fields in the form have auto-save functionality.

Applied to files:

  • src/main/webapp/reports/managementReports/surgery_status.xhtml
📚 Learning: 2025-08-31T18:33:43.772Z
Learnt from: buddhika75
Repo: hmislk/hmis PR: 0
File: :0-0
Timestamp: 2025-08-31T18:33:43.772Z
Learning: buddhika75 fixed critical PrimeFaces.monitorDownload() JavaScript errors by removing undefined callbacks, added meaningful tooltips to improve UX, replaced Bootstrap classes with inline CSS, and implemented comprehensive privilege checks (PharmacyStockAdjustment, PharmacyPhysicalCountApprove, PharmacyStockTakeApprove) for pharmacy stock take operations in commit 70ab98d803.

Applied to files:

  • src/main/webapp/reports/managementReports/surgery_status.xhtml
📚 Learning: 2025-07-13T18:49:02.315Z
Learnt from: damithdeshan98
Repo: hmislk/hmis PR: 13897
File: src/main/webapp/lab/patient_report_without_sample_sending_process.xhtml:15-15
Timestamp: 2025-07-13T18:49:02.315Z
Learning: In src/main/webapp/lab/patient_report_without_sample_sending_process.xhtml, damithdeshan98 wants to keep the current privilege check pattern using OR condition (LabDataentry OR LabPrinting) rather than requiring dual privileges like other dashboard components. This page should not follow the standard dual-privilege requirement pattern used in other HMIS dashboard components.

Applied to files:

  • src/main/webapp/reports/managementReports/surgery_status.xhtml
📚 Learning: 2025-06-28T00:58:21.722Z
Learnt from: buddhika75
Repo: hmislk/hmis PR: 13441
File: src/main/webapp/resources/pharmacy/history.xhtml:56-122
Timestamp: 2025-06-28T00:58:21.722Z
Learning: In src/main/webapp/resources/pharmacy/history.xhtml, the Stock data table is intentionally duplicated between the block layout and tab layout sections to support dynamic rendering based on user preferences. The conditional rendering allows users to choose between different UI layouts, so both versions need to exist and should not be refactored into a shared component.

Applied to files:

  • src/main/webapp/reports/managementReports/surgery_status.xhtml
📚 Learning: 2025-05-28T20:22:14.251Z
Learnt from: damithdeshan98
Repo: hmislk/hmis PR: 12594
File: src/main/webapp/resources/ezcomp/lab/dashboard/patient_sample.xhtml:246-409
Timestamp: 2025-05-28T20:22:14.251Z
Learning: In src/main/webapp/resources/ezcomp/lab/dashboard/patient_sample.xhtml, the duplicate "Status Details" column (alongside "Current Status" column) is intentionally kept for future use and should not be removed despite appearing redundant.

Applied to files:

  • src/main/webapp/reports/managementReports/surgery_status.xhtml
📚 Learning: 2025-04-26T10:18:03.205Z
Learnt from: buddhika75
Repo: hmislk/hmis PR: 11950
File: src/main/webapp/pharmacy/reports/summary_reports/daily_stock_balance_report.xhtml:151-168
Timestamp: 2025-04-26T10:18:03.205Z
Learning: The daily_stock_balance_report.xhtml page is not yet being used in production and UI improvements for this page will be handled in separate issues.

Applied to files:

  • src/main/webapp/reports/managementReports/surgery_status.xhtml
📚 Learning: 2025-08-31T02:04:03.762Z
Learnt from: buddhika75
Repo: hmislk/hmis PR: 15225
File: src/main/webapp/pharmacy/reports/stock_adjustment_variance.xhtml:9-9
Timestamp: 2025-08-31T02:04:03.762Z
Learning: In src/main/webapp/pharmacy/reports/stock_adjustment_variance.xhtml, buddhika75 confirmed that adding a privilege guard (PharmacyStockAdjustment) around the subcontent will be handled in a separate issue rather than in the current PR focused on wiki documentation improvements.

Applied to files:

  • src/main/webapp/reports/managementReports/surgery_status.xhtml
📚 Learning: 2025-09-24T18:51:23.843Z
Learnt from: PasinduW99
Repo: hmislk/hmis PR: 15569
File: src/main/webapp/resources/pharmacy/pharmacy_transfer_request_receipt_custom_1.xhtml:113-121
Timestamp: 2025-09-24T18:51:23.843Z
Learning: In src/main/webapp/resources/pharmacy/pharmacy_transfer_request_receipt_custom_1.xhtml, PasinduW99 confirmed that unescaped ampersands (&nbsp;) in h:outputLabel value attributes work fine in their JSF setup and should not be changed to &amp;nbsp;.

Applied to files:

  • src/main/webapp/reports/managementReports/surgery_status.xhtml
📚 Learning: 2025-08-31T18:33:43.772Z
Learnt from: buddhika75
Repo: hmislk/hmis PR: 0
File: :0-0
Timestamp: 2025-08-31T18:33:43.772Z
Learning: buddhika75 in PharmacyStockTakeController.java demonstrates excellent systematic fix implementation, including JavaScript error resolution in PrimeFaces.monitorDownload() calls, UI enhancement with meaningful tooltips, Bootstrap class cleanup with inline CSS, and comprehensive security privilege checks for pharmacy operations. Shows strong attention to review feedback and production readiness.

Applied to files:

  • src/main/webapp/reports/managementReports/surgery_status.xhtml
📚 Learning: 2025-11-07T14:17:19.975Z
Learnt from: DhaneshKaushan
Repo: hmislk/hmis PR: 16372
File: src/main/webapp/pharmacy/pharmacy_item_import_with_stock.xhtml:32-40
Timestamp: 2025-11-07T14:17:19.975Z
Learning: In src/main/webapp/pharmacy/pharmacy_item_import_with_stock.xhtml, DhaneshKaushan prefers to defer wiring the Download Template <p:fileDownload> to a backend implementation in a later PR; for UI-only changes, disable or hide the button temporarily to avoid broken UX and console errors.

Applied to files:

  • src/main/webapp/reports/managementReports/surgery_status.xhtml
📚 Learning: 2025-07-26T13:29:32.079Z
Learnt from: DARKDRAGON-LK
Repo: hmislk/hmis PR: 14180
File: src/main/webapp/inward/inward_bill_final.xhtml:144-158
Timestamp: 2025-07-26T13:29:32.079Z
Learning: In src/main/webapp/inward/inward_bill_final.xhtml, the Credit Company Details panel with commented-out ui:repeat block for displaying credit company information is intentionally reserved for future development, as confirmed by DARKDRAGON-LK. The empty panel structure should be kept as is for future implementation.

Applied to files:

  • src/main/webapp/reports/managementReports/surgery_status.xhtml
📚 Learning: 2025-09-22T20:32:49.500Z
Learnt from: PasinduW99
Repo: hmislk/hmis PR: 15535
File: src/main/webapp/resources/pharmacy/saleBill_Retail_Pos_paper_Custom_1.xhtml:92-111
Timestamp: 2025-09-22T20:32:49.500Z
Learning: PasinduW99 confirmed in PR #15535 for the file src/main/webapp/resources/pharmacy/saleBill_Retail_Pos_paper_Custom_1.xhtml that h:panelGroup components inside table structures work fine in their JSF setup for printing/layout, even though it technically generates span/div elements within table markup.

Applied to files:

  • src/main/webapp/reports/managementReports/surgery_status.xhtml
📚 Learning: 2025-05-27T18:44:30.710Z
Learnt from: buddhika75
Repo: hmislk/hmis PR: 12553
File: src/main/java/com/divudi/bean/lab/PatientReportController.java:1617-1626
Timestamp: 2025-05-27T18:44:30.710Z
Learning: In the PatientReportController class, parameter validation is typically handled at the calling method level rather than within individual utility methods like emailSubject() and emailBody(). The approvePatientReport() method validates currentPatientReport early, so subsequent method calls don't need redundant null checks.

Applied to files:

  • src/main/webapp/reports/managementReports/surgery_status.xhtml
📚 Learning: 2025-10-12T05:32:34.145Z
Learnt from: CR
Repo: hmislk/hmis PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-12T05:32:34.145Z
Learning: Applies to **/*.xhtml : Reuse existing controller properties/methods in views; avoid introducing new global filters or backend logic from the UI

Applied to files:

  • src/main/webapp/reports/managementReports/surgery_status.xhtml
🔇 Additional comments (1)
src/main/webapp/reports/managementReports/surgery_status.xhtml (1)

13-13: LGTM! Full-width form layout is appropriate.

The addition of class="w-100" for full-width form layout aligns with the responsive design goal stated in the PR title.

<p:outputLabel value="OT Room" >
</p:outputLabel>
<p:selectOneMenu value="#{reportController.currentSpeciality}">
<p:selectOneMenu value="#{reportController.currentSpeciality}" class=" w-50">
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix semantic mismatch: "OT Room" label bound to currentSpeciality property.

The p:outputLabel indicates "OT Room" but the selectOneMenu binds to #{reportController.currentSpeciality}. Speciality and OT Room are typically different domain concepts. This mismatch could lead to incorrect data handling or user confusion.

Consider updating the value binding to use a more semantically appropriate property:

-<p:selectOneMenu value="#{reportController.currentSpeciality}" class=" w-50">
+<p:selectOneMenu value="#{reportController.currentOtRoom}" class=" w-50">

Or verify with the backend team if currentSpeciality is intentionally being reused for OT Room selection.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/main/webapp/reports/managementReports/surgery_status.xhtml around line
19, the selectOneMenu for the "OT Room" label is bound to
#{reportController.currentSpeciality}, causing a semantic mismatch; change the
value binding to a semantically correct backing property (e.g.
#{reportController.currentOtRoom} or another OT room-specific property) and
ensure the ReportController exposes and uses that property (getter/setter and
any backend logic), or confirm with the backend team that reusing
currentSpeciality for OT Room is intentional and update documentation/tests
accordingly.

<p:outputLabel value="Proposed Surgery" >
</p:outputLabel>
<p:selectOneMenu >
<p:selectOneMenu class=" w-50" >
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add missing value binding for "Proposed Surgery" selection.

The p:selectOneMenu for "Proposed Surgery" has no value attribute, meaning the user's selection won't be captured or accessible to the backend. The "Process" button and other operations won't be able to retrieve the selected surgery.

Apply this diff to add a value binding:

-<p:selectOneMenu  class=" w-50" >
+<p:selectOneMenu value="#{reportController.currentSurgery}" class=" w-50" >

(Adjust the property name to match your controller's actual property for surgery selection.)

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<p:selectOneMenu class=" w-50" >
<p:selectOneMenu value="#{reportController.currentSurgery}" class=" w-50" >
🤖 Prompt for AI Agents
In src/main/webapp/reports/managementReports/surgery_status.xhtml around line
26, the <p:selectOneMenu> for "Proposed Surgery" is missing a value binding so
the user's selection isn't captured; add a value attribute bound to your backing
bean property (e.g. value="#{yourController.selectedProposedSurgery}"), ensure
that property exists with public getter/setter in the controller, and, if the
menu items are complex objects, wire an appropriate converter or bind to a
simple id type so the selection is populated and available to the Process button
and backend actions.

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