Skip to content

WEB-4677 - Improve Pop Health Add/Edit Patient Modal Performance - #1995

Open
henry-tp wants to merge 13 commits into
developfrom
WEB-4677-modal-perf
Open

WEB-4677 - Improve Pop Health Add/Edit Patient Modal Performance#1995
henry-tp wants to merge 13 commits into
developfrom
WEB-4677-modal-perf

Conversation

@henry-tp

@henry-tp henry-tp commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

WEB-4677

I've made a few modifications to hopefully improve performance.

The main issue really is that the formikContext is held in state at the top level of the page component for ClinicPatients. So for every keystroke, when the formikContext gets updated, that updates the state at the top of ClinicPatients, so everything downstream must get re-rendered and re-calculated.

By abstracting out the modal contents and scoping the formikContext to the modal, we ensure that changes to the formikContext only force re-rendering for the modal and contents, so the rest of the page doesn't need to get re-calculated.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added dedicated dialogs for adding and editing clinic patient records.
    • Added duplicate medical record number validation, including support for editing existing records.
    • Added progress indicators and disabled actions while records are created or updated.
    • Improved dialog actions, including cancel, close, and confirmation behavior.
  • Improvements

    • Improved patient search and filter responsiveness.
    • Streamlined patient-list empty-state rendering.

Walkthrough

Clinic patient creation and editing now use dedicated dialog components. Validation state moves into the dialogs and PatientForm. ClinicPatients removes local form orchestration and memoizes patient-list query and empty-state handling.

Changes

Clinic patient dialogs

Layer / File(s) Summary
Patient form validation
app/components/clinic/PatientForm/PatientForm.js
PatientForm memoizes MRN settings, existing MRNs, and the validation schema before passing the schema to Formik.
Dialog implementations
app/pages/clinicworkspace/clinicPatientsDialogs/*
AddPatientDialog and EditPatientDialog handle form rendering, validation, metrics, cancel actions, and API submission.
ClinicPatients integration
app/pages/clinicworkspace/ClinicPatients.js
ClinicPatients renders the dedicated dialogs, removes local form state and handlers, selects working states separately, and memoizes search, filter, query-state, and empty-state handling.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ClinicPatients
  participant AddPatientDialog
  participant PatientForm
  participant api
  ClinicPatients->>AddPatientDialog: Render active add dialog
  AddPatientDialog->>PatientForm: Render and validate patient form
  ClinicPatients->>AddPatientDialog: Confirm patient creation
  AddPatientDialog->>api: Submit patient form
  api-->>AddPatientDialog: Return processing state
Loading

Possibly related PRs

Suggested reviewers: clintonium-119

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description check ✅ Passed The description clearly explains that the changes scope form state to modal components to reduce unnecessary page re-renders.
Title check ✅ Passed The title clearly summarizes the main change: improving Pop Health add and edit patient modal performance.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch WEB-4677-modal-perf

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

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js (3)

19-23: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Declare the dialog prop contracts.

Both exported dialogs accept props but have no propTypes. Declare api and onClose for both dialogs. Declare patient for EditPatientDialog. Declare searchDebounceMs when it is forwarded.

  • app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js#L19-L23: Add EditPatientDialog.propTypes.
  • app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js#L18-L21: Add AddPatientDialog.propTypes.

As per coding guidelines, “Define PropTypes for all component props.”

🤖 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 `@app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js` around
lines 19 - 23, Declare propTypes for both EditPatientDialog and
AddPatientDialog, covering api and onClose, plus patient on EditPatientDialog
and searchDebounceMs wherever it is forwarded. Apply the corresponding changes
in app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js at lines
19-23 and app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js at
lines 18-21.

Source: Coding guidelines


4-10: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the required import groups and component terminators.

trackMetric is a local import but appears before Lodash imports. Move it into the local-import group after Lodash. Terminate both const ...Dialog assignments with ;.

  • app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js#L4-L10: Reorder and separate import groups.
  • app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js#L101-L101: Change } to };.
  • app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js#L4-L9: Reorder and separate import groups.
  • app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js#L81-L81: Change } to };.

As per coding guidelines, “Group imports in the required order with blank lines between groups” and “Use single-quoted strings and required semicolons.”

🤖 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 `@app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js` around
lines 4 - 10, Reorder imports in
app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js lines 4-10
and app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js lines
4-9 so Lodash imports precede local imports, with required blank-separated
groups; terminate the const editPatientDialog assignment at line 101 and const
addPatientDialog assignment at line 81 with semicolons.

Source: Coding guidelines


40-54: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Memoize callbacks passed to child components.

Both dialogs create onFormChange, onClose, and confirmation callback props on every render. Wrap named handlers in useCallback. Replace the inline edit close and cancel handlers with named memoized handlers. Verify complete dependency arrays with react-hooks/exhaustive-deps.

  • app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js#L40-L54: Memoize named form, close, and confirm handlers.
  • app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js#L63-L66: Replace the inline title-close callback.
  • app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js#L82-L85: Replace the inline cancel callback.
  • app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js#L35-L42: Memoize named form, close, and confirm handlers.

As per coding guidelines, “use useCallback for callback props” and “respect react-hooks/exhaustive-deps.”

🤖 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 `@app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js` around
lines 40 - 54, Memoize callback props with useCallback and complete
exhaustive-deps dependencies: update handleFormChange, handleClose, and
handleConfirm in
app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js#L40-L54;
replace the inline title-close and cancel callbacks at `#L63-L66` and `#L82-L85`
with named memoized handlers; and apply the same treatment to the named form,
close, and confirm handlers in
app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js#L35-L42.

Source: Coding guidelines

🤖 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 `@app/pages/clinicworkspace/ClinicPatients.js`:
- Around line 3036-3049: Forward searchDebounceMs through both extracted patient
dialogs so caller-provided values reach PatientForm instead of being replaced by
the fixed default. In app/pages/clinicworkspace/ClinicPatients.js:3036-3049,
pass searchDebounceMs to AddPatientDialog and EditPatientDialog and include it
in both useCallback dependency arrays. In
app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js:18-21 and
:60, accept it with SEARCH_DEBOUNCE_MS as the default and pass it to
PatientForm. Apply the same changes in
app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js:19-23 and
:76.

---

Nitpick comments:
In `@app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js`:
- Around line 19-23: Declare propTypes for both EditPatientDialog and
AddPatientDialog, covering api and onClose, plus patient on EditPatientDialog
and searchDebounceMs wherever it is forwarded. Apply the corresponding changes
in app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js at lines
19-23 and app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js at
lines 18-21.
- Around line 4-10: Reorder imports in
app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js lines 4-10
and app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js lines
4-9 so Lodash imports precede local imports, with required blank-separated
groups; terminate the const editPatientDialog assignment at line 101 and const
addPatientDialog assignment at line 81 with semicolons.
- Around line 40-54: Memoize callback props with useCallback and complete
exhaustive-deps dependencies: update handleFormChange, handleClose, and
handleConfirm in
app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js#L40-L54;
replace the inline title-close and cancel callbacks at `#L63-L66` and `#L82-L85`
with named memoized handlers; and apply the same treatment to the named form,
close, and confirm handlers in
app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js#L35-L42.
🪄 Autofix

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 24b25fbf-b1d2-485a-bdcc-b4345aa720d3

📥 Commits

Reviewing files that changed from the base of the PR and between 06495c2 and 99783f4.

📒 Files selected for processing (3)
  • app/pages/clinicworkspace/ClinicPatients.js
  • app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js
  • app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js

Comment on lines +3036 to +3049
if (!showAddPatientDialog) return null;

<DialogContent>
<PatientForm api={api} trackMetric={trackMetric} onFormChange={handlePatientFormChange} searchDebounceMs={searchDebounceMs} action="create" />
</DialogContent>

<DialogActions>
<Button id="addPatientCancel" variant="secondary" onClick={handleCloseOverlays}>
{t('Cancel')}
</Button>
<Button
id="addPatientConfirm"
variant="primary"
onClick={handleAddPatientConfirm}
processing={creatingClinicCustodialAccount.inProgress}
disabled={!fieldsAreValid(keys(patientFormContext?.values), validationSchema({mrnSettings, existingMRNs}), patientFormContext?.values)}
>
{t('Add Patient')}
</Button>
</DialogActions>
</Dialog>
return (
<AddPatientDialog api={api} onClose={handleCloseOverlays} />
);
}, [
api,
creatingClinicCustodialAccount.inProgress,
handleAddPatientConfirm,
mrnSettings,
existingMRNs,
patientFormContext?.values,
showAddPatientDialog,
t,
trackMetric
]);
}, [api, showAddPatientDialog, handleCloseOverlays]);

const renderEditPatientDialog = useCallback(() => {
return (
<Dialog
id="editPatient"
aria-labelledby="dialog-title"
open={showEditPatientDialog}
onClose={handleCloseOverlays}
>
<DialogTitle onClose={() => {
trackMetric('Clinic - Edit patient close', { clinicId: selectedClinicId });
handleCloseOverlays()
}}>
<MediumTitle id="dialog-title">{t('Edit Patient Details')}</MediumTitle>
</DialogTitle>

<DialogContent>
<PatientForm
api={api}
trackMetric={trackMetric}
onFormChange={handlePatientFormChange}
patient={selectedPatient}
searchDebounceMs={searchDebounceMs}
action="edit"
/>
</DialogContent>

<DialogActions>
<Button id="editPatientCancel" variant="secondary" onClick={() => {
trackMetric('Clinic - Edit patient cancel', { clinicId: selectedClinicId, source: 'Patients list' });
handleCloseOverlays()
}}>
{t('Cancel')}
</Button>
if (!showEditPatientDialog || !selectedPatient) return null;

<Button
id="editPatientConfirm"
variant="primary"
onClick={handleEditPatientConfirm}
processing={updatingClinicPatient.inProgress}
disabled={!fieldsAreValid(keys(patientFormContext?.values), validationSchema({mrnSettings, existingMRNs}), patientFormContext?.values)}
>
{t('Save Changes')}
</Button>
</DialogActions>
</Dialog>
return (
<EditPatientDialog api={api} patient={selectedPatient} onClose={handleCloseOverlays} />
);
}, [
api,
handleEditPatientConfirm,
mrnSettings,
existingMRNs,
handleCloseOverlays,
patientFormContext,
searchDebounceMs,
selectedClinicId,
selectedPatient,
showEditPatientDialog,
t,
trackMetric,
updatingClinicPatient.inProgress
]);
}, [api, selectedPatient, handleCloseOverlays]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Forward searchDebounceMs through the extracted dialogs.

The inline dialogs forwarded searchDebounceMs to PatientForm, and PatientForm uses it to debounce MRN lookups. The extracted dialogs replace that input with fixed 1000, so a caller-provided non-default value has no effect. (raw.githubusercontent.com)

  • app/pages/clinicworkspace/ClinicPatients.js#L3036-L3049: Pass searchDebounceMs to both dialog components and add it to both useCallback dependency arrays.
  • app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js#L18-L21: Accept searchDebounceMs, with SEARCH_DEBOUNCE_MS as its default.
  • app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js#L60-L60: Pass the received value to PatientForm.
  • app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js#L19-L23: Accept searchDebounceMs, with SEARCH_DEBOUNCE_MS as its default.
  • app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js#L76-L76: Pass the received value to PatientForm.
Proposed fix
-<AddPatientDialog api={api} onClose={handleCloseOverlays} />
+<AddPatientDialog
+  api={api}
+  onClose={handleCloseOverlays}
+  searchDebounceMs={searchDebounceMs}
+/>

-<EditPatientDialog api={api} patient={selectedPatient} onClose={handleCloseOverlays} />
+<EditPatientDialog
+  api={api}
+  patient={selectedPatient}
+  onClose={handleCloseOverlays}
+  searchDebounceMs={searchDebounceMs}
+/>

 const AddPatientDialog = ({
   api,
   onClose = noop,
+  searchDebounceMs = SEARCH_DEBOUNCE_MS,
 }) => {
-  ...
-  searchDebounceMs={SEARCH_DEBOUNCE_MS}
+  ...
+  searchDebounceMs={searchDebounceMs}

 const EditPatientDialog = ({
   api,
   patient,
   onClose = noop,
+  searchDebounceMs = SEARCH_DEBOUNCE_MS,
 }) => {
-  ...
-  searchDebounceMs={SEARCH_DEBOUNCE_MS}
+  ...
+  searchDebounceMs={searchDebounceMs}
📍 Affects 3 files
  • app/pages/clinicworkspace/ClinicPatients.js#L3036-L3049 (this comment)
  • app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js#L18-L21
  • app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js#L60-L60
  • app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js#L19-L23
  • app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js#L76-L76
🤖 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 `@app/pages/clinicworkspace/ClinicPatients.js` around lines 3036 - 3049,
Forward searchDebounceMs through both extracted patient dialogs so
caller-provided values reach PatientForm instead of being replaced by the fixed
default. In app/pages/clinicworkspace/ClinicPatients.js:3036-3049, pass
searchDebounceMs to AddPatientDialog and EditPatientDialog and include it in
both useCallback dependency arrays. In
app/pages/clinicworkspace/clinicPatientsDialogs/addPatientDialog.js:18-21 and
:60, accept it with SEARCH_DEBOUNCE_MS as the default and pass it to
PatientForm. Apply the same changes in
app/pages/clinicworkspace/clinicPatientsDialogs/editPatientDialog.js:19-23 and
:76.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)
app/pages/clinicworkspace/ClinicPatients.js (1)

3043-3049: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Add showEditPatientDialog to the dependency array.

renderEditPatientDialog reads showEditPatientDialog, but the current dependency list omits it. Add it to avoid a stale condition and to keep react-hooks/exhaustive-deps satisfied.

🤖 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 `@app/pages/clinicworkspace/ClinicPatients.js` around lines 3043 - 3049, Add
showEditPatientDialog to the dependency array of renderEditPatientDialog,
preserving the existing callback logic and ensuring its visibility condition
updates with current state.

Source: Coding guidelines

🤖 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 `@app/pages/clinicworkspace/ClinicPatients.js`:
- Around line 123-124: Update the AddPatientDialog and EditPatientDialog imports
in ClinicPatients.js to match the tracked lowercase filenames
addPatientDialog.js and editPatientDialog.js, or consistently rename the files
and references so module resolution works on case-sensitive systems.

---

Outside diff comments:
In `@app/pages/clinicworkspace/ClinicPatients.js`:
- Around line 3043-3049: Add showEditPatientDialog to the dependency array of
renderEditPatientDialog, preserving the existing callback logic and ensuring its
visibility condition updates with current state.
🪄 Autofix

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 85d97839-5bed-4b8f-9e62-e06f21040a7e

📥 Commits

Reviewing files that changed from the base of the PR and between 99783f4 and 2c8194a.

📒 Files selected for processing (1)
  • app/pages/clinicworkspace/ClinicPatients.js

Comment thread app/pages/clinicworkspace/ClinicPatients.js

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
app/pages/clinicworkspace/clinicPatientsDialogs/AddPatientDialog.js (2)

1-15: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Group imports in the required order.

Keep React and Redux imports first. Keep third-party imports before Lodash imports. Move all local ../../../... imports to the final group.

  • app/pages/clinicworkspace/clinicPatientsDialogs/AddPatientDialog.js#L1-L15: move local imports after the Lodash group.
  • app/pages/clinicworkspace/clinicPatientsDialogs/EditPatientDialog.js#L1-L15: move local imports after the Lodash group.

As per coding guidelines, group imports in the required order with blank lines between groups.

🤖 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 `@app/pages/clinicworkspace/clinicPatientsDialogs/AddPatientDialog.js` around
lines 1 - 15, Reorder imports in AddPatientDialog.js and EditPatientDialog.js:
keep React/Redux imports first, third-party imports next, Lodash imports after
them, and all local ../../../ imports last, with blank lines separating each
group.

Source: Coding guidelines


18-83: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Complete the dialog component declarations.

Define PropTypes for every dialog prop. Terminate each component declaration with a semicolon.

  • app/pages/clinicworkspace/clinicPatientsDialogs/AddPatientDialog.js#L18-L83: define PropTypes for api and onClose, then add the final semicolon.
  • app/pages/clinicworkspace/clinicPatientsDialogs/EditPatientDialog.js#L19-L103: define PropTypes for api, patient, and onClose, then add the final semicolon.

As per coding guidelines, define PropTypes for all component props and use required semicolons.

🤖 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 `@app/pages/clinicworkspace/clinicPatientsDialogs/AddPatientDialog.js` around
lines 18 - 83, Complete the declarations for AddPatientDialog in
app/pages/clinicworkspace/clinicPatientsDialogs/AddPatientDialog.js (lines
18-83) and EditPatientDialog in
app/pages/clinicworkspace/clinicPatientsDialogs/EditPatientDialog.js (lines
19-103) by adding PropTypes for every listed prop: api and onClose for
AddPatientDialog, and api, patient, and onClose for EditPatientDialog. Terminate
both component declarations with semicolons.

Source: Coding guidelines

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

Nitpick comments:
In `@app/pages/clinicworkspace/clinicPatientsDialogs/AddPatientDialog.js`:
- Around line 1-15: Reorder imports in AddPatientDialog.js and
EditPatientDialog.js: keep React/Redux imports first, third-party imports next,
Lodash imports after them, and all local ../../../ imports last, with blank
lines separating each group.
- Around line 18-83: Complete the declarations for AddPatientDialog in
app/pages/clinicworkspace/clinicPatientsDialogs/AddPatientDialog.js (lines
18-83) and EditPatientDialog in
app/pages/clinicworkspace/clinicPatientsDialogs/EditPatientDialog.js (lines
19-103) by adding PropTypes for every listed prop: api and onClose for
AddPatientDialog, and api, patient, and onClose for EditPatientDialog. Terminate
both component declarations with semicolons.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 16e9de9d-08d7-49a7-887b-ed93c75fa75e

📥 Commits

Reviewing files that changed from the base of the PR and between 2c8194a and 8a83a08.

📒 Files selected for processing (4)
  • app/components/clinic/PatientForm/PatientForm.js
  • app/pages/clinicworkspace/ClinicPatients.js
  • app/pages/clinicworkspace/clinicPatientsDialogs/AddPatientDialog.js
  • app/pages/clinicworkspace/clinicPatientsDialogs/EditPatientDialog.js

const deletingClinicSite = useSelector((state) => state.blip.working.deletingClinicSite);
const deletingClinicPatientTag = useSelector((state) => state.blip.working.deletingClinicPatientTag);
const fetchingTideDashboardPatients = useSelector((state) => state.blip.working.fetchingTideDashboardPatients);
const fetchingRpmReportPatients = useSelector((state) => state.blip.working.fetchingRpmReportPatients);

@henry-tp henry-tp Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

By calling the non-specific useSelector(state => state.blip.working) which returns the entire working state, we cause the component to re-render every time any part of state.blip.working changes, regardless of whether it is a slice we are interested in. So we may reduce re-rendering by returning specific slices instead of state.blip.working as a whole. It may be marginally helpful.

@henry-tp
henry-tp requested a review from krystophv August 10, 2026 22:07
@henry-tp
henry-tp marked this pull request as draft August 12, 2026 20:56
@henry-tp
henry-tp marked this pull request as ready for review August 12, 2026 20:56
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.

1 participant