Skip to content

Conversation

@Jacobjeevan
Copy link
Contributor

@Jacobjeevan Jacobjeevan commented Dec 29, 2025

Proposed Changes

  • Fixes Breadcrumbs #14974
  • Requires additional testing, especially on mobile and other pages I might have missed

Figma

image

Implementation

image

Tagging: @ohcnetwork/care-fe-code-reviewers

Merge Checklist

  • Add specs that demonstrate the bug or test the new feature.
  • Update product documentation.
  • Ensure that UI text is placed in I18n files.
  • Prepare a screenshot or demo video for the changelog entry and attach it to the issue.
  • Request peer reviews.
  • Complete QA on mobile devices.
  • Complete QA on desktop devices.
  • Add or update Playwright tests for related changes

Summary by CodeRabbit

  • New Features
    • Added breadcrumb navigation to help users track location and navigate back.
    • Pages can opt to hide breadcrumbs when a simpler header is preferred.
  • Refactor
    • Major account page redesign: unified header, responsive action controls, tag management, multi-tab content, and an account closure workflow with balance checks.
  • Tests
    • Updated back-button tests to use text-based lookup.

✏️ Tip: You can customize this high-level summary in your review settings.

@Jacobjeevan Jacobjeevan requested review from a team and Copilot December 29, 2025 14:11
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 29, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds a new Breadcrumbs component that derives a navigable breadcrumb trail from the current URL and a hideBreadcrumbs?: boolean Page prop; many pages opt out of breadcrumbs. AccountShow receives a major header and action-area refactor. A test locator for the Back button was adjusted.

Changes

Cohort / File(s) Summary
Breadcrumbs component & Page API
src/components/Common/Breadcrumbs.tsx, src/components/Common/Page.tsx
New exported Breadcrumbs() implemented to build breadcrumbs from route segments (resource label mapping, UUID detection/formatting, skip segments, back control). PageProps now includes hideBreadcrumbs?: boolean; Page conditionally renders Breadcrumbs.
Pages updated to hide breadcrumbs
src/components/Facility/FacilityUsers.tsx, src/components/Patient/PatientHome.tsx, src/components/Resource/ResourceList.tsx, src/pages/Encounters/EncounterList.tsx, src/pages/Encounters/EncounterShow.tsx, src/pages/Facility/billing/account/AccountList.tsx, src/pages/Facility/billing/invoice/InvoiceList.tsx, src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx, src/pages/Facility/overview.tsx, src/pages/Facility/queues/QueuesIndex.tsx, src/pages/Facility/services/FacilityServices.tsx, src/pages/Appointments/AppointmentsPage.tsx, src/pages/Encounters/TemplateBuilder/TemplatePage.tsx, src/pages/Patient/History/index.tsx
Each file now passes hideBreadcrumbs to Page, suppressing breadcrumb rendering. No other data-flow or business-logic changes observed.
AccountShow — header & actions refactor
src/pages/Facility/billing/account/AccountShow.tsx
Major UI refactor: replaces prior back/header with Page wrapper, consolidates header actions (settle/close, create invoice, record payment, credit note), reintroduces NavTabs, adds TagAssignmentSheet, AccountSheet, PaymentReconciliationSheet, and a close-account dialog; restructures financial summary and responsive layout.
Tests — Back button locator change
tests/facility/components/backButton.spec.ts
Replaced role-based back-button lookup with text-based locator getByText("Back"); locator call patterns adjusted to use awaited element retrieval.

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Added breadcrumbs' directly and clearly summarizes the main change - a new breadcrumbs UI component has been added to the application.
Description check ✅ Passed The PR description includes the linked issue reference (#14974), notes on testing requirements, design references, and the merge checklist template; all critical sections are present despite most checklist items being unchecked.
Linked Issues check ✅ Passed The PR implements a breadcrumbs UI component as required by issue #14974, with the component added, breadcrumb visibility controlled across multiple pages, and back button logic included.
Out of Scope Changes check ✅ Passed All changes are directly related to breadcrumbs implementation: new Breadcrumbs component, hideBreadcrumbs prop integration across pages, test locator updates for back button, and no unrelated modifications detected.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ab0f8f3 and b6cfb4a.

📒 Files selected for processing (2)
  • src/components/Common/Breadcrumbs.tsx
  • tests/facility/components/backButton.spec.ts
🧰 Additional context used
📓 Path-based instructions (14)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Write concise, technical TypeScript code with accurate examples
Use TypeScript for all code; prefer interfaces over types
Avoid enums; use maps instead
Use TanStack Query for data fetching from the API along with query and mutate utilities for the queryFn and mutationFn
Use raviger for routing

**/*.{ts,tsx}: Use TypeScript with strict mode and ES2022 target
Use interface for defining object types in TypeScript
Avoid explicit any type in TypeScript
Use proper nullability annotations in TypeScript types
Use dedicated error handlers and TypeScript strict null checks

**/*.{ts,tsx}: Use TypeScript for all new code
Prefer interfaces over types for object definitions in TypeScript
Avoid using any type; use proper type definitions in TypeScript
Use type inference where possible in TypeScript
Use TanStack Query for API data management
Prefer React Context for global state management

**/*.{ts,tsx}: Use TanStack Query with the query and mutate utilities from @/Utils/request/
Use appropriate query keys following the resource pattern for TanStack Query
Leverage TanStack Query built-in features for pagination and debouncing
Implement proper error handling using the global error handler for TanStack Query operations
Use useQuery hook with queryKey and queryFn parameters, where queryFn wraps the API route with the query() utility
Use useMutation hook with mutationFn parameter wrapping API routes with the mutate() utility, and implement onSuccess callbacks to invalidate related queries
Support path parameters in TanStack Query using the pathParams option in query/mutate utilities
Support query parameters in TanStack Query using the queryParams option in query/mutate utilities
Use the silent: true option to suppress global error notifications when custom error handling is needed

**/*.{ts,tsx}: Use TypeScript with strict mode and ES2022 target
Use interface for defining object types
Avoid explicit any types and maint...

Files:

  • src/components/Common/Breadcrumbs.tsx
  • tests/facility/components/backButton.spec.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Use functional and declarative programming patterns; avoid classes
Prefer iteration and modularization over code duplication
Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Use the "function" keyword for pure functions
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements

**/*.{ts,tsx,js,jsx}: Use path aliases for imports from src (@/*)
Use double quotes for strings
Semicolons are required at end of statements
Order imports as: 3rd-party → library → CAREUI → UI → components → hooks → utils → relative
Use PascalCase for component and class names
Use camelCase for variable and function names

**/*.{ts,tsx,js,jsx}: Use path aliases @/* for imports from src directory
Use double quotes for strings
Require semicolons at end of statements
Order imports: 3rd-party → library → CAREUI → UI → components → hooks → utils → relative
Use PascalCase for component and class names
Use camelCase for variable and function names

Files:

  • src/components/Common/Breadcrumbs.tsx
  • tests/facility/components/backButton.spec.ts
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Use declarative JSX

Files:

  • src/components/Common/Breadcrumbs.tsx
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{ts,tsx}: Use strict TypeScript configuration for medical data safety in all TypeScript source files
All literal strings must use i18next for multi-language support in healthcare interfaces
Use comprehensive error boundaries and user-friendly error messages for medical workflow debugging without exposing PHI
Follow ESLint configured rules for React hooks, accessibility, and code quality
Use @tanstack/react-query for server state management in API client code
Localize date and time formats for medical timestamps using locale-aware formatting functions
Use date-fns for date handling and manipulation with locale awareness for medical timestamps

Files:

  • src/components/Common/Breadcrumbs.tsx
src/components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/components/**/*.{ts,tsx}: Implement WCAG 2.1 AA accessibility compliance in medical applications with screen reader compatibility and keyboard navigation
Include medical use cases, accessibility notes, and WCAG compliance documentation in component documentation
Follow established React component patterns and folder structure organized by feature and domain

src/components/**/*.{ts,tsx}: Use path aliases: @/components/, @/types/, @/lib/, @/pages/ for imports
Follow import order: External packages → @/components/ui/@/components/@/CAREUI/@/types/@/lib/ → relative imports
Use named exports from lucide-react for icons (e.g., import { SettingsIcon } from "lucide-react")
Import useTranslation from react-i18next for internationalization
Use React 19.1.1 hooks pattern - Functional components only
Always define TypeScript Props interfaces (e.g., PatientInfoCardProps) for component props
Use handle prefix for event handlers (e.g., handleSubmit, handleTagsUpdate, handlePatientSelect)
Use shadcn/ui components as primary UI system (Button, Card, Badge, etc.) from @/components/ui/
Use healthcare-specific CAREUI custom components (Calendar, WeekdayCheckbox, Zoom) from @/CAREUI/
Use buttonVariants from @/components/ui/button with CVA patterns for button styling
Follow <Card><CardHeader> pattern for consistent card layouts
Use PatientRead type from @/types/emr/patient/patient for patient data handling
Implement TagAssignmentSheet with TagEntityType for patient/facility tags
Use PatientHoverCard for patient info overlays
Use Badge components to display patient status, facility capacity, medication dosage with color variants
Use cva() from class variance authority for variant-based component styling
Use cn() from @/lib/utils for conditional class composition
Follow Tailwind CSS 4.1.3 color system: primary-700, gray-900, red-500 pattern with dark mode variants
Use Tailwind shadow system: shadow-sm, shadow-xs for el...

Files:

  • src/components/Common/Breadcrumbs.tsx
src/**/*.{ts,tsx,css}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Prettier for consistent code formatting across the healthcare application

Files:

  • src/components/Common/Breadcrumbs.tsx
src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{tsx,ts}: Use React 19.1.1 features and patterns following React 19 Documentation for healthcare application development
Use shadcn/ui as primary component system and CAREUI for healthcare-specific components
Use framer-motion for animations in healthcare UI interfaces

Files:

  • src/components/Common/Breadcrumbs.tsx
src/**/*.{tsx,css}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Tailwind CSS 4.1.3 utility classes with custom healthcare-specific design system for styling

Files:

  • src/components/Common/Breadcrumbs.tsx
**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Use 2-space indentation

Files:

  • src/components/Common/Breadcrumbs.tsx
  • tests/facility/components/backButton.spec.ts
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/02-coding-standards.mdc)

**/*.tsx: Use functional components with proper type definitions in React
One component per file is preferred
Prefer default exports for React components
Follow the component naming pattern: ComponentName.tsx for React components
Use Tailwind CSS for styling
Use Shadcn UI components when available
Use local state for component-specific data
Use PascalCase for component file names (e.g., AuthWizard.tsx)

Files:

  • src/components/Common/Breadcrumbs.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/04-ui-components.mdc)

**/*.{tsx,ts}: Use Shadcn UI components as the primary component library
Follow the component documentation for proper usage
Customize components using Tailwind CSS
Use navigate and useRedirect from raviger for navigation and redirects
Use Tailwind's responsive classes and follow mobile-first approach
Implement proper ARIA attributes for accessibility
Ensure keyboard navigation works in components
Define component props using TypeScript interfaces
Use translation keys from src/Locale/ for internationalization
Support RTL languages in components
Use proper date/time formatting for multiple language support

Files:

  • src/components/Common/Breadcrumbs.tsx
  • tests/facility/components/backButton.spec.ts
**/*.{ts,tsx,js,jsx,json,css,scss,html}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation

Files:

  • src/components/Common/Breadcrumbs.tsx
  • tests/facility/components/backButton.spec.ts
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/02-coding-standards.mdc)

Use camelCase for utility file names (e.g., useAuth.ts)

Files:

  • tests/facility/components/backButton.spec.ts
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/02-coding-standards.mdc)

**/*.spec.ts: Write E2E tests in Playwright following https://playwright.dev/docs/writing-tests
Write meaningful test descriptions

Files:

  • tests/facility/components/backButton.spec.ts
🧠 Learnings (53)
📓 Common learnings
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Provide skip links for screen readers in page components
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Handle navigation guards and authentication checks in page components
Learnt from: abhimanyurajeesh
Repo: ohcnetwork/care_fe PR: 14382
File: src/pages/Facility/billing/account/AccountShow.tsx:261-264
Timestamp: 2025-11-17T13:53:03.929Z
Learning: In the care_fe codebase, using BackButton component without an explicit `to` prop (relying on browser history navigation) is the expected and preferred behavior, as confirmed by abhimanyurajeesh.
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 12117
File: public/locale/en.json:2993-2996
Timestamp: 2025-05-21T06:00:57.699Z
Learning: Jacobjeevan prefers to keep i18n translation keys generic (without feature-specific prefixes) when possible to allow for reuse across different parts of the application.
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Use `i18next` for text translations in page components (existing dependency)

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:54:09.978Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursor/rules/02-coding-standards.mdc:0-0
Timestamp: 2025-11-25T13:54:09.978Z
Learning: Use kebab-case for directory names (e.g., `auth-wizard/`)

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2024-11-20T22:59:16.946Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9145
File: public/locale/en.json:772-772
Timestamp: 2024-11-20T22:59:16.946Z
Learning: The `validateName` function should accept names containing letters, spaces, hyphens, and apostrophes to support inclusive name validation.

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2024-11-05T16:59:23.732Z
Learnt from: AnveshNalimela
Repo: ohcnetwork/care_fe PR: 8930
File: cypress/pageobject/Users/UserCreation.ts:16-59
Timestamp: 2024-11-05T16:59:23.732Z
Learning: In the `cypress/pageobject/Users/UserCreation.ts` file, method parameter names may use a mix of `snake_case` and `camelCase` naming conventions, and this is acceptable in the codebase.

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2024-11-20T23:25:06.602Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9145
File: src/common/validation.tsx:41-41
Timestamp: 2024-11-20T23:25:06.602Z
Learning: When updating the name validation pattern in `src/common/validation.tsx`, avoid partial internationalization by not adding specific non-Latin Unicode ranges unless we're prepared to support all non-Latin scripts.

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-08-15T19:51:24.937Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 12882
File: public/locale/en.json:3356-3356
Timestamp: 2025-08-15T19:51:24.937Z
Learning: The redesigned clinical information components (AllergyTable, DiagnosisTable, SymptomTable) in care_fe use dynamic i18n lookups like `t(allergy.verification_status)`, `t(diagnosis.verification_status)`, and `t(symptom.verification_status)`. This means all possible verification status values (including "presumed", "confirmed", "unconfirmed", "refuted", "entered_in_error") need corresponding translation keys in the locale files, even if they're not directly referenced with explicit t() calls in the codebase.

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-02-04T07:18:45.806Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 10104
File: src/pages/FacilityOrganization/components/FacilityOrganizationSelector.tsx:118-118
Timestamp: 2025-02-04T07:18:45.806Z
Learning: The project uses flat translation keys in locale files (e.g., "select_department", "has_sub_departments") without nesting (e.g., "facility.organization.select_department").

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-05-21T06:00:57.699Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 12117
File: public/locale/en.json:2993-2996
Timestamp: 2025-05-21T06:00:57.699Z
Learning: Jacobjeevan prefers to keep i18n translation keys generic (without feature-specific prefixes) when possible to allow for reuse across different parts of the application.

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-05-02T22:40:04.938Z
Learnt from: gobardan1707
Repo: ohcnetwork/care_fe PR: 12190
File: src/components/ErrorPages/SessionExpired.tsx:0-0
Timestamp: 2025-05-02T22:40:04.938Z
Learning: In this project, the translation keys should be properly namespaced to avoid conflicts. Generic words like "in" and "out" should be avoided as translation keys. Instead, use namespaced keys like "SESSION_EXPIRED_BREATH_IN" and "SESSION_EXPIRED_BREATH_OUT".

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-03-03T05:00:04.480Z
Learnt from: rajku-dev
Repo: ohcnetwork/care_fe PR: 10904
File: src/pages/Encounters/AssociateDeviceSheet.tsx:71-77
Timestamp: 2025-03-03T05:00:04.480Z
Learning: In the device API, there's an inconsistency in parameter naming conventions. Older endpoints like `retrieve`, `list`, `create`, `update`, `delete`, `upsert`, and `associateLocation` use snake_case (`facility_id`), while newer endpoints like `associateEncounter` and `encounterHistory` use camelCase (`facilityId`). When calling these APIs, the parameter names must match the exact convention used in the API path definition.

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-10-07T08:56:41.983Z
Learnt from: yash-learner
Repo: ohcnetwork/care_fe PR: 13918
File: src/components/Common/RequirementsSelector.tsx:330-336
Timestamp: 2025-10-07T08:56:41.983Z
Learning: In src/components/Common/RequirementsSelector.tsx, when custom trigger components (like TriggerButton) are used with Radix UI primitives' asChild prop, they must use React.forwardRef and spread additional props to receive refs and event handlers. Without forwardRef, asChild will not work and the trigger will fail to open the drawer/sheet.

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:49:43.065Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T13:49:43.065Z
Learning: Applies to components/**/*.{ts,tsx} : Use Shadcn UI, Radix, and Tailwind for components and styling

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Applies to src/components/**/*.{ts,tsx} : Follow established React component patterns and folder structure organized by feature and domain

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:54:35.875Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursor/rules/04-ui-components.mdc:0-0
Timestamp: 2025-11-25T13:54:35.875Z
Learning: Applies to **/*.{tsx,ts} : Use `navigate` and `useRedirect` from raviger for navigation and redirects

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use path aliases: `@/components/`, `@/types/`, `@/lib/`, `@/pages/` for imports

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use shadcn/ui components as primary UI system (Button, Card, Badge, etc.) from `@/components/ui/`

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Use `raviger` router for navigation (existing dependency)

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use named exports from `lucide-react` for icons (e.g., `import { SettingsIcon } from "lucide-react"`)

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Use CAREUI imports for medical-specific functionality and shadcn/ui imports for standard UI components - CAREUI for medical interactions/workflows/data, shadcn/ui for buttons, forms, modals, tables, navigation

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : CAREUI components should integrate seamlessly with shadcn/ui components - Accept shadcn/ui components as children when appropriate, follow established patterns from shadcn/ui for props and styling, and support customization through standard React patterns

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:53:40.623Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/utils.instructions.md:0-0
Timestamp: 2025-11-25T13:53:40.623Z
Learning: Applies to src/Utils/**/*.{ts,tsx} : Implement memoization for expensive computations in utility functions

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Optimize CAREUI components for memory efficiency for long-running clinical applications

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Cache data appropriately in page components based on usage patterns

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Minimize unnecessary re-renders in page components

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:54:35.875Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursor/rules/04-ui-components.mdc:0-0
Timestamp: 2025-11-25T13:54:35.875Z
Learning: Applies to **/*.{tsx,ts} : Ensure keyboard navigation works in components

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Ensure keyboard navigation is supported for clinical workflows and emergency situations

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
  • tests/facility/components/backButton.spec.ts
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Ensure keyboard navigation works properly in page components

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
  • tests/facility/components/backButton.spec.ts
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Support full keyboard navigation for hands-free operation in clinical settings

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
  • tests/facility/components/backButton.spec.ts
📚 Learning: 2025-11-25T13:54:35.875Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursor/rules/04-ui-components.mdc:0-0
Timestamp: 2025-11-25T13:54:35.875Z
Learning: Applies to **/*.{tsx,ts} : Implement proper ARIA attributes for accessibility

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2024-11-26T09:46:12.574Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9196
File: src/components/Common/FilePreviewDialog.tsx:193-200
Timestamp: 2024-11-26T09:46:12.574Z
Learning: When adding navigation buttons, include aria labels and handle arrow keys (ArrowLeft and ArrowRight) in onKeyDown events to enhance accessibility.

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Applies to src/components/**/*.{ts,tsx} : Implement WCAG 2.1 AA accessibility compliance in medical applications with screen reader compatibility and keyboard navigation

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Use proper ARIA labels and roles in page components

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
  • tests/facility/components/backButton.spec.ts
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Provide skip links for screen readers in page components

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-17T13:53:03.929Z
Learnt from: abhimanyurajeesh
Repo: ohcnetwork/care_fe PR: 14382
File: src/pages/Facility/billing/account/AccountShow.tsx:261-264
Timestamp: 2025-11-17T13:53:03.929Z
Learning: In the care_fe codebase, using BackButton component without an explicit `to` prop (relying on browser history navigation) is the expected and preferred behavior, as confirmed by abhimanyurajeesh.

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
  • tests/facility/components/backButton.spec.ts
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Follow import order: External packages → `@/components/ui/` → `@/components/` → `@/CAREUI/` → `@/types/` → `@/lib/` → relative imports

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:54:43.264Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T13:54:43.264Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Order imports: 3rd-party → library → CAREUI → UI → components → hooks → utils → relative

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:53:57.496Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursor/rules/01-project-structure.mdc:0-0
Timestamp: 2025-11-25T13:53:57.496Z
Learning: Applies to src/components/**/*.{ts,tsx} : Reusable UI components should be organized in src/components/ directory

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:53:49.727Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T13:53:49.727Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Order imports as: 3rd-party → library → CAREUI → UI → components → hooks → utils → relative

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:49:43.065Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T13:49:43.065Z
Learning: Applies to components/** : Use lowercase with dashes for directories (e.g., components/auth-wizard)

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:53:49.727Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T13:53:49.727Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use camelCase for variable and function names

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-03-04T13:11:05.207Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 10940
File: src/components/Auth/Login.tsx:701-711
Timestamp: 2025-03-04T13:11:05.207Z
Learning: In the CARE frontend application, use the Button component with variant="link" for link-style action triggers rather than using <p> tags with onClick handlers or plain <button> elements, following the established pattern in the codebase.

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2024-12-12T19:27:20.394Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9327
File: src/components/Resource/ResourceDetails.tsx:88-94
Timestamp: 2024-12-12T19:27:20.394Z
Learning: Prefer using the primary `Button` component with the `variant="primary"` prop instead of `ButtonV2` for consistency across the application.

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2024-11-28T04:24:30.394Z
Learnt from: nithish1018
Repo: ohcnetwork/care_fe PR: 9157
File: src/components/Patient/UpdateStatusDialog.tsx:235-244
Timestamp: 2024-11-28T04:24:30.394Z
Learning: The existing `FileUpload` component does not implement keyboard accessibility enhancements like adding role attributes, tabIndex, or onKeyDown handlers to labels.

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Use raviger for application routing in page components and route definitions

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-12-17T19:47:58.152Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 14821
File: src/components/Location/LocationNavigation.tsx:161-163
Timestamp: 2025-12-17T19:47:58.152Z
Learning: To ensure the remove-unused-i18n.js cleanup script detects i18n keys, avoid wrapping keys inside a ternary expression passed directly to t(). Instead, call t() separately in each branch of a conditional, e.g. condition ? t("key1") : t("key2"), or compute the key in a variable before passing to t(). For LocationNavigation.tsx (and similar TSX files in the repo), prefer explicit separate i18n calls per branch or a shared precomputed key to guarantee all keys are statically detectable by the script.

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-12-22T10:16:36.690Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 14804
File: src/pages/Facility/services/pharmacy/DispensesView.tsx:117-135
Timestamp: 2025-12-22T10:16:36.690Z
Learning: In the care_fe repository, prefer the native HTML title attribute for simple tooltips over using shadcn/ui Tooltip components. Use Tooltip components only when the tooltip requires richer content, interactivity, or accessibility enhancements that cannot be achieved with a plain title. For simple cases, add a title attribute to the element (e.g., <span title="...">). If a Tooltip is used, ensure it is accessible and necessary, and avoid duplicating content available in the title attribute.

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2024-12-05T04:20:20.231Z
Learnt from: nihal467
Repo: ohcnetwork/care_fe PR: 9301
File: cypress/e2e/facility_spec/FacilityLocation.cy.ts:220-220
Timestamp: 2024-12-05T04:20:20.231Z
Learning: In `FacilityLocation.cy.ts`, ensure not to suggest adding success message verifications if they are already present in the test steps.

Applied to files:

  • tests/facility/components/backButton.spec.ts
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{test,spec}.{ts,tsx} : Implement comprehensive testing in CAREUI components including accessibility and medical workflow scenarios

Applied to files:

  • tests/facility/components/backButton.spec.ts
📚 Learning: 2024-11-18T10:46:56.270Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9145
File: cypress/e2e/facility_spec/FacilityHomepage.cy.ts:229-317
Timestamp: 2024-11-18T10:46:56.270Z
Learning: In `cypress/e2e/facility_spec/FacilityHomepage.cy.ts`, when verifying the bed capacity badge reflection, the badge remains the same during multiple actions and only updates after a bed is attached to a patient during consultation. Therefore, it's appropriate to keep the test case consolidated rather than splitting it into smaller tests.

Applied to files:

  • tests/facility/components/backButton.spec.ts
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Add appropriate `data-cy` attributes for E2E tests to page components

Applied to files:

  • tests/facility/components/backButton.spec.ts
📚 Learning: 2024-11-14T08:09:58.453Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9080
File: cypress/pageobject/Users/ManageUserPage.ts:67-97
Timestamp: 2024-11-14T08:09:58.453Z
Learning: In Cypress test files (`cypress/pageobject/Users/ManageUserPage.ts`), when methods are called to check input provided earlier in the test, adding TypeScript interfaces, input validation, and custom error messages is unnecessary.

Applied to files:

  • tests/facility/components/backButton.spec.ts
📚 Learning: 2024-12-15T17:02:16.697Z
Learnt from: nihal467
Repo: ohcnetwork/care_fe PR: 9436
File: cypress/pageobject/Facility/FacilityHome.ts:12-12
Timestamp: 2024-12-15T17:02:16.697Z
Learning: In this codebase, `cy.awaitUrl()` is a custom Cypress command that includes `cy.visit()` and performs navigation.

Applied to files:

  • tests/facility/components/backButton.spec.ts
🧬 Code graph analysis (1)
src/components/Common/Breadcrumbs.tsx (3)
src/hooks/useAppHistory.ts (1)
  • useAppHistory (9-35)
src/components/ui/separator.tsx (1)
  • Separator (27-27)
src/components/ui/breadcrumb.tsx (5)
  • Breadcrumb (107-107)
  • BreadcrumbList (111-111)
  • BreadcrumbItem (109-109)
  • BreadcrumbLink (110-110)
  • BreadcrumbSeparator (113-113)
🪛 Biome (2.1.2)
src/components/Common/Breadcrumbs.tsx

[error] 145-148: Static Elements should not be interactive.

To add interactivity such as a mouse or key event listener to a static element, give the element an appropriate role value.

(lint/a11y/noStaticElementInteractions)


[error] 145-148: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.

Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.

(lint/a11y/useKeyWithClickEvents)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build
  • GitHub Check: Test
  • GitHub Check: CodeQL-Build
🔇 Additional comments (1)
tests/facility/components/backButton.spec.ts (1)

42-43: Update test locators after fixing the back button accessibility issue.

The change from getByRole("link") to getByText("Back") correctly reflects the current implementation (a <span> with onClick). However, once the accessibility issue in Breadcrumbs.tsx is fixed by converting the span to a <button> element, this test should be updated to use semantic role-based locators:

const backButton = page.getByRole("button", { name: /back/i });

This provides better test semantics and aligns with accessibility best practices.

Also applies to: 53-54


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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a breadcrumb navigation system to improve user navigation across the application. The implementation adds a new Breadcrumbs component that displays the navigation path and a back button, with the ability to hide breadcrumbs on specific pages where they are not needed.

Key Changes:

  • Added new Breadcrumbs component with intelligent path parsing and UUID handling
  • Integrated breadcrumbs into the Page component with a hideBreadcrumbs prop
  • Updated multiple pages to hide breadcrumbs where custom navigation is already present

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/components/Common/Breadcrumbs.tsx New component implementing breadcrumb navigation with path parsing, resource identification, and UUID formatting
src/components/Common/Page.tsx Added breadcrumb integration with conditional rendering via hideBreadcrumbs prop
src/pages/Facility/overview.tsx Hidden breadcrumbs on facility overview page
src/pages/Facility/services/FacilityServices.tsx Hidden breadcrumbs on services page
src/pages/Facility/queues/QueuesIndex.tsx Hidden breadcrumbs on queues page
src/pages/Facility/billing/account/AccountShow.tsx Wrapped component in Page with hidden breadcrumbs, replaced BackButton with Page-level navigation
src/pages/Facility/billing/account/AccountList.tsx Hidden breadcrumbs on account list
src/pages/Facility/billing/invoice/InvoiceList.tsx Hidden breadcrumbs on invoice list
src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx Hidden breadcrumbs on payment reconciliation list
src/pages/Encounters/EncounterShow.tsx Hidden breadcrumbs on encounter detail page
src/pages/Encounters/EncounterList.tsx Hidden breadcrumbs on encounter list
src/components/Resource/ResourceList.tsx Hidden breadcrumbs on resource list
src/components/Patient/PatientHome.tsx Hidden breadcrumbs on patient home
src/components/Facility/FacilityUsers.tsx Hidden breadcrumbs on facility users page

Comment on lines +48 to +55
function isResourceName(segment: string): boolean {
// Check if it's a known resource or follows kebab-case pattern
return (
/^[a-z_]+$/.test(segment) &&
!isUuid(segment) &&
Object.keys(RESOURCE_LABELS).includes(segment)
);
}
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

The function comment mentions 'follows kebab-case pattern' but the regex /^[a-z_]+$/ only matches snake_case (underscores), not kebab-case (hyphens). Either update the regex to /^[a-z-]+$/ to match kebab-case, or update the comment to say 'snake_case pattern'.

Copilot uses AI. Check for mistakes.
if (isResourceName(segment)) {
const currentPath = `/${segments.slice(0, i + 1).join("/")}`;
breadcrumbs.push({
label: RESOURCE_LABELS[segment],
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

Missing fallback for when RESOURCE_LABELS[segment] is undefined. Unlike lines 82, 84, and 95 which provide fallbacks like segment.replace(/_/g, ' '), this line will set label to undefined if the segment is not in RESOURCE_LABELS, potentially causing display issues.

Suggested change
label: RESOURCE_LABELS[segment],
label: RESOURCE_LABELS[segment] || segment.replace(/_/g, " "),

Copilot uses AI. Check for mistakes.
Comment on lines 21 to 32
const RESOURCE_LABELS: Record<string, string> = {
account: "account",
invoices: "invoices",
patient: "patient",
encounter: "encounter",
locations: "location",
services: "service",
settings: "settings",
users: "users",
patients: "patients",
encounters: "encounters",
};
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

Several resource labels are identical to their keys (account, invoices, patient, encounter, settings, users, patients, encounters). Consider whether these need to be explicitly mapped or if a fallback transformation would suffice for most cases, reducing maintenance burden.

Copilot uses AI. Check for mistakes.
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: 5

Caution

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

⚠️ Outside diff range comments (1)
src/pages/Facility/billing/account/AccountShow.tsx (1)

684-692: Variable name isNegative is misleading.

The condition balance > 0 checks for a positive outstanding balance, but the variable is named isNegative. Consider renaming to hasOutstandingBalance for clarity.

🔎 Proposed fix
 const ClosedCallout = ({ balance }: { balance: number }) => {
   const { t } = useTranslation();
-  const isNegative = balance > 0;
-  if (!isNegative) return <></>;
+  const hasOutstandingBalance = balance > 0;
+  if (!hasOutstandingBalance) return <></>;
   return (
📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe0c54a and dc5e4db.

📒 Files selected for processing (14)
  • src/components/Common/Breadcrumbs.tsx
  • src/components/Common/Page.tsx
  • src/components/Facility/FacilityUsers.tsx
  • src/components/Patient/PatientHome.tsx
  • src/components/Resource/ResourceList.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Facility/queues/QueuesIndex.tsx
  • src/pages/Facility/services/FacilityServices.tsx
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Write concise, technical TypeScript code with accurate examples
Use TypeScript for all code; prefer interfaces over types
Avoid enums; use maps instead
Use TanStack Query for data fetching from the API along with query and mutate utilities for the queryFn and mutationFn
Use raviger for routing

**/*.{ts,tsx}: Use TypeScript with strict mode and ES2022 target
Use interface for defining object types in TypeScript
Avoid explicit any type in TypeScript
Use proper nullability annotations in TypeScript types
Use dedicated error handlers and TypeScript strict null checks

**/*.{ts,tsx}: Use TypeScript for all new code
Prefer interfaces over types for object definitions in TypeScript
Avoid using any type; use proper type definitions in TypeScript
Use type inference where possible in TypeScript
Use TanStack Query for API data management
Prefer React Context for global state management

**/*.{ts,tsx}: Use TanStack Query with the query and mutate utilities from @/Utils/request/
Use appropriate query keys following the resource pattern for TanStack Query
Leverage TanStack Query built-in features for pagination and debouncing
Implement proper error handling using the global error handler for TanStack Query operations
Use useQuery hook with queryKey and queryFn parameters, where queryFn wraps the API route with the query() utility
Use useMutation hook with mutationFn parameter wrapping API routes with the mutate() utility, and implement onSuccess callbacks to invalidate related queries
Support path parameters in TanStack Query using the pathParams option in query/mutate utilities
Support query parameters in TanStack Query using the queryParams option in query/mutate utilities
Use the silent: true option to suppress global error notifications when custom error handling is needed

**/*.{ts,tsx}: Use TypeScript with strict mode and ES2022 target
Use interface for defining object types
Avoid explicit any types and maint...

Files:

  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Facility/queues/QueuesIndex.tsx
  • src/components/Common/Page.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/components/Common/Breadcrumbs.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
  • src/components/Resource/ResourceList.tsx
  • src/components/Patient/PatientHome.tsx
  • src/components/Facility/FacilityUsers.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Use functional and declarative programming patterns; avoid classes
Prefer iteration and modularization over code duplication
Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Use the "function" keyword for pure functions
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements

**/*.{ts,tsx,js,jsx}: Use path aliases for imports from src (@/*)
Use double quotes for strings
Semicolons are required at end of statements
Order imports as: 3rd-party → library → CAREUI → UI → components → hooks → utils → relative
Use PascalCase for component and class names
Use camelCase for variable and function names

**/*.{ts,tsx,js,jsx}: Use path aliases @/* for imports from src directory
Use double quotes for strings
Require semicolons at end of statements
Order imports: 3rd-party → library → CAREUI → UI → components → hooks → utils → relative
Use PascalCase for component and class names
Use camelCase for variable and function names

Files:

  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Facility/queues/QueuesIndex.tsx
  • src/components/Common/Page.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/components/Common/Breadcrumbs.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
  • src/components/Resource/ResourceList.tsx
  • src/components/Patient/PatientHome.tsx
  • src/components/Facility/FacilityUsers.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Use declarative JSX

Files:

  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Facility/queues/QueuesIndex.tsx
  • src/components/Common/Page.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/components/Common/Breadcrumbs.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
  • src/components/Resource/ResourceList.tsx
  • src/components/Patient/PatientHome.tsx
  • src/components/Facility/FacilityUsers.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{ts,tsx}: Use strict TypeScript configuration for medical data safety in all TypeScript source files
All literal strings must use i18next for multi-language support in healthcare interfaces
Use comprehensive error boundaries and user-friendly error messages for medical workflow debugging without exposing PHI
Follow ESLint configured rules for React hooks, accessibility, and code quality
Use @tanstack/react-query for server state management in API client code
Localize date and time formats for medical timestamps using locale-aware formatting functions
Use date-fns for date handling and manipulation with locale awareness for medical timestamps

Files:

  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Facility/queues/QueuesIndex.tsx
  • src/components/Common/Page.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/components/Common/Breadcrumbs.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
  • src/components/Resource/ResourceList.tsx
  • src/components/Patient/PatientHome.tsx
  • src/components/Facility/FacilityUsers.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
src/**/*.{ts,tsx,css}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Prettier for consistent code formatting across the healthcare application

Files:

  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Facility/queues/QueuesIndex.tsx
  • src/components/Common/Page.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/components/Common/Breadcrumbs.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
  • src/components/Resource/ResourceList.tsx
  • src/components/Patient/PatientHome.tsx
  • src/components/Facility/FacilityUsers.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
src/pages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use raviger for application routing in page components and route definitions

src/pages/**/*.{ts,tsx}: Keep page components in src/pages/ organized by feature
Use descriptive file names that reflect the page purpose
Export page components as default exports
Co-locate page-specific components and utilities with page components
Use raviger router for navigation (existing dependency)
Implement proper route parameters and query string handling
Handle navigation guards and authentication checks in page components
Implement proper loading states and error boundaries in page components
Use semantic HTML structure for accessibility in page components
Use @tanstack/react-query for API state management in page components (existing dependency)
Implement proper loading, error, and success states for data fetching
Handle pagination and infinite scroll patterns appropriately
Cache data appropriately in page components based on usage patterns
Use controlled components for form inputs in page components
Implement proper form validation with zod schemas in page components
Handle form submission states (loading, success, error) in page components
Use React hooks for local page state
Minimize unnecessary re-renders in page components
Implement proper authentication checks in page components
Handle different user roles and permissions in page components
Redirect to login when authentication is required in page components
Show appropriate UI based on user permissions in page components
Set appropriate page titles and meta descriptions in page components
Handle OpenGraph and Twitter card meta tags in page components
Implement structured data where applicable in page components
Implement code splitting for large page components
Use lazy loading for heavy components within page components
Optimize bundle size with proper imports in page components
Handle image optimization and lazy loading in page components
Implement comprehensive error boundaries in page components
Handle API e...

Files:

  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Facility/queues/QueuesIndex.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{tsx,ts}: Use React 19.1.1 features and patterns following React 19 Documentation for healthcare application development
Use shadcn/ui as primary component system and CAREUI for healthcare-specific components
Use framer-motion for animations in healthcare UI interfaces

Files:

  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Facility/queues/QueuesIndex.tsx
  • src/components/Common/Page.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/components/Common/Breadcrumbs.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
  • src/components/Resource/ResourceList.tsx
  • src/components/Patient/PatientHome.tsx
  • src/components/Facility/FacilityUsers.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
src/**/*.{tsx,css}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Tailwind CSS 4.1.3 utility classes with custom healthcare-specific design system for styling

Files:

  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Facility/queues/QueuesIndex.tsx
  • src/components/Common/Page.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/components/Common/Breadcrumbs.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
  • src/components/Resource/ResourceList.tsx
  • src/components/Patient/PatientHome.tsx
  • src/components/Facility/FacilityUsers.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Use 2-space indentation

Files:

  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Facility/queues/QueuesIndex.tsx
  • src/components/Common/Page.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/components/Common/Breadcrumbs.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
  • src/components/Resource/ResourceList.tsx
  • src/components/Patient/PatientHome.tsx
  • src/components/Facility/FacilityUsers.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/02-coding-standards.mdc)

**/*.tsx: Use functional components with proper type definitions in React
One component per file is preferred
Prefer default exports for React components
Follow the component naming pattern: ComponentName.tsx for React components
Use Tailwind CSS for styling
Use Shadcn UI components when available
Use local state for component-specific data
Use PascalCase for component file names (e.g., AuthWizard.tsx)

Files:

  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Facility/queues/QueuesIndex.tsx
  • src/components/Common/Page.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/components/Common/Breadcrumbs.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
  • src/components/Resource/ResourceList.tsx
  • src/components/Patient/PatientHome.tsx
  • src/components/Facility/FacilityUsers.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/04-ui-components.mdc)

**/*.{tsx,ts}: Use Shadcn UI components as the primary component library
Follow the component documentation for proper usage
Customize components using Tailwind CSS
Use navigate and useRedirect from raviger for navigation and redirects
Use Tailwind's responsive classes and follow mobile-first approach
Implement proper ARIA attributes for accessibility
Ensure keyboard navigation works in components
Define component props using TypeScript interfaces
Use translation keys from src/Locale/ for internationalization
Support RTL languages in components
Use proper date/time formatting for multiple language support

Files:

  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Facility/queues/QueuesIndex.tsx
  • src/components/Common/Page.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/components/Common/Breadcrumbs.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
  • src/components/Resource/ResourceList.tsx
  • src/components/Patient/PatientHome.tsx
  • src/components/Facility/FacilityUsers.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
**/*.{ts,tsx,js,jsx,json,css,scss,html}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation

Files:

  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Facility/queues/QueuesIndex.tsx
  • src/components/Common/Page.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/components/Common/Breadcrumbs.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
  • src/components/Resource/ResourceList.tsx
  • src/components/Patient/PatientHome.tsx
  • src/components/Facility/FacilityUsers.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
src/components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/components/**/*.{ts,tsx}: Implement WCAG 2.1 AA accessibility compliance in medical applications with screen reader compatibility and keyboard navigation
Include medical use cases, accessibility notes, and WCAG compliance documentation in component documentation
Follow established React component patterns and folder structure organized by feature and domain

src/components/**/*.{ts,tsx}: Use path aliases: @/components/, @/types/, @/lib/, @/pages/ for imports
Follow import order: External packages → @/components/ui/@/components/@/CAREUI/@/types/@/lib/ → relative imports
Use named exports from lucide-react for icons (e.g., import { SettingsIcon } from "lucide-react")
Import useTranslation from react-i18next for internationalization
Use React 19.1.1 hooks pattern - Functional components only
Always define TypeScript Props interfaces (e.g., PatientInfoCardProps) for component props
Use handle prefix for event handlers (e.g., handleSubmit, handleTagsUpdate, handlePatientSelect)
Use shadcn/ui components as primary UI system (Button, Card, Badge, etc.) from @/components/ui/
Use healthcare-specific CAREUI custom components (Calendar, WeekdayCheckbox, Zoom) from @/CAREUI/
Use buttonVariants from @/components/ui/button with CVA patterns for button styling
Follow <Card><CardHeader> pattern for consistent card layouts
Use PatientRead type from @/types/emr/patient/patient for patient data handling
Implement TagAssignmentSheet with TagEntityType for patient/facility tags
Use PatientHoverCard for patient info overlays
Use Badge components to display patient status, facility capacity, medication dosage with color variants
Use cva() from class variance authority for variant-based component styling
Use cn() from @/lib/utils for conditional class composition
Follow Tailwind CSS 4.1.3 color system: primary-700, gray-900, red-500 pattern with dark mode variants
Use Tailwind shadow system: shadow-sm, shadow-xs for el...

Files:

  • src/components/Common/Page.tsx
  • src/components/Common/Breadcrumbs.tsx
  • src/components/Resource/ResourceList.tsx
  • src/components/Patient/PatientHome.tsx
  • src/components/Facility/FacilityUsers.tsx
🧠 Learnings (56)
📓 Common learnings
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Page component architecture and routing patterns must follow pages.instructions.md
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 12117
File: public/locale/en.json:2993-2996
Timestamp: 2025-05-21T06:00:57.699Z
Learning: Jacobjeevan prefers to keep i18n translation keys generic (without feature-specific prefixes) when possible to allow for reuse across different parts of the application.
📚 Learning: 2025-08-10T10:20:32.921Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 13316
File: src/pages/Facility/settings/productKnowledge/ProductKnowledgeView.tsx:63-65
Timestamp: 2025-08-10T10:20:32.921Z
Learning: In the ProductKnowledgeView component at src/pages/Facility/settings/productKnowledge/ProductKnowledgeView.tsx, the loading state should return only the Loading component without wrapping it in a Page shell. This is the expected behavior to provide a cleaner loading experience without maintaining the page layout during data fetching.

Applied to files:

  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
  • src/components/Facility/FacilityUsers.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Show appropriate UI based on user permissions in page components

Applied to files:

  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/overview.tsx
  • src/components/Common/Page.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/components/Facility/FacilityUsers.tsx
📚 Learning: 2025-11-25T13:51:23.408Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/context.instructions.md:0-0
Timestamp: 2025-11-25T13:51:23.408Z
Learning: Applies to src/context/**/AuditContext.tsx : Implement Audit Context for HIPAA compliance and data access logging

Applied to files:

  • src/pages/Facility/billing/account/AccountList.tsx
📚 Learning: 2025-12-17T19:47:58.152Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 14821
File: src/components/Location/LocationNavigation.tsx:161-163
Timestamp: 2025-12-17T19:47:58.152Z
Learning: To ensure the remove-unused-i18n.js cleanup script detects i18n keys, avoid wrapping keys inside a ternary expression passed directly to t(). Instead, call t() separately in each branch of a conditional, e.g. condition ? t("key1") : t("key2"), or compute the key in a variable before passing to t(). For LocationNavigation.tsx (and similar TSX files in the repo), prefer explicit separate i18n calls per branch or a shared precomputed key to guarantee all keys are statically detectable by the script.

Applied to files:

  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Facility/queues/QueuesIndex.tsx
  • src/components/Common/Page.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/components/Common/Breadcrumbs.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
  • src/components/Resource/ResourceList.tsx
  • src/components/Patient/PatientHome.tsx
  • src/components/Facility/FacilityUsers.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-12-22T10:16:36.690Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 14804
File: src/pages/Facility/services/pharmacy/DispensesView.tsx:117-135
Timestamp: 2025-12-22T10:16:36.690Z
Learning: In the care_fe repository, prefer the native HTML title attribute for simple tooltips over using shadcn/ui Tooltip components. Use Tooltip components only when the tooltip requires richer content, interactivity, or accessibility enhancements that cannot be achieved with a plain title. For simple cases, add a title attribute to the element (e.g., <span title="...">). If a Tooltip is used, ensure it is accessible and necessary, and avoid duplicating content available in the title attribute.

Applied to files:

  • src/pages/Facility/billing/account/AccountList.tsx
  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Facility/queues/QueuesIndex.tsx
  • src/components/Common/Page.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/components/Common/Breadcrumbs.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
  • src/components/Resource/ResourceList.tsx
  • src/components/Patient/PatientHome.tsx
  • src/components/Facility/FacilityUsers.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Handle patient data with appropriate privacy considerations in healthcare page components

Applied to files:

  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/components/Patient/PatientHome.tsx
  • src/components/Facility/FacilityUsers.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-11-25T13:51:23.408Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/context.instructions.md:0-0
Timestamp: 2025-11-25T13:51:23.408Z
Learning: Applies to src/context/**/FacilityContext.tsx : Implement Facility Context for department location and resource availability

Applied to files:

  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/components/Facility/FacilityUsers.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Set appropriate page titles and meta descriptions in page components

Applied to files:

  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/components/Common/Page.tsx
  • src/pages/Encounters/EncounterShow.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Integrate CAREUI components cleanly with healthcare data sources and support live data updates for critical medical information

Applied to files:

  • src/pages/Facility/services/FacilityServices.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Handle emergency and critical care scenarios appropriately in healthcare page components

Applied to files:

  • src/pages/Facility/services/FacilityServices.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Implement proper data validation for medical information in page components

Applied to files:

  • src/pages/Facility/services/FacilityServices.tsx
  • src/components/Patient/PatientHome.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Maintain proper heading hierarchy for screen reader support in medical records display

Applied to files:

  • src/pages/Facility/services/FacilityServices.tsx
  • src/components/Patient/PatientHome.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Optimize CAREUI components for memory efficiency for long-running clinical applications

Applied to files:

  • src/pages/Facility/services/FacilityServices.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Optimize bundle size with proper imports in page components

Applied to files:

  • src/pages/Facility/services/FacilityServices.tsx
  • src/pages/Facility/overview.tsx
  • src/components/Common/Page.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Keep page components in `src/pages/` organized by feature

Applied to files:

  • src/pages/Facility/overview.tsx
  • src/components/Facility/FacilityUsers.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Co-locate page-specific components and utilities with page components

Applied to files:

  • src/pages/Facility/overview.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Minimize unnecessary re-renders in page components

Applied to files:

  • src/pages/Facility/overview.tsx
  • src/components/Common/Page.tsx
  • src/pages/Encounters/EncounterShow.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Export page components as default exports

Applied to files:

  • src/pages/Facility/overview.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Use `tanstack/react-query` for API state management in page components (existing dependency)

Applied to files:

  • src/pages/Facility/queues/QueuesIndex.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Provide skip links for screen readers in page components

Applied to files:

  • src/components/Common/Page.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/components/Common/Breadcrumbs.tsx
  • src/pages/Encounters/EncounterList.tsx
  • src/components/Resource/ResourceList.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Implement code splitting for large page components

Applied to files:

  • src/components/Common/Page.tsx
  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Handle pagination and infinite scroll patterns appropriately

Applied to files:

  • src/components/Common/Page.tsx
  • src/pages/Facility/billing/invoice/InvoiceList.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Implement structured data where applicable in page components

Applied to files:

  • src/components/Common/Page.tsx
  • src/pages/Encounters/EncounterShow.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Implement proper loading states and error boundaries in page components

Applied to files:

  • src/components/Common/Page.tsx
  • src/pages/Encounters/EncounterShow.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Ensure keyboard navigation works properly in page components

Applied to files:

  • src/components/Common/Page.tsx
📚 Learning: 2025-11-25T13:51:23.408Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/context.instructions.md:0-0
Timestamp: 2025-11-25T13:51:23.408Z
Learning: Applies to src/context/**/ShortcutContext.tsx : Implement ShortcutContext with medical workflow keyboard shortcuts for rapid clinical actions and emergency protocol shortcuts for rapid response scenarios, including accessibility shortcuts for clinical environments

Applied to files:

  • src/components/Common/Page.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use `cn()` from `@/lib/utils` for conditional class composition

Applied to files:

  • src/components/Common/Page.tsx
📚 Learning: 2025-11-25T13:54:35.875Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursor/rules/04-ui-components.mdc:0-0
Timestamp: 2025-11-25T13:54:35.875Z
Learning: Applies to **/*.{tsx,ts} : Use `navigate` and `useRedirect` from raviger for navigation and redirects

Applied to files:

  • src/components/Common/Page.tsx
  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:54:35.875Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursor/rules/04-ui-components.mdc:0-0
Timestamp: 2025-11-25T13:54:35.875Z
Learning: Applies to **/*.{tsx,ts} : Use Shadcn UI components as the primary component library

Applied to files:

  • src/components/Common/Page.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Import `useTranslation` from `react-i18next` for internationalization

Applied to files:

  • src/components/Common/Page.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Use raviger for application routing in page components and route definitions

Applied to files:

  • src/components/Common/Page.tsx
  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Use `raviger` router for navigation (existing dependency)

Applied to files:

  • src/components/Common/Page.tsx
  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Implement proper authentication checks in page components

Applied to files:

  • src/pages/Encounters/EncounterShow.tsx
  • src/components/Facility/FacilityUsers.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Use semantic HTML structure for accessibility in page components

Applied to files:

  • src/pages/Encounters/EncounterShow.tsx
  • src/pages/Encounters/EncounterList.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Handle navigation guards and authentication checks in page components

Applied to files:

  • src/pages/Encounters/EncounterShow.tsx
📚 Learning: 2025-11-25T13:51:23.408Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/context.instructions.md:0-0
Timestamp: 2025-11-25T13:51:23.408Z
Learning: Applies to src/context/**/*.{ts,tsx} : Maintain audit trails for HIPAA compliance in context implementations

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Use `i18next` for text translations in page components (existing dependency)

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:52:33.081Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/providers.instructions.md:0-0
Timestamp: 2025-11-25T13:52:33.081Z
Learning: Applies to src/Providers/**/*HistoryAPIProvider*{.ts,.tsx} : HistoryAPIProvider should manage navigation history for clinical workflows

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
  • src/components/Patient/PatientHome.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Applies to src/components/**/*.{ts,tsx} : Follow established React component patterns and folder structure organized by feature and domain

Applied to files:

  • src/components/Common/Breadcrumbs.tsx
📚 Learning: 2025-11-25T13:54:35.875Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursor/rules/04-ui-components.mdc:0-0
Timestamp: 2025-11-25T13:54:35.875Z
Learning: Applies to src/Routers/**/*.{tsx,ts} : Conditionally render sidebar based on `PATHS_WITHOUT_SIDEBAR` array to exclude specific routes from displaying sidebar

Applied to files:

  • src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx
📚 Learning: 2024-11-13T12:33:52.373Z
Learnt from: AnveshNalimela
Repo: ohcnetwork/care_fe PR: 9096
File: src/components/Resource/ResourceList.tsx:245-245
Timestamp: 2024-11-13T12:33:52.373Z
Learning: When displaying the resource status in `ResourceList.tsx`, use `{t("consent__status")}` instead of adding a new translation key `{t("resource_status")}`.

Applied to files:

  • src/components/Resource/ResourceList.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use `PatientHoverCard` for patient info overlays

Applied to files:

  • src/components/Patient/PatientHome.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-11-25T13:51:23.408Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/context.instructions.md:0-0
Timestamp: 2025-11-25T13:51:23.408Z
Learning: Applies to src/context/**/PatientContext.tsx : Implement Patient Context for current patient selection and medical alerts

Applied to files:

  • src/components/Patient/PatientHome.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use `PatientRead` type from `@/types/emr/patient/patient` for patient data handling

Applied to files:

  • src/components/Patient/PatientHome.tsx
📚 Learning: 2025-11-25T13:52:33.081Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/providers.instructions.md:0-0
Timestamp: 2025-11-25T13:52:33.081Z
Learning: Applies to src/Providers/**/*PatientUserProvider*{.ts,.tsx} : PatientUserProvider should handle patient authentication for public appointment booking

Applied to files:

  • src/components/Patient/PatientHome.tsx
📚 Learning: 2024-12-02T18:50:29.685Z
Learnt from: kihan2518B
Repo: ohcnetwork/care_fe PR: 8956
File: src/components/Patient/PatientRegister.tsx:861-861
Timestamp: 2024-12-02T18:50:29.685Z
Learning: In `src/components/Patient/PatientRegister.tsx`, `insuranceDetails` is not part of `state.form`, so changes to it are not tracked by the `isDirty` state. Therefore, the form's `disabled` state needs to be conditionally set based on `insuranceDetails.length`.

Applied to files:

  • src/components/Patient/PatientHome.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Use standard medical component interface patterns with medicalContext, accessibility properties (ariaLabel, screenReaderText), clinical validation callbacks (onValidationError), and medical data properties (patientId, facilityId)

Applied to files:

  • src/components/Patient/PatientHome.tsx
📚 Learning: 2024-11-12T12:06:30.851Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9080
File: src/components/Users/LinkedFacilitiesTab.tsx:7-11
Timestamp: 2024-11-12T12:06:30.851Z
Learning: In `src/components/Users/LinkedFacilitiesTab.tsx`, the `username` prop is used when passing it to the `userColumns` function, so it should not be considered unused.

Applied to files:

  • src/components/Facility/FacilityUsers.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Handle different user roles and permissions in page components

Applied to files:

  • src/components/Facility/FacilityUsers.tsx
📚 Learning: 2024-11-05T18:58:19.072Z
Learnt from: sainak
Repo: ohcnetwork/care_fe PR: 8979
File: src/Routers/SessionRouter.tsx:1-8
Timestamp: 2024-11-05T18:58:19.072Z
Learning: In `src/Routers/SessionRouter.tsx`, the `LicensesPage` component opens in a new page and is correctly handled by the top-level `Suspense`, so wrapping it in a `Suspense` component within `SessionRouter.tsx` is unnecessary.

Applied to files:

  • src/components/Facility/FacilityUsers.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Cache data appropriately in page components based on usage patterns

Applied to files:

  • src/components/Facility/FacilityUsers.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Implement `TagAssignmentSheet` with `TagEntityType` for patient/facility tags

Applied to files:

  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-04-11T20:28:51.054Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 11884
File: src/pages/Landing/LandingPage.tsx:128-158
Timestamp: 2025-04-11T20:28:51.054Z
Learning: The LoginHeader component uses the AuthContext for authentication and includes the SignCompact component, making it incompatible with the token-based authentication flow used in the LandingPage. The custom header implementation in LandingPage is specifically designed for patient authentication with different navigation targets (/patient/home vs /dashboard) and different user information display.

Applied to files:

  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use Badge components to display patient status, facility capacity, medication dosage with color variants

Applied to files:

  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2024-11-22T12:04:39.044Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9080
File: src/components/Users/UserSummary.tsx:53-71
Timestamp: 2024-11-22T12:04:39.044Z
Learning: In the `UserSummaryTab` component (`src/components/Users/UserSummary.tsx`), when there is an error during user deletion, the delete dialog is intentionally closed to prevent the user from immediately trying to delete the user again.

Applied to files:

  • src/pages/Facility/billing/account/AccountShow.tsx
🧬 Code graph analysis (7)
src/pages/Facility/services/FacilityServices.tsx (1)
src/components/Common/Page.tsx (1)
  • Page (18-37)
src/pages/Facility/overview.tsx (1)
src/components/Common/Page.tsx (1)
  • Page (18-37)
src/pages/Facility/queues/QueuesIndex.tsx (1)
src/components/Common/Page.tsx (1)
  • Page (18-37)
src/components/Common/Page.tsx (3)
src/context/ShortcutContext.tsx (1)
  • useShortcutSubContext (200-212)
src/lib/utils.ts (1)
  • cn (4-6)
src/components/Common/Breadcrumbs.tsx (1)
  • Breadcrumbs (114-164)
src/pages/Facility/billing/invoice/InvoiceList.tsx (1)
src/components/Common/Page.tsx (1)
  • Page (18-37)
src/components/Common/Breadcrumbs.tsx (3)
src/hooks/useAppHistory.ts (1)
  • useAppHistory (9-35)
src/components/ui/separator.tsx (1)
  • Separator (27-27)
src/components/ui/breadcrumb.tsx (5)
  • Breadcrumb (107-107)
  • BreadcrumbList (111-111)
  • BreadcrumbItem (109-109)
  • BreadcrumbLink (110-110)
  • BreadcrumbSeparator (113-113)
src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx (1)
src/components/Common/Page.tsx (1)
  • Page (18-37)
🪛 Biome (2.1.2)
src/components/Common/Breadcrumbs.tsx

[error] 139-142: Static Elements should not be interactive.

To add interactivity such as a mouse or key event listener to a static element, give the element an appropriate role value.

(lint/a11y/noStaticElementInteractions)


[error] 139-142: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.

Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.

(lint/a11y/useKeyWithClickEvents)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build
  • GitHub Check: Test
  • GitHub Check: lint
  • GitHub Check: CodeQL-Build
🔇 Additional comments (14)
src/components/Patient/PatientHome.tsx (1)

91-91: Breadcrumbs hidden on patient details page.

This follows the same pattern as other pages in this PR. Please ensure that hiding breadcrumbs on the patient details page aligns with the design intent and doesn't negatively impact clinical workflows where providers need to quickly navigate between facility, patient, and encounter contexts.

src/pages/Facility/billing/account/AccountList.tsx (1)

162-162: Implementation follows the established pattern.

The hideBreadcrumbs prop is correctly applied here. However, verify that removing breadcrumbs from billing/financial pages doesn't impact users who need to navigate between facility, account, and invoice contexts.

src/components/Resource/ResourceList.tsx (1)

110-110: Implementation is correct.

The hideBreadcrumbs prop is properly applied. Ensure this aligns with the overall breadcrumb visibility strategy for the application.

src/pages/Facility/services/FacilityServices.tsx (1)

41-41: Correct implementation.

The hideBreadcrumbs prop is correctly used here, consistent with the pattern across the PR.

src/pages/Encounters/EncounterShow.tsx (1)

223-223: Verify breadcrumb removal on clinical encounter pages.

The encounter details page is critical for clinical workflows. Providers often need to navigate between facility, patient, and encounter contexts quickly. Please verify that hiding breadcrumbs here doesn't negatively impact clinical usability and emergency care scenarios.

src/pages/Facility/billing/invoice/InvoiceList.tsx (1)

45-45: Implementation is correct.

The hideBreadcrumbs prop is properly applied, following the established pattern.

src/pages/Facility/billing/paymentReconciliation/PaymentReconciliationList.tsx (1)

29-29: Correct implementation of the breadcrumb visibility pattern.

The hideBreadcrumbs prop is correctly applied here. As with all other pages in this PR, please ensure this change has been validated against the design specifications and user testing feedback.

src/pages/Facility/overview.tsx (1)

97-97: LGTM!

Hiding breadcrumbs on the facility overview page is appropriate since this serves as the facility's home/landing page where breadcrumbs would be redundant.

src/pages/Encounters/EncounterList.tsx (1)

271-271: LGTM!

The hideBreadcrumbs prop is correctly applied to the Page component.

src/components/Facility/FacilityUsers.tsx (1)

85-85: LGTM!

The hideBreadcrumbs prop is correctly applied.

src/components/Common/Page.tsx (1)

3-3: LGTM!

Clean implementation of conditional breadcrumb rendering. The default behavior correctly shows breadcrumbs unless explicitly hidden via the hideBreadcrumbs prop.

Also applies to: 15-15, 23-23

src/pages/Facility/billing/account/AccountShow.tsx (2)

56-56: LGTM!

The Page wrapper is correctly applied with hideTitleOnPage to suppress the page title display while allowing breadcrumbs to show (no hideBreadcrumbs prop). This aligns with the design where detail pages show breadcrumbs for navigation context.

Also applies to: 261-261


641-647: Consider explicit i18n calls to ensure cleanup script detects keys.

All four translation keys (close_account_help_closed_baddebt, close_account_help_closed_voided, close_account_help_closed_completed, close_account_help_closed_combined) are present in public/locale/en.json. However, accessing them through the closedStatusText object lookup may not be detectable by the i18n cleanup script, which primarily tracks direct t() calls with string literals. To ensure these keys are not flagged as unused in future cleanup runs, either add explicit t() calls elsewhere (e.g., in a comment or unused block) or refactor to use separate t() calls per branch.

src/components/Common/Breadcrumbs.tsx (1)

20-32: The resource labels are correctly configured. All values in RESOURCE_LABELS that are passed to t() have corresponding translation keys in the locale files: "account", "invoices", "patient", "encounter", "location", "service", "settings", "users", "patients", and "encounters". The mapping of plural keys (e.g., "locations") to singular values (e.g., "location") is intentional and semantically correct—URL segments use plural form while display labels use singular form. No action needed.

Likely an incorrect or invalid review comment.

BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";
import useAppHistory from "@/hooks/useAppHistory";
import { Separator } from "@radix-ui/react-separator";
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Use the local Separator component instead of importing directly from Radix.

The project has a local @/components/ui/separator component that should be used for consistency. Other files in the PR use this pattern.

🔎 Proposed fix
-import { Separator } from "@radix-ui/react-separator";
+import { Separator } from "@/components/ui/separator";
🤖 Prompt for AI Agents
In src/components/Common/Breadcrumbs.tsx around line 9, the file imports
Separator from "@radix-ui/react-separator"; replace this with the project's
local component import (import Separator from "@/components/ui/separator" or the
named export used across the repo) to maintain consistency—remove the Radix
import and update the import path to the local "@/components/ui/separator"
module, then ensure any usage/props match the local component's API.

Comment on lines 65 to 112
function buildBreadcrumbs(segments: string[]): BreadcrumbItemProps[] {
const breadcrumbs: BreadcrumbItemProps[] = [];

for (let i = 0; i < segments.length; i++) {
const segment = segments[i];
const nextSegment = i < segments.length - 1 ? segments[i + 1] : null;
const prevSegment = i > 0 ? segments[i - 1] : null;

if (i === 0 || i === 1) continue;

// Skip action/tab segments at the end
if (SKIP_SEGMENTS.has(segment)) continue;

// Handle UUIDs - show as separate breadcrumb with formatted ID
if (isUuid(segment) && prevSegment && isResourceName(prevSegment)) {
const currentPath = `/${segments.slice(0, i + 1).join("/")}`;
const resourceLabel =
RESOURCE_LABELS[prevSegment] || prevSegment.replace(/_/g, " ");
breadcrumbs.push({
label: `${resourceLabel} ${formatIdLabel(segment)}`,
href: currentPath,
});
continue;
}

// Handle resource name followed by UUID
// Add the resource collection page (e.g., /billing/account)
if (isResourceName(segment) && nextSegment && isUuid(nextSegment)) {
const currentPath = `/${segments.slice(0, i + 1).join("/")}`;
breadcrumbs.push({
label: RESOURCE_LABELS[segment] || segment.replace(/_/g, " "),
href: currentPath,
});
continue;
}

// Handle standalone resource names (e.g. account, patients, charge_items)
if (isResourceName(segment)) {
const currentPath = `/${segments.slice(0, i + 1).join("/")}`;
breadcrumbs.push({
label: RESOURCE_LABELS[segment],
href: currentPath,
});
}
}

return breadcrumbs;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider memoizing buildBreadcrumbs for performance.

The buildBreadcrumbs function is called on every render. While the current implementation is lightweight, memoizing it with useMemo based on segments would prevent unnecessary recalculations.

🔎 Suggested approach in the component
+import { useMemo } from "react";
+
 export function Breadcrumbs() {
   const { t } = useTranslation();
   const { goBack } = useAppHistory();
   const { facilityId } = usePathParams("/facility/:facilityId/*") ?? {};
   const path = usePath();
   const segments = path?.split("/").filter(Boolean) || [];

-  const breadcrumbs: BreadcrumbItemProps[] = [];
-
-  if (facilityId && segments.length > 1) {
-    breadcrumbs.push({
-      label: "home",
-      href: `/facility/${facilityId}/overview`,
-    });
-
-    const additionalBreadcrumbs = buildBreadcrumbs(segments);
-    breadcrumbs.push(...additionalBreadcrumbs);
-  }
+  const breadcrumbs = useMemo(() => {
+    const items: BreadcrumbItemProps[] = [];
+    if (facilityId && segments.length > 1) {
+      items.push({
+        label: "home",
+        href: `/facility/${facilityId}/overview`,
+      });
+      items.push(...buildBreadcrumbs(segments));
+    }
+    return items;
+  }, [facilityId, segments]);

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

🤖 Prompt for AI Agents
In src/components/Common/Breadcrumbs.tsx around lines 65 to 112,
buildBreadcrumbs is pure but is being recomputed on every render; wrap its
invocation in React.useMemo so breadcrumbs are only recalculated when the
segments array changes. In the component where buildBreadcrumbs is called,
import useMemo and replace direct calls with const breadcrumbs = useMemo(() =>
buildBreadcrumbs(segments), [segments]); ensure segments is the same reference
or derived from props/location so the dependency is correct; no other logic
changes to buildBreadcrumbs are necessary.

Comment on lines 137 to 145
<div className="flex items-center gap-2">
<ChevronLeft className="size-4" />
<span
onClick={() => goBack()}
className="text-sm text-gray-500 hover:cursor-pointer"
>
{t("back")}
</span>
</div>
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 accessibility: interactive span lacks keyboard support.

The "back" button uses a <span> with onClick but no keyboard accessibility. This violates WCAG guidelines and was flagged by static analysis. Users navigating with keyboards cannot activate this control.

🔎 Proposed fix
-      <div className="flex items-center gap-2">
-        <ChevronLeft className="size-4" />
-        <span
-          onClick={() => goBack()}
-          className="text-sm text-gray-500 hover:cursor-pointer"
-        >
-          {t("back")}
-        </span>
-      </div>
+      <button
+        type="button"
+        onClick={() => goBack()}
+        className="flex items-center gap-2 text-sm text-gray-500 hover:cursor-pointer"
+      >
+        <ChevronLeft className="size-4" />
+        {t("back")}
+      </button>

Using a <button> element provides native keyboard support (Enter/Space activation), focus management, and proper semantics for assistive technologies.

📝 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
<div className="flex items-center gap-2">
<ChevronLeft className="size-4" />
<span
onClick={() => goBack()}
className="text-sm text-gray-500 hover:cursor-pointer"
>
{t("back")}
</span>
</div>
<button
type="button"
onClick={() => goBack()}
className="flex items-center gap-2 text-sm text-gray-500 hover:cursor-pointer"
>
<ChevronLeft className="size-4" />
{t("back")}
</button>
🧰 Tools
🪛 Biome (2.1.2)

[error] 139-142: Static Elements should not be interactive.

To add interactivity such as a mouse or key event listener to a static element, give the element an appropriate role value.

(lint/a11y/noStaticElementInteractions)


[error] 139-142: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.

Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.

(lint/a11y/useKeyWithClickEvents)

🤖 Prompt for AI Agents
In src/components/Common/Breadcrumbs.tsx around lines 137 to 145, the "back"
control is implemented as a <span> with an onClick which lacks keyboard
accessibility; replace the span with a <button type="button"> preserving the
existing className and onClick (onClick={() => goBack()}), add an appropriate
aria-label if the visible text isn’t sufficient (e.g., aria-label={t("back")}),
and remove any tabindex/role hacks—this yields native keyboard support
(Enter/Space), correct semantics, and keeps the original styling and behavior.

setCloseAccountStatus({ ...closeAccountStatus, sheetOpen: open })
}
>
<DialogHeader></DialogHeader>
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Remove empty DialogHeader element.

The empty <DialogHeader></DialogHeader> serves no purpose and should be removed for cleaner markup.

🔎 Proposed fix
         <Dialog
           open={closeAccountStatus.sheetOpen}
           onOpenChange={(open) =>
             setCloseAccountStatus({ ...closeAccountStatus, sheetOpen: open })
           }
         >
-          <DialogHeader></DialogHeader>
           <DialogContent>
📝 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
<DialogHeader></DialogHeader>
<Dialog
open={closeAccountStatus.sheetOpen}
onOpenChange={(open) =>
setCloseAccountStatus({ ...closeAccountStatus, sheetOpen: open })
}
>
<DialogContent>
🤖 Prompt for AI Agents
In src/pages/Facility/billing/account/AccountShow.tsx around line 638, there is
an empty <DialogHeader></DialogHeader> element that serves no purpose; remove
that empty element to clean up the JSX markup and adjust surrounding
indentation/whitespace as needed so the component remains valid and formatted.


return (
<Page title={t("token_queues")} hideTitleOnPage>
<Page title={t("token_queues")} hideTitleOnPage hideBreadcrumbs>
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🏁 Script executed:

# First, let's examine the QueuesIndex.tsx file around line 308
cd /repo
head -320 src/pages/Facility/queues/QueuesIndex.tsx | tail -30

Repository: ohcnetwork/care_fe

Length of output: 1349


🏁 Script executed:

# Search for all uses of hideBreadcrumbs in the codebase
rg "hideBreadcrumbs" --type ts --type tsx -B 2 -A 2

Repository: ohcnetwork/care_fe

Length of output: 89


🏁 Script executed:

# Find the Page component to understand its breadcrumb implementation
fd "Page" -e tsx -e ts | grep -E "(components|Page\.tsx)" | head -20

Repository: ohcnetwork/care_fe

Length of output: 428


🏁 Script executed:

# Check if there's any documentation or comments about breadcrumb usage
rg "breadcrumb" --type ts --type tsx -i -B 1 -A 1

Repository: ohcnetwork/care_fe

Length of output: 89


🏁 Script executed:

# Look for PR comments or design documentation references
find . -type f \( -name "*.md" -o -name "*.txt" \) | xargs grep -l "14974\|breadcrumb\|hideBreadcrumbs" 2>/dev/null | head -10

Repository: ohcnetwork/care_fe

Length of output: 44


🏁 Script executed:

# Search for hideBreadcrumbs usage across the codebase (fixing file type flag)
rg "hideBreadcrumbs" -A 2 -B 2

Repository: ohcnetwork/care_fe

Length of output: 6301


🏁 Script executed:

# Examine the Page component implementation
cat -n src/components/Common/Page.tsx | head -100

Repository: ohcnetwork/care_fe

Length of output: 1547


🏁 Script executed:

# Count how many files use hideBreadcrumbs
rg "hideBreadcrumbs" -l | wc -l

Repository: ohcnetwork/care_fe

Length of output: 64


🏁 Script executed:

# Get a list of all files using hideBreadcrumbs
rg "hideBreadcrumbs" -l

Repository: ohcnetwork/care_fe

Length of output: 687


🏁 Script executed:

# Search for breadcrumb-related code in Page component
rg "breadcrumb\|Breadcrumb" -i src/components/Common/Page.tsx

Repository: ohcnetwork/care_fe

Length of output: 44


🏁 Script executed:

# Check git history or comments around the Page component for context
cat -n src/components/Common/Page.tsx | grep -A 10 -B 10 "breadcrumb\|Breadcrumb" -i

Repository: ohcnetwork/care_fe

Length of output: 1478


🏁 Script executed:

# Check if hideBreadcrumbs was recently added to Page.tsx
git log --oneline -p src/components/Common/Page.tsx | head -100

Repository: ohcnetwork/care_fe

Length of output: 1543


🏁 Script executed:

# Check git blame for when hideBreadcrumbs was added to Page.tsx
git log --oneline src/components/Common/Page.tsx | head -10

Repository: ohcnetwork/care_fe

Length of output: 88


🏁 Script executed:

# Check how many files were modified in this PR to use hideBreadcrumbs
git diff --name-only HEAD~1 | grep -E "\.(tsx?|jsx?)$"

Repository: ohcnetwork/care_fe

Length of output: 248


🏁 Script executed:

# Get more context about the PR scope - check changed files
git log --oneline -1

Repository: ohcnetwork/care_fe

Length of output: 88


🏁 Script executed:

# Check the Breadcrumbs component to understand its implementation and accessibility
cat -n src/components/Common/Breadcrumbs.tsx | head -80

Repository: ohcnetwork/care_fe

Length of output: 2843


🏁 Script executed:

# Check the commit that added hideBreadcrumbs to see if there's a commit message
git log --all --grep="breadcrumb\|hideBreadcrumbs" --oneline

Repository: ohcnetwork/care_fe

Length of output: 88


🏁 Script executed:

# Look at when hideBreadcrumbs was added to these specific pages - check their git history
git log --oneline src/pages/Facility/queues/QueuesIndex.tsx | head -5

Repository: ohcnetwork/care_fe

Length of output: 88


🏁 Script executed:

# Check if there's a specific pattern - are these pages typically top-level pages?
grep -r "hideBreadcrumbs" --include="*.tsx" -B 5 -A 1 | grep -E "export|function|const.*=" | head -30

Repository: ohcnetwork/care_fe

Length of output: 897


🏁 Script executed:

# Look for any documentation or comments explaining the design decision
rg "breadcrumb|Breadcrumb" -i --type ts --type tsx src/components/Common/ -B 3 -A 3

Repository: ohcnetwork/care_fe

Length of output: 89


🏁 Script executed:

# Check accessibility attributes on the Breadcrumbs component
cat src/components/Common/Breadcrumbs.tsx | grep -i "aria\|role\|nav"

Repository: ohcnetwork/care_fe

Length of output: 179


🏁 Script executed:

# Let's check when these pages were modified to add hideBreadcrumbs
git log --all --oneline -- src/pages/Facility/queues/QueuesIndex.tsx src/pages/Facility/services/FacilityServices.tsx src/pages/Encounters/EncounterList.tsx | head -20

Repository: ohcnetwork/care_fe

Length of output: 157


🏁 Script executed:

# Check if this is part of a specific recent commit or a longer pattern
git log --all --oneline --format="%h %s" | head -20

Repository: ohcnetwork/care_fe

Length of output: 157


🏁 Script executed:

# Examine the full Breadcrumbs component to check for accessibility attributes
cat -n src/components/Common/Breadcrumbs.tsx

Repository: ohcnetwork/care_fe

Length of output: 6000


🏁 Script executed:

# Check if there's a PR description or issue number mentioned in recent commits
git log --all --format="%h %s %b" | head -100

Repository: ohcnetwork/care_fe

Length of output: 159


🏁 Script executed:

# Check the full context of the initial commit to understand the design intent
git show dc5e4db2 --stat | head -50

Repository: ohcnetwork/care_fe

Length of output: 2943


🏁 Script executed:

# Look for any PR comments or documentation
git log --all --format="%B" dc5e4db2

Repository: ohcnetwork/care_fe

Length of output: 142


🏁 Script executed:

# Check if "overview" is consistently treated to understand the pattern
grep -r "overview" src/pages/Facility/ --include="*.tsx" | grep -i "hideTitle\|hideBreadcrumb"

Repository: ohcnetwork/care_fe

Length of output: 44


🏁 Script executed:

# Check if there's any documentation or comment in commits about design decisions
git log --all --oneline --grep="design\|Figma\|mobile" | head -20

Repository: ohcnetwork/care_fe

Length of output: 44


🏁 Script executed:

# Verify the actual scope - see how many commits were in this feature
git log --all --oneline | grep -i "breadcrumb\|queue\|service\|invoice\|account\|encounter" | head -30

Repository: ohcnetwork/care_fe

Length of output: 88


🏁 Script executed:

# Check if the BreadcrumbList component from shadcn has proper nav role
cat src/components/ui/breadcrumb.tsx 2>/dev/null || echo "File not found"

Repository: ohcnetwork/care_fe

Length of output: 2621


Add documentation explaining the breadcrumb visibility strategy.

The hideBreadcrumbs implementation across 14 pages (queues, services, encounters, billing pages, etc.) appears intentional and uses proper accessibility attributes (nav with aria-label, aria-current="page" on current breadcrumb). However, there is no comment or design documentation explaining the criteria for when breadcrumbs should be hidden vs. shown.

Consider adding a brief comment to the Page component (or in a design guidelines document) clarifying why certain page types hide breadcrumbs and which pages should follow this pattern in the future. This will help maintain consistency as new pages are added.

🤖 Prompt for AI Agents
In src/pages/Facility/queues/QueuesIndex.tsx around line 308, add a brief inline
comment above the Page component explaining the breadcrumb visibility strategy:
state that certain primary index/listing pages (queues, services, encounters,
billing, etc.) intentionally hide breadcrumbs to reduce visual clutter and rely
on page title and accessible nav attributes, and reference the central design
guideline file or doc path (e.g., DESIGN_GUIDELINES.md) where the full criteria
for when to hide vs. show breadcrumbs is documented; keep the comment concise
and include guidance for future pages to follow this pattern.

@github-actions
Copy link

github-actions bot commented Dec 29, 2025

🎭 Playwright Test Results

Status: ✅ Passed
Test Shards: 3

Metric Count
Total Tests 251
✅ Passed 251
❌ Failed 0
⏭️ Skipped 0

📊 Detailed results are available in the playwright-final-report artifact.

Run: #4173

@github-actions github-actions bot added the Merge Conflict pull requests with merge conflict label Dec 30, 2025
@github-actions
Copy link

Conflicts have been detected against the base branch. Please merge the base branch into your branch.
cc: @Jacobjeevan

See: https://docs.ohc.network/docs/contributing#how-to-resolve-merge-conflicts

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/pages/Facility/billing/account/AccountShow.tsx (1)

270-416: Significant code duplication between responsive layouts.

The desktop (lines 271-347) and mobile (lines 349-416) action button sections duplicate the same functionality with only minor differences in labels and layout classes. This violates the DRY principle and increases maintenance burden—any logic change requires updating both sections.

🔎 Suggested approach to eliminate duplication

Extract the action buttons into a reusable component or use a single conditional rendering block with responsive classes:

const isMobile = useBreakpoints({ default: true, lg: false });

<div className="flex gap-2 w-full lg:w-auto justify-end">
  {account.status === AccountStatus.active && !isAccountBillingClosed && (
    <>
      <Button
        variant={isMobile ? "outline" : "ghost"}
        className="lg:flex lg:gap-1 lg:items-center"
        onClick={() => setCloseAccountStatus({...closeAccountStatus, sheetOpen: true})}
      >
        <CareIcon icon="l-check" className="size-5 lg:size-5" />
        <span className={cn("underline", {"hidden lg:inline": !isMobile})}>
          {t("settle_close")}
        </span>
        <ShortcutBadge actionId="settle-close-account" />
      </Button>
      
      {/* Similar pattern for other buttons */}
    </>
  )}
</div>

Alternatively, extract common button logic into a separate component and pass display props.

♻️ Duplicate comments (1)
src/pages/Facility/billing/account/AccountShow.tsx (1)

639-639: Remove empty DialogHeader element.

The empty <DialogHeader></DialogHeader> serves no purpose and should be removed for cleaner markup.

🔎 Proposed fix
         <Dialog
           open={closeAccountStatus.sheetOpen}
           onOpenChange={(open) =>
             setCloseAccountStatus({ ...closeAccountStatus, sheetOpen: open })
           }
         >
-          <DialogHeader></DialogHeader>
           <DialogContent>

This issue was previously flagged in past review comments.

📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dc5e4db and 7e97897.

📒 Files selected for processing (3)
  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Encounters/EncounterShow.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
🧰 Additional context used
📓 Path-based instructions (12)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Write concise, technical TypeScript code with accurate examples
Use TypeScript for all code; prefer interfaces over types
Avoid enums; use maps instead
Use TanStack Query for data fetching from the API along with query and mutate utilities for the queryFn and mutationFn
Use raviger for routing

**/*.{ts,tsx}: Use TypeScript with strict mode and ES2022 target
Use interface for defining object types in TypeScript
Avoid explicit any type in TypeScript
Use proper nullability annotations in TypeScript types
Use dedicated error handlers and TypeScript strict null checks

**/*.{ts,tsx}: Use TypeScript for all new code
Prefer interfaces over types for object definitions in TypeScript
Avoid using any type; use proper type definitions in TypeScript
Use type inference where possible in TypeScript
Use TanStack Query for API data management
Prefer React Context for global state management

**/*.{ts,tsx}: Use TanStack Query with the query and mutate utilities from @/Utils/request/
Use appropriate query keys following the resource pattern for TanStack Query
Leverage TanStack Query built-in features for pagination and debouncing
Implement proper error handling using the global error handler for TanStack Query operations
Use useQuery hook with queryKey and queryFn parameters, where queryFn wraps the API route with the query() utility
Use useMutation hook with mutationFn parameter wrapping API routes with the mutate() utility, and implement onSuccess callbacks to invalidate related queries
Support path parameters in TanStack Query using the pathParams option in query/mutate utilities
Support query parameters in TanStack Query using the queryParams option in query/mutate utilities
Use the silent: true option to suppress global error notifications when custom error handling is needed

**/*.{ts,tsx}: Use TypeScript with strict mode and ES2022 target
Use interface for defining object types
Avoid explicit any types and maint...

Files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
  • src/pages/Encounters/EncounterShow.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Use functional and declarative programming patterns; avoid classes
Prefer iteration and modularization over code duplication
Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Use the "function" keyword for pure functions
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements

**/*.{ts,tsx,js,jsx}: Use path aliases for imports from src (@/*)
Use double quotes for strings
Semicolons are required at end of statements
Order imports as: 3rd-party → library → CAREUI → UI → components → hooks → utils → relative
Use PascalCase for component and class names
Use camelCase for variable and function names

**/*.{ts,tsx,js,jsx}: Use path aliases @/* for imports from src directory
Use double quotes for strings
Require semicolons at end of statements
Order imports: 3rd-party → library → CAREUI → UI → components → hooks → utils → relative
Use PascalCase for component and class names
Use camelCase for variable and function names

Files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
  • src/pages/Encounters/EncounterShow.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Use declarative JSX

Files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
  • src/pages/Encounters/EncounterShow.tsx
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{ts,tsx}: Use strict TypeScript configuration for medical data safety in all TypeScript source files
All literal strings must use i18next for multi-language support in healthcare interfaces
Use comprehensive error boundaries and user-friendly error messages for medical workflow debugging without exposing PHI
Follow ESLint configured rules for React hooks, accessibility, and code quality
Use @tanstack/react-query for server state management in API client code
Localize date and time formats for medical timestamps using locale-aware formatting functions
Use date-fns for date handling and manipulation with locale awareness for medical timestamps

Files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
  • src/pages/Encounters/EncounterShow.tsx
src/**/*.{ts,tsx,css}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Prettier for consistent code formatting across the healthcare application

Files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
  • src/pages/Encounters/EncounterShow.tsx
src/pages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use raviger for application routing in page components and route definitions

src/pages/**/*.{ts,tsx}: Keep page components in src/pages/ organized by feature
Use descriptive file names that reflect the page purpose
Export page components as default exports
Co-locate page-specific components and utilities with page components
Use raviger router for navigation (existing dependency)
Implement proper route parameters and query string handling
Handle navigation guards and authentication checks in page components
Implement proper loading states and error boundaries in page components
Use semantic HTML structure for accessibility in page components
Use @tanstack/react-query for API state management in page components (existing dependency)
Implement proper loading, error, and success states for data fetching
Handle pagination and infinite scroll patterns appropriately
Cache data appropriately in page components based on usage patterns
Use controlled components for form inputs in page components
Implement proper form validation with zod schemas in page components
Handle form submission states (loading, success, error) in page components
Use React hooks for local page state
Minimize unnecessary re-renders in page components
Implement proper authentication checks in page components
Handle different user roles and permissions in page components
Redirect to login when authentication is required in page components
Show appropriate UI based on user permissions in page components
Set appropriate page titles and meta descriptions in page components
Handle OpenGraph and Twitter card meta tags in page components
Implement structured data where applicable in page components
Implement code splitting for large page components
Use lazy loading for heavy components within page components
Optimize bundle size with proper imports in page components
Handle image optimization and lazy loading in page components
Implement comprehensive error boundaries in page components
Handle API e...

Files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
  • src/pages/Encounters/EncounterShow.tsx
src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{tsx,ts}: Use React 19.1.1 features and patterns following React 19 Documentation for healthcare application development
Use shadcn/ui as primary component system and CAREUI for healthcare-specific components
Use framer-motion for animations in healthcare UI interfaces

Files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
  • src/pages/Encounters/EncounterShow.tsx
src/**/*.{tsx,css}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Tailwind CSS 4.1.3 utility classes with custom healthcare-specific design system for styling

Files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
  • src/pages/Encounters/EncounterShow.tsx
**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Use 2-space indentation

Files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
  • src/pages/Encounters/EncounterShow.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/02-coding-standards.mdc)

**/*.tsx: Use functional components with proper type definitions in React
One component per file is preferred
Prefer default exports for React components
Follow the component naming pattern: ComponentName.tsx for React components
Use Tailwind CSS for styling
Use Shadcn UI components when available
Use local state for component-specific data
Use PascalCase for component file names (e.g., AuthWizard.tsx)

Files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
  • src/pages/Encounters/EncounterShow.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/04-ui-components.mdc)

**/*.{tsx,ts}: Use Shadcn UI components as the primary component library
Follow the component documentation for proper usage
Customize components using Tailwind CSS
Use navigate and useRedirect from raviger for navigation and redirects
Use Tailwind's responsive classes and follow mobile-first approach
Implement proper ARIA attributes for accessibility
Ensure keyboard navigation works in components
Define component props using TypeScript interfaces
Use translation keys from src/Locale/ for internationalization
Support RTL languages in components
Use proper date/time formatting for multiple language support

Files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
  • src/pages/Encounters/EncounterShow.tsx
**/*.{ts,tsx,js,jsx,json,css,scss,html}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation

Files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
  • src/pages/Encounters/EncounterShow.tsx
🧠 Learnings (27)
📓 Common learnings
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Provide skip links for screen readers in page components
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 12117
File: public/locale/en.json:2993-2996
Timestamp: 2025-05-21T06:00:57.699Z
Learning: Jacobjeevan prefers to keep i18n translation keys generic (without feature-specific prefixes) when possible to allow for reuse across different parts of the application.
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Handle patient data with appropriate privacy considerations in healthcare page components

Applied to files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
  • src/pages/Encounters/EncounterShow.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Use semantic HTML structure for accessibility in page components

Applied to files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Encounters/EncounterShow.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Show appropriate UI based on user permissions in page components

Applied to files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Encounters/EncounterShow.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Minimize unnecessary re-renders in page components

Applied to files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Encounters/EncounterShow.tsx
📚 Learning: 2025-08-10T10:20:32.921Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 13316
File: src/pages/Facility/settings/productKnowledge/ProductKnowledgeView.tsx:63-65
Timestamp: 2025-08-10T10:20:32.921Z
Learning: In the ProductKnowledgeView component at src/pages/Facility/settings/productKnowledge/ProductKnowledgeView.tsx, the loading state should return only the Loading component without wrapping it in a Page shell. This is the expected behavior to provide a cleaner loading experience without maintaining the page layout during data fetching.

Applied to files:

  • src/pages/Appointments/AppointmentsPage.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Implement structured data where applicable in page components

Applied to files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Encounters/EncounterShow.tsx
📚 Learning: 2025-11-25T13:52:33.081Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/providers.instructions.md:0-0
Timestamp: 2025-11-25T13:52:33.081Z
Learning: Applies to src/Providers/**/*PatientUserProvider*{.ts,.tsx} : PatientUserProvider should handle patient authentication for public appointment booking

Applied to files:

  • src/pages/Appointments/AppointmentsPage.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Implement proper data validation for medical information in page components

Applied to files:

  • src/pages/Appointments/AppointmentsPage.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Maintain proper heading hierarchy for screen reader support in medical records display

Applied to files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Ensure keyboard navigation works properly in page components

Applied to files:

  • src/pages/Appointments/AppointmentsPage.tsx
📚 Learning: 2025-12-17T19:47:58.152Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 14821
File: src/components/Location/LocationNavigation.tsx:161-163
Timestamp: 2025-12-17T19:47:58.152Z
Learning: To ensure the remove-unused-i18n.js cleanup script detects i18n keys, avoid wrapping keys inside a ternary expression passed directly to t(). Instead, call t() separately in each branch of a conditional, e.g. condition ? t("key1") : t("key2"), or compute the key in a variable before passing to t(). For LocationNavigation.tsx (and similar TSX files in the repo), prefer explicit separate i18n calls per branch or a shared precomputed key to guarantee all keys are statically detectable by the script.

Applied to files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
  • src/pages/Encounters/EncounterShow.tsx
📚 Learning: 2025-12-22T10:16:36.690Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 14804
File: src/pages/Facility/services/pharmacy/DispensesView.tsx:117-135
Timestamp: 2025-12-22T10:16:36.690Z
Learning: In the care_fe repository, prefer the native HTML title attribute for simple tooltips over using shadcn/ui Tooltip components. Use Tooltip components only when the tooltip requires richer content, interactivity, or accessibility enhancements that cannot be achieved with a plain title. For simple cases, add a title attribute to the element (e.g., <span title="...">). If a Tooltip is used, ensure it is accessible and necessary, and avoid duplicating content available in the title attribute.

Applied to files:

  • src/pages/Appointments/AppointmentsPage.tsx
  • src/pages/Facility/billing/account/AccountShow.tsx
  • src/pages/Encounters/EncounterShow.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Implement `TagAssignmentSheet` with `TagEntityType` for patient/facility tags

Applied to files:

  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use `PatientHoverCard` for patient info overlays

Applied to files:

  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-11-25T13:51:23.408Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/context.instructions.md:0-0
Timestamp: 2025-11-25T13:51:23.408Z
Learning: Applies to src/context/**/AuditContext.tsx : Implement Audit Context for HIPAA compliance and data access logging

Applied to files:

  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Follow `<Card><CardHeader>` pattern for consistent card layouts

Applied to files:

  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-11-25T13:51:23.408Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/context.instructions.md:0-0
Timestamp: 2025-11-25T13:51:23.408Z
Learning: Applies to src/context/**/PermissionContext.tsx : Implement PermissionContext with medical role-based permissions (Doctor, Nurse, Admin, Pharmacist) including patient data access control with dynamic permission checking and facility-level permissions for multi-facility healthcare systems

Applied to files:

  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-12-29T10:19:36.983Z
Learnt from: abhimanyurajeesh
Repo: ohcnetwork/care_fe PR: 14927
File: src/components/Tags/TagAssignmentSheet.tsx:130-132
Timestamp: 2025-12-29T10:19:36.983Z
Learning: In src/components/Tags/TagAssignmentSheet.tsx, the backend distinguishes facility tags from instance tags by populating the `facility` field on TagConfig: facility tags have a truthy `facility` value, while instance tags have null or undefined. The `tag.meta.is_facility_tag` field exists in type definitions but is not used by the backend for this discrimination.

Applied to files:

  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use Badge components to display patient status, facility capacity, medication dosage with color variants

Applied to files:

  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use shadcn/ui components as primary UI system (Button, Card, Badge, etc.) from `@/components/ui/`

Applied to files:

  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2024-11-22T12:04:39.044Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9080
File: src/components/Users/UserSummary.tsx:53-71
Timestamp: 2024-11-22T12:04:39.044Z
Learning: In the `UserSummaryTab` component (`src/components/Users/UserSummary.tsx`), when there is an error during user deletion, the delete dialog is intentionally closed to prevent the user from immediately trying to delete the user again.

Applied to files:

  • src/pages/Facility/billing/account/AccountShow.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Set appropriate page titles and meta descriptions in page components

Applied to files:

  • src/pages/Encounters/EncounterShow.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Provide skip links for screen readers in page components

Applied to files:

  • src/pages/Encounters/EncounterShow.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Implement proper authentication checks in page components

Applied to files:

  • src/pages/Encounters/EncounterShow.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Implement proper loading states and error boundaries in page components

Applied to files:

  • src/pages/Encounters/EncounterShow.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Handle navigation guards and authentication checks in page components

Applied to files:

  • src/pages/Encounters/EncounterShow.tsx
🧬 Code graph analysis (1)
src/pages/Facility/billing/account/AccountShow.tsx (2)
src/components/Common/Page.tsx (1)
  • Page (18-37)
src/components/Tags/TagAssignmentSheet.tsx (1)
  • TagAssignmentSheet (113-227)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build
  • GitHub Check: Test
  • GitHub Check: CodeQL-Build
🔇 Additional comments (7)
src/pages/Appointments/AppointmentsPage.tsx (1)

354-354: Verify accessibility impact of hiding breadcrumbs.

The addition of hideBreadcrumbs removes breadcrumb navigation from this page. Breadcrumbs provide important context for users navigating the application hierarchy, particularly for screen reader users and keyboard navigation.

Please confirm:

  • That skip links or alternative navigation aids remain available when breadcrumbs are hidden
  • This decision has been validated with accessibility testing (WCAG compliance)
  • The rationale for hiding breadcrumbs on appointments pages aligns with UX requirements

Based on learnings, page components should provide skip links for screen readers and ensure proper navigation structure.

src/pages/Encounters/EncounterShow.tsx (1)

224-224: Verify accessibility and navigation impact.

Similar to the appointments page, hiding breadcrumbs on the encounter page removes navigation context. Given the complexity of the encounter page with multiple tabs and nested information, breadcrumbs may be particularly valuable for user orientation.

Ensure that alternative navigation aids (skip links, clear heading hierarchy) compensate for the absence of breadcrumbs, especially for assistive technology users.

Based on learnings, maintain proper heading hierarchy and navigation structure for screen reader support in medical records display.

src/pages/Facility/billing/account/AccountShow.tsx (5)

56-58: LGTM!

The new imports for Page and TagAssignmentSheet are correctly added and follow the coding guidelines for import ordering.


466-496: LGTM!

The TagAssignmentSheet implementation is correct and follows the established pattern from the component's usage examples. All required props are provided, query invalidation is properly handled, and the conditional button text uses appropriate i18n keys.


525-581: LGTM!

The financial summary section correctly implements:

  • Responsive three-column layout with appropriate breakpoints
  • Conditional coloring for balance (red for amounts due, green for overpaid)
  • Proper use of MonetaryDisplay for currency formatting
  • Complete i18n coverage for all user-facing text

583-612: LGTM!

The action buttons and tabs sections are correctly implemented:

  • Rebalance button properly handles mutation states and i18n
  • NavTabs component receives all required props with responsive showMoreAfterIndex
  • Controlled state management for tab navigation

614-631: LGTM!

The sheet components are properly configured with controlled state, correct prop passing, and appropriate handlers for updates.

<ShortcutBadge actionId="settle-close-account" />
</Button>
)}
<Page title={t("account")} hideTitleOnPage className="md:px-0">
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

🧩 Analysis chain

🏁 Script executed:

# First, let's read the AccountShow.tsx file to see the full context
wc -l src/pages/Facility/billing/account/AccountShow.tsx

Repository: ohcnetwork/care_fe

Length of output: 116


🏁 Script executed:

# Check the file size and content around line 262
head -n 300 src/pages/Facility/billing/account/AccountShow.tsx | tail -n 50

Repository: ohcnetwork/care_fe

Length of output: 2073


🏁 Script executed:

# Search for skip link implementations in other page components
rg -t tsx "skip" src/pages --max-count=10

Repository: ohcnetwork/care_fe

Length of output: 89


🏁 Script executed:

# Check if there's a pattern for skip links in the codebase
rg -t tsx "skipLink|skip-link|aria-label.*skip|href.*#main" src/ -A 2 -B 2

Repository: ohcnetwork/care_fe

Length of output: 89


🏁 Script executed:

# Look for common accessibility patterns in page components
rg -t tsx "aria-label" src/pages --max-count=5 -A 1

Repository: ohcnetwork/care_fe

Length of output: 89


🏁 Script executed:

# Read the full AccountShow.tsx file
cat -n src/pages/Facility/billing/account/AccountShow.tsx | head -n 100

Repository: ohcnetwork/care_fe

Length of output: 4243


🏁 Script executed:

# Search for skip link implementations with different patterns
rg "skip|aria-label" src/pages --max-count=5

Repository: ohcnetwork/care_fe

Length of output: 2653


🏁 Script executed:

# Check the Page component implementation
find src -name "Page.tsx" -o -name "Page.ts" | head -5

Repository: ohcnetwork/care_fe

Length of output: 92


🏁 Script executed:

# Look at page components to see common patterns
ls src/pages/ | head -20

Repository: ohcnetwork/care_fe

Length of output: 200


🏁 Script executed:

# Check the Page component implementation
cat -n src/components/Common/Page.tsx

Repository: ohcnetwork/care_fe

Length of output: 1547


🏁 Script executed:

# Search for skip link patterns in HTML (href="#main", href="#content", etc)
rg 'href="#' src/pages --max-count=10

Repository: ohcnetwork/care_fe

Length of output: 44


🏁 Script executed:

# Look for any skip link anchor elements or navigation landmarks
rg -i 'skip.*link|main.*content|role="main"' src/pages

Repository: ohcnetwork/care_fe

Length of output: 424


🏁 Script executed:

# Check PageTitle component to see if skip links might be implemented there
head -n 50 src/components/Common/PageTitle.tsx

Repository: ohcnetwork/care_fe

Length of output: 1142


🏁 Script executed:

# Look for any skip link implementations in the entire codebase
rg -i 'skiplink|skip.link|skip-link|skip.*content' src/

Repository: ohcnetwork/care_fe

Length of output: 44


Implement skip links for screen reader accessibility in page component.

Page components should provide skip links for keyboard and screen reader users. This page lacks navigation landmarks that allow assistive technology users to skip repetitive content and jump directly to main content areas.

🤖 Prompt for AI Agents
In src/pages/Facility/billing/account/AccountShow.tsx around line 262, the Page
component usage needs an accessible skip link and a main landmark: add a
visually-hidden skip link at the top of the page that points to a deterministic
id (for example href="#main-content") and ensure the main content element has
that id and appropriate role/landmark (e.g., <main id="main-content"
role="main">). If the Page component controls the top-level markup, either pass
a prop to Page to render the skip link or update Page to render a skip link and
ensure it sets the main id; otherwise add the skip link immediately before Page
and wrap the page’s primary content with an element having id="main-content".
Ensure the skip link is keyboard-focusable, visible on focus, and the main
element uses the same id so assistive tech and keyboard users can jump straight
to main content.

Comment on lines 420 to 581
<div className="bg-gray-100 p-3 space-y-4 rounded-lg">
<div className="bg-gray-100 rounded-lg flex flex-col md:flex-row md:items-center justify-between gap-4">
<div className="flex flex-col md:flex-row md:items-center gap-4 md:gap-6">
<div>
<p className="text-sm text-gray-700 font-medium">
{t("status")}
</p>
<Badge variant={ACCOUNT_STATUS_COLORS[account.status]}>
{t(account.status)}
</Badge>
</div>
<div>
<p className="text-sm text-gray-700 font-medium">
{t("start_date")}
{t("account")}
</p>
<p className="font-medium text-base text-gray-950">
{account.service_period?.start
? formatDate(account.service_period?.start)
: formatDate(account.created_date)}
{account.name}
</p>
</div>
<div className="flex md:items-center gap-6">
<div>
<p className="text-sm text-gray-700 font-medium">
{t("status")}
</p>
<Badge variant={ACCOUNT_STATUS_COLORS[account.status]}>
{t(account.status)}
</Badge>
</div>
<div>
<p className="text-sm text-gray-700 font-medium">
{t("start_date")}
</p>
<p className="font-medium text-base text-gray-950">
{account.service_period?.start
? formatDate(account.service_period?.start)
: formatDate(account.created_date)}
</p>
</div>
<div>
<p className="text-sm text-gray-700 font-medium">
{t("end_date")}
</p>
<p className="font-medium text-base text-gray-950">
{account.service_period?.end
? formatDate(account.service_period?.end)
: t("ongoing")}
</p>
</div>
</div>
<div>
<p className="text-sm text-gray-700 font-medium">
{t("end_date")}
</p>
<p className="font-medium text-base text-gray-950">
{account.service_period?.end
? formatDate(account.service_period?.end)
: t("ongoing")}
{t("tags_other")}
</p>
<div className="flex flex-wrap gap-1">
<TagAssignmentSheet
entityType="account"
entityId={accountId}
facilityId={facilityId}
currentTags={account.tags ?? []}
onUpdate={() => {
queryClient.invalidateQueries({
queryKey: ["account", accountId],
});
}}
patientId={account.patient.id}
trigger={
<Button
variant="outline"
size="xs"
className="rounded-sm"
>
<Hash />
{account.tags && account.tags.length > 0
? t("manage_tags")
: t("add_tags")}
</Button>
}
/>
{account.tags?.map((tag) => (
<Badge key={tag.id} variant="secondary" className="text-xs">
{tag.display}
</Badge>
))}
</div>
</div>
</div>
<div>
<p className="text-sm text-gray-700 font-medium">
{t("tags_other")}
</p>
<div className="flex flex-wrap gap-1">
<TagAssignmentSheet
entityType="account"
entityId={accountId}
facilityId={facilityId}
currentTags={account.tags ?? []}
onUpdate={() => {
queryClient.invalidateQueries({
queryKey: ["account", accountId],
});
}}
patientId={account.patient.id}
trigger={
<Button variant="outline" size="xs" className="rounded-sm">
<Hash />
{account.tags && account.tags.length > 0
? t("manage_tags")
: t("add_tags")}
</Button>
}
<div className="flex items-center gap-2">
<Button
variant="link"
asChild
className="text-gray-950 underline"
>
<Link
href={`/facility/${facilityId}/patient/${account.patient.id}/accounts`}
>
{t("past_accounts")}
</Link>
</Button>
<Button
variant="outline"
className="border-gray-400 gap-1"
onClick={() => setSheetOpen(true)}
>
<CareIcon
icon="l-edit"
className="size-5 stroke-gray-450 stroke-1"
/>
{account.tags?.map((tag) => (
<Badge key={tag.id} variant="secondary" className="text-xs">
{tag.display}
</Badge>
))}
</div>
{t("edit")}
<ShortcutBadge actionId="edit-account" />
</Button>
</div>
</div>
<div className="flex items-center gap-2">
<Button variant="link" asChild className="text-gray-950 underline">
<Link
href={`/facility/${facilityId}/patient/${account.patient.id}/accounts`}
>
{t("past_accounts")}
</Link>
</Button>
<Button
variant="outline"
className="border-gray-400 gap-1"
onClick={() => setSheetOpen(true)}
>
<CareIcon
icon="l-edit"
className="size-5 stroke-gray-450 stroke-1"
/>
{t("edit")}
<ShortcutBadge actionId="edit-account" />
</Button>
</div>
</div>

{/* Financial Summary Section */}
<div className="flex flex-col md:flex-row rounded-lg border border-gray-200 bg-white flex-wrap">
<div className="flex-1 p-6 border-b md:border-r border-gray-200">
<div className="space-y-1">
<p className="text-sm font-medium text-gray-500">
{t("amount_due")}
</p>
<div className="flex items-end">
<p
className={cn("text-3xl font-bold", {
"text-red-500": Number(account.total_balance) > 0,
"text-green-700": Number(account.total_balance) <= 0,
})}
>
<MonetaryDisplay amount={account.total_balance} />
{/* Financial Summary Section */}
<div className="flex flex-col md:flex-row rounded-lg border border-gray-200 bg-white flex-wrap">
<div className="flex-1 p-6 border-b md:border-r border-gray-200">
<div className="space-y-1">
<p className="text-sm font-medium text-gray-500">
{t("amount_due")}
</p>
<div className="flex items-end">
<p
className={cn("text-3xl font-bold", {
"text-red-500": Number(account.total_balance) > 0,
"text-green-700": Number(account.total_balance) <= 0,
})}
>
<MonetaryDisplay amount={account.total_balance} />
</p>
</div>
<p className="text-xs text-gray-500">
{Number(account.total_balance) >= 0
? t("pending_from_patient")
: t("overpaid_amount")}
</p>
</div>
<p className="text-xs text-gray-500">
{Number(account.total_balance) >= 0
? t("pending_from_patient")
: t("overpaid_amount")}
</p>
</div>
</div>

<div className="flex-1 p-6 border-b md:border-r border-gray-200">
<div className="space-y-1">
<p className="text-sm font-medium text-gray-500">
{t("total_paid")}
</p>
<div className="flex items-end">
<p className="text-3xl font-bold text-gray-900">
<MonetaryDisplay amount={account.total_paid} />
<div className="flex-1 p-6 border-b md:border-r border-gray-200">
<div className="space-y-1">
<p className="text-sm font-medium text-gray-500">
{t("total_paid")}
</p>
<div className="flex items-end">
<p className="text-3xl font-bold text-gray-900">
<MonetaryDisplay amount={account.total_paid} />
</p>
</div>
<p className="text-xs text-gray-500">
{t("payments_received")}
</p>
</div>
<p className="text-xs text-gray-500">{t("payments_received")}</p>
</div>
</div>

<div className="flex-1 p-6">
<div className="space-y-1">
<p className="text-sm font-medium text-gray-500">
{t("billed_gross")}
</p>
<div className="flex items-end">
<p className="text-3xl font-bold text-gray-900">
<MonetaryDisplay amount={account.total_gross} />
<div className="flex-1 p-6">
<div className="space-y-1">
<p className="text-sm font-medium text-gray-500">
{t("billed_gross")}
</p>
<div className="flex items-end">
<p className="text-3xl font-bold text-gray-900">
<MonetaryDisplay amount={account.total_gross} />
</p>
</div>
<p className="text-xs text-gray-500">
{t("total_billed_before_adjustments")}
</p>
</div>
<p className="text-xs text-gray-500">
{t("total_billed_before_adjustments")}
</p>
</div>
</div>
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 semantic heading hierarchy for accessibility.

The page hides its title (hideTitleOnPage) and major sections (Account Details at line 420, Financial Summary at line 525) lack semantic headings (h2, h3). This violates WCAG guidelines and makes screen reader navigation difficult in medical billing interfaces.

🔎 Recommended fix

Add semantic headings to major sections:

 <div className="bg-gray-100 p-3 space-y-4 rounded-lg">
+  <h2 className="sr-only">{t("account_details")}</h2>
   <div className="bg-gray-100 rounded-lg flex flex-col md:flex-row md:items-center justify-between gap-4">
     <div className="flex flex-col md:flex-row md:items-center gap-4 md:gap-6">
 {/* Financial Summary Section */}
+<h3 className="sr-only">{t("financial_summary")}</h3>
 <div className="flex flex-col md:flex-row rounded-lg border border-gray-200 bg-white flex-wrap">

Use sr-only class if you want headings invisible but accessible to screen readers, or make them visible for better UX.

As per coding guidelines: "Implement proper heading hierarchy (h1, h2, h3, etc.) in page components."

🤖 Prompt for AI Agents
src/pages/Facility/billing/account/AccountShow.tsx around lines 420-581: the
"Account Details" and "Financial Summary" sections are missing semantic
headings; add appropriate heading elements (e.g., h2 for each major section, h3
for subsections) immediately before the section container divs to establish a
proper heading hierarchy since the page title is hidden. If you need the
headings visually hidden, use the existing "sr-only" utility class so they
remain accessible to screen readers; ensure heading levels follow the page's
overall structure (no skipping levels) and update any nearby aria attributes or
landmarks if necessary.

Copilot AI review requested due to automatic review settings January 2, 2026 05:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";
import useAppHistory from "@/hooks/useAppHistory";
import { Separator } from "@radix-ui/react-separator";
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The import path suggests using @radix-ui/react-separator directly, but based on the project structure this should likely be @/components/ui/separator to maintain consistency with other UI component imports like the breadcrumb components above it.

Suggested change
import { Separator } from "@radix-ui/react-separator";
import { Separator } from "@/components/ui/separator";

Copilot uses AI. Check for mistakes.
function isResourceName(segment: string): boolean {
// Check if it's a known resource or follows kebab-case pattern
return (
/^[a-z_]+$/.test(segment) &&
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The regex pattern /^[a-z_]+$/ only matches lowercase letters and underscores, but the comment on line 49 mentions "kebab-case pattern" which includes hyphens. The pattern should be /^[a-z_-]+$/ to properly match kebab-case identifiers.

Suggested change
/^[a-z_]+$/.test(segment) &&
/^[a-z_-]+$/.test(segment) &&

Copilot uses AI. Check for mistakes.
Comment on lines 139 to 144
<span
onClick={() => goBack()}
className="text-sm text-gray-500 hover:cursor-pointer"
>
{t("back")}
</span>
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

This clickable span should be a button element for proper keyboard accessibility and semantic HTML. Replace the span with a button element and add appropriate styling to maintain the visual appearance.

Suggested change
<span
onClick={() => goBack()}
className="text-sm text-gray-500 hover:cursor-pointer"
>
{t("back")}
</span>
<button
type="button"
onClick={() => goBack()}
className="text-sm text-gray-500 hover:cursor-pointer bg-transparent border-0 p-0"
>
{t("back")}
</button>

Copilot uses AI. Check for mistakes.
@github-actions github-actions bot removed the Merge Conflict pull requests with merge conflict label Jan 2, 2026
Copy link
Member

@SiddanthNayak SiddanthNayak left a comment

Choose a reason for hiding this comment

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

Screenshot 2026-01-02 at 11 49 56 AM

Do we want breadcrumbs here? Looks kind of awkward. Patient Profile -> Clinical History

Also clicking on the breadcrumb breaks

Screen.Recording.2026-01-02.at.11.53.23.AM.mov

Copy link
Member

@nihal467 nihal467 left a comment

Choose a reason for hiding this comment

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

  • look into the issue flagged by @SiddanthNayak
  • there are PW test failing in the PR

Copy link
Member

@SiddanthNayak SiddanthNayak left a comment

Choose a reason for hiding this comment

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

Screen.Recording.2026-01-02.at.12.30.51.PM.mov

All breadcrumbs with Patient nav is failing.

Copilot AI review requested due to automatic review settings January 2, 2026 10:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.

if (SKIP_SEGMENTS.has(segment)) continue;

// Handle UUIDs - show as separate breadcrumb with formatted ID
if (isUuid(segment) && prevSegment && isResourceName(prevSegment)) {
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The condition checks if prevSegment is truthy and is a resource name, but prevSegment could be a string that passes the truthiness check even when it shouldn't be used as a resource name. Add an explicit check that prevSegment is not undefined or null before calling isResourceName.

Suggested change
if (isUuid(segment) && prevSegment && isResourceName(prevSegment)) {
if (isUuid(segment) && prevSegment !== null && isResourceName(prevSegment)) {

Copilot uses AI. Check for mistakes.

// Handle resource name followed by UUID
// Add the resource collection page (e.g., /billing/account)
if (isResourceName(segment) && nextSegment && isUuid(nextSegment)) {
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

Similar to the previous condition, nextSegment should be explicitly checked for undefined or null before calling isUuid. While the truthiness check may work, it's not explicit about the intent and could mask issues.

Suggested change
if (isResourceName(segment) && nextSegment && isUuid(nextSegment)) {
if (isResourceName(segment) && nextSegment != null && isUuid(nextSegment)) {

Copilot uses AI. Check for mistakes.
Comment on lines 141 to 146
<span
onClick={() => goBack()}
className="text-sm text-gray-500 hover:cursor-pointer"
>
{t("back")}
</span>
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The clickable span lacks keyboard accessibility. Convert this to a button element or add appropriate ARIA attributes and keyboard event handlers (onKeyDown) to support keyboard navigation. Healthcare applications must be fully keyboard accessible for clinical environments.

Suggested change
<span
onClick={() => goBack()}
className="text-sm text-gray-500 hover:cursor-pointer"
>
{t("back")}
</span>
<button
type="button"
onClick={() => goBack()}
className="text-sm text-gray-500 hover:cursor-pointer bg-transparent border-0 p-0"
>
{t("back")}
</button>

Copilot uses AI. Check for mistakes.
Comment on lines +153 to +156
<BreadcrumbLink
onClick={() => navigate(breadcrumb.href)}
className="underline text-black hover:cursor-pointer"
>
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The BreadcrumbLink component uses onClick for navigation but may not be properly configured for keyboard accessibility. Verify that the BreadcrumbLink component from shadcn/ui supports keyboard events, or explicitly add keyboard event handlers to ensure full keyboard navigation support.

Copilot uses AI. Check for mistakes.
Comment on lines +57 to +63
function formatIdLabel(id: string): string {
// Show first 4 and last 4 characters of UUID
if (id.length > 12) {
return `${id.slice(0, 4)}...${id.slice(-4)}`;
}
return id;
}
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The function name and comment mention UUID specifically, but the function accepts any string and only checks length. Either update the function signature to validate UUID format first, or update the documentation to clarify it handles any ID string regardless of format.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Breadcrumbs

3 participants