Skip to content

Conversation

@KadariPavani
Copy link
Contributor

@KadariPavani KadariPavani commented Jan 11, 2026

Proposed Changes

Fixes #14999

  1. Removed the Loading component import and replaced it with the Skeleton component from @/components/ui/skeleton
  2. Created QueueManagementSkeleton component that mirrors the actual page layout with placeholders for:
  3. Header section: Back button, resource icon, resource name/date, and settings dropdown
  4. Auto-refresh toggle: Switch and label (responsive, hidden on mobile)
  5. Navigation tabs: Two tabs (Ongoing/Finished) with badge placeholders
  6. Queue content area: Three-column grid layout with multiple card skeletons representing the queue columns (Waiting, Called, etc.)
  7. Replaced the loading state on line 107 from to

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.
Screen.Recording.2026-01-11.094715.mp4

] Add or update Playwright tests for related changes

Summary by CodeRabbit

  • Style
    • Improved loading state visual experience with skeleton screens, replacing generic loading placeholders with polished skeleton UI for better visual feedback while content loads.

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

@KadariPavani KadariPavani requested review from a team and Copilot January 11, 2026 04:25
@netlify
Copy link

netlify bot commented Jan 11, 2026

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit ebc4371
🔍 Latest deploy log https://app.netlify.com/projects/care-ohc/deploys/6963263d9c024d000800f26f
😎 Deploy Preview https://deploy-preview-15095.preview.ohc.network
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 11, 2026

Walkthrough

Replaces generic loading spinners with a dedicated QueueManagementSkeleton component in the Queue Management page and its associated dialog. The skeleton renders page structure including headers, tabs, and content placeholders for improved visual feedback during data loading.

Changes

Cohort / File(s) Summary
Queue Management Loading Skeleton
src/pages/Facility/queues/ManageQueue.tsx
Introduces new QueueManagementSkeleton component that replaces the generic Loading placeholder in ManageQueuePage and ManageServicePointsDialog. Adds Skeleton UI component import and renders skeleton structures for page header, navigation tabs, and content areas to simulate the final layout during data loading.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: implementing a loading skeleton for the Queue Management page to fix issue #14999, which directly matches the changeset.
Description check ✅ Passed The description includes all key details: proposed changes with detailed component structure, merge checklist items marked, and demo video attached. Minor formatting inconsistency with missing checkbox but content is complete.
Linked Issues check ✅ Passed The PR fully addresses all coding requirements from issue #14999: replaces generic Loading spinner with QueueManagementSkeleton component, includes placeholders for header/tabs/queue columns, uses existing Skeleton component, and addresses the TODO comment at line 107.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing #14999: replacing the loading state with a skeleton component. No unrelated modifications to business logic, data fetching, or other features detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @src/pages/Facility/queues/ManageQueue.tsx:
- Around line 347-363: The loading branch renders DialogContent directly which
breaks dialog context; instead ensure the Dialog wrapper (and its DialogTrigger)
is always rendered and move the loading skeleton into DialogContent inside that
Dialog: in ManageQueue render the <Dialog> (with existing DialogTrigger)
regardless of allServicePoints, and when allServicePoints is falsy render the
skeleton UI inside the DialogContent component so the dialog open/close behavior
remains intact.
- Around line 292-334: In QueueManagementSkeleton, the Page component is
currently given title=" " (a single space); change this to the empty string
title="" so the intent of no title is explicit while keeping the existing
hideTitleOnPage prop; update the Page invocation that starts the component to
use title="" instead of " ".
📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1a62942 and ebc4371.

📒 Files selected for processing (1)
  • src/pages/Facility/queues/ManageQueue.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/Facility/queues/ManageQueue.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/queues/ManageQueue.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Use declarative JSX

Files:

  • src/pages/Facility/queues/ManageQueue.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/queues/ManageQueue.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/queues/ManageQueue.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/queues/ManageQueue.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/queues/ManageQueue.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/queues/ManageQueue.tsx
**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Use 2-space indentation

Files:

  • src/pages/Facility/queues/ManageQueue.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/queues/ManageQueue.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/queues/ManageQueue.tsx
**/*.{ts,tsx,js,jsx,json,css,scss,html}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation

Files:

  • src/pages/Facility/queues/ManageQueue.tsx
🧠 Learnings (16)
📚 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/queues/ManageQueue.tsx
📚 Learning: 2024-11-13T11:33:22.403Z
Learnt from: sainak
Repo: ohcnetwork/care_fe PR: 9079
File: src/components/Facility/ConsultationDetails/ConsultationNursingTab.tsx:93-117
Timestamp: 2024-11-13T11:33:22.403Z
Learning: In `src/components/Facility/ConsultationDetails/ConsultationNursingTab.tsx`, the parent component manages the loading state, so child components like `NursingPlot` should not implement their own loading indicators.

Applied to files:

  • src/pages/Facility/queues/ManageQueue.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/Facility/queues/ManageQueue.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, error, and success states for data fetching

Applied to files:

  • src/pages/Facility/queues/ManageQueue.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/pages/Facility/queues/ManageQueue.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 loading, error, and success states for async operations

Applied to files:

  • src/pages/Facility/queues/ManageQueue.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 lazy loading for heavy components within page components

Applied to files:

  • src/pages/Facility/queues/ManageQueue.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/queues/ManageQueue.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 healthcare-specific CAREUI custom components (Calendar, WeekdayCheckbox, Zoom) from `@/CAREUI/`

Applied to files:

  • src/pages/Facility/queues/ManageQueue.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/pages/Facility/queues/ManageQueue.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/queues/ManageQueue.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/pages/Facility/queues/ManageQueue.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: Applies to **/*.tsx : Use Shadcn UI components when available

Applied to files:

  • src/pages/Facility/queues/ManageQueue.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/**/*.{tsx,ts} : Use shadcn/ui as primary component system and CAREUI for healthcare-specific components

Applied to files:

  • src/pages/Facility/queues/ManageQueue.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/queues/ManageQueue.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/queues/ManageQueue.tsx
🧬 Code graph analysis (1)
src/pages/Facility/queues/ManageQueue.tsx (2)
src/components/Common/Page.tsx (1)
  • Page (16-34)
src/components/ui/dialog.tsx (2)
  • DialogContent (126-126)
  • DialogHeader (129-129)
⏰ 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). (10)
  • GitHub Check: build
  • GitHub Check: CodeQL analysis (javascript-typescript)
  • GitHub Check: Agent
  • GitHub Check: Redirect rules - care-ohc
  • GitHub Check: Header rules - care-ohc
  • GitHub Check: Pages changed - care-ohc
  • GitHub Check: CodeQL-Build
  • GitHub Check: Test
  • GitHub Check: OSSAR-Scan
  • GitHub Check: deploy-preview
🔇 Additional comments (2)
src/pages/Facility/queues/ManageQueue.tsx (2)

29-29: LGTM! Correct shadcn/ui Skeleton import.

The import follows the project's path alias pattern and coding guidelines for using shadcn/ui components.


107-107: Successfully replaces generic Loading with skeleton.

This change achieves the PR's primary objective of replacing the generic spinner with a skeleton loader that reflects the page layout. The early return pattern with the dedicated skeleton component is appropriate for the loading state.

Comment on lines +292 to +334
function QueueManagementSkeleton() {
return (
<Page title=" " hideTitleOnPage>
<div className="flex flex-col gap-6">
{/* Header Section */}
<div className="flex justify-between gap-3">
<div className="flex gap-2 items-center">
<Skeleton className="size-10 rounded-md" />
<div className="flex flex-col gap-2">
<Skeleton className="h-6 w-48" />
<Skeleton className="h-4 w-32" />
</div>
</div>
<div className="flex gap-5 items-center">
<div className="hidden sm:flex items-center gap-2">
<Skeleton className="h-5 w-10 rounded-full" />
<Skeleton className="h-4 w-24" />
</div>
<Skeleton className="size-10 rounded-md" />
</div>
</div>

{/* Tabs Section */}
<div className="flex flex-col gap-4">
<div className="flex gap-4 border-b">
<Skeleton className="h-10 w-32 mb-[-1px]" />
<Skeleton className="h-10 w-32 mb-[-1px]" />
</div>

{/* Content Area */}
<div className="space-y-4">
<Skeleton className="h-12 w-full rounded-lg" />
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<Skeleton className="h-64 w-full rounded-lg" />
<Skeleton className="h-64 w-full rounded-lg" />
<Skeleton className="h-64 w-full rounded-lg" />
</div>
</div>
</div>
</div>
</Page>
);
}
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 using empty string for title prop.

The skeleton component structure appropriately mirrors the page layout with header, tabs, and content placeholders. However, line 294 passes title=" " (a space) to avoid displaying a title.

♻️ Cleaner alternative
-    <Page title=" " hideTitleOnPage>
+    <Page title="" hideTitleOnPage>

Using an empty string is semantically clearer than a space character when no title is needed.

🤖 Prompt for AI Agents
In @src/pages/Facility/queues/ManageQueue.tsx around lines 292 - 334, In
QueueManagementSkeleton, the Page component is currently given title=" " (a
single space); change this to the empty string title="" so the intent of no
title is explicit while keeping the existing hideTitleOnPage prop; update the
Page invocation that starts the component to use title="" instead of " ".

Comment on lines 347 to 363
if (!allServicePoints) {
return <Loading />;
return (
<DialogContent className="max-w-md">
<DialogHeader>
<Skeleton className="h-6 w-48" />
</DialogHeader>
<div className="space-y-2">
{[...Array(3)].map((_, i) => (
<div key={i} className="flex items-center space-x-3 p-3">
<Skeleton className="size-4 rounded" />
<Skeleton className="h-4 flex-1" />
</div>
))}
</div>
</DialogContent>
);
}
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 | 🔴 Critical

Critical: DialogContent cannot function without Dialog wrapper.

The loading state returns DialogContent directly (lines 349-361), bypassing the Dialog and DialogTrigger components. This breaks the dialog's open/close functionality—when a user clicks the trigger during loading, nothing will happen because DialogContent requires the context provided by the parent Dialog component.

🔧 Proposed fix
   if (!allServicePoints) {
-    return (
+    return (
+      <Dialog {...props}>
+        <DialogTrigger asChild>{trigger}</DialogTrigger>
-      <DialogContent className="max-w-md">
-        <DialogHeader>
-          <Skeleton className="h-6 w-48" />
-        </DialogHeader>
-        <div className="space-y-2">
-          {[...Array(3)].map((_, i) => (
-            <div key={i} className="flex items-center space-x-3 p-3">
-              <Skeleton className="size-4 rounded" />
-              <Skeleton className="h-4 flex-1" />
-            </div>
-          ))}
-        </div>
-      </DialogContent>
+        <DialogContent className="max-w-md">
+          <DialogHeader>
+            <Skeleton className="h-6 w-48" />
+          </DialogHeader>
+          <div className="space-y-2">
+            {[...Array(3)].map((_, i) => (
+              <div key={i} className="flex items-center space-x-3 p-3">
+                <Skeleton className="size-4 rounded" />
+                <Skeleton className="h-4 flex-1" />
+              </div>
+            ))}
+          </div>
+        </DialogContent>
+      </Dialog>
     );
   }

This maintains the proper Dialog → DialogTrigger → DialogContent structure so the dialog can open and display the loading skeleton.

🤖 Prompt for AI Agents
In @src/pages/Facility/queues/ManageQueue.tsx around lines 347 - 363, The
loading branch renders DialogContent directly which breaks dialog context;
instead ensure the Dialog wrapper (and its DialogTrigger) is always rendered and
move the loading skeleton into DialogContent inside that Dialog: in ManageQueue
render the <Dialog> (with existing DialogTrigger) regardless of
allServicePoints, and when allServicePoints is falsy render the skeleton UI
inside the DialogContent component so the dialog open/close behavior remains
intact.

@github-actions
Copy link

🚀 Preview Deployment Ready!

Name Details
🔗 Preview URL https://8c6f84a5.care-preview-a7w.pages.dev
📝 Commit ebc4371
🌐 Environment pr-15095

This preview will be automatically updated when you push new commits to this PR.

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 replaces the generic Loading component with custom skeleton loaders for the Queue Management page to provide better visual feedback during data loading. The implementation adds two skeleton components: QueueManagementSkeleton for the main page and an inline skeleton for the ManageServicePointsDialog.

Changes:

  • Removed the generic Loading component import and replaced with Skeleton component from shadcn/ui
  • Created QueueManagementSkeleton component that mirrors the page layout (header, tabs, content grid)
  • Added skeleton loading state for ManageServicePointsDialog with checkboxes and labels
  • Updated loading conditions to use the new skeleton components

Comment on lines +293 to +294
return (
<Page title=" " hideTitleOnPage>
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

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

The Page component is being passed an empty string as the title. While hideTitleOnPage is true, this could cause issues for SEO and accessibility. Consider passing a meaningful title string or using a constant like "Loading..." that is localized using i18next, e.g., title={t("loading")}.

Suggested change
return (
<Page title=" " hideTitleOnPage>
const { t } = useTranslation();
return (
<Page title={t("loading")} hideTitleOnPage>

Copilot uses AI. Check for mistakes.
Comment on lines +324 to +327
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<Skeleton className="h-64 w-full rounded-lg" />
<Skeleton className="h-64 w-full rounded-lg" />
<Skeleton className="h-64 w-full rounded-lg" />
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

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

The skeleton structure doesn't accurately represent the actual page content. The actual page shows a two-column layout within the QueueColumn component (Waiting and Called+Now Serving), but the skeleton shows a generic three-column grid. Consider updating the skeleton to better match the actual queue management layout with labeled columns like the real content.

Suggested change
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<Skeleton className="h-64 w-full rounded-lg" />
<Skeleton className="h-64 w-full rounded-lg" />
<Skeleton className="h-64 w-full rounded-lg" />
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
<Skeleton className="h-64 w-full rounded-lg" />
<Skeleton className="h-64 w-full rounded-lg" />

Copilot uses AI. Check for mistakes.
return (
<DialogContent className="max-w-md">
<DialogHeader>
<Skeleton className="h-6 w-48" />
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

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

The DialogHeader wrapper is missing a DialogTitle component, which is important for accessibility. Screen readers rely on proper dialog titles. The skeleton should either include a DialogTitle wrapper around the Skeleton or use a visually hidden title for accessibility purposes.

Suggested change
<Skeleton className="h-6 w-48" />
<DialogTitle>
<Skeleton className="h-6 w-48" />
</DialogTitle>

Copilot uses AI. Check for mistakes.
Comment on lines +293 to +294
return (
<Page title=" " hideTitleOnPage>
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

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

The skeleton loading state should include an aria-label or aria-busy attribute to inform screen reader users that content is loading. This is important for accessibility compliance in healthcare applications. Consider adding aria-busy="true" and aria-label="Loading queue management" attributes to the skeleton container or Page component.

Suggested change
return (
<Page title=" " hideTitleOnPage>
const { t } = useTranslation();
return (
<Page
title=" "
hideTitleOnPage
aria-busy="true"
aria-label={t("queue_management.loading_label", {
defaultValue: "Loading queue management",
})}
>

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

🎭 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: #4522

@KadariPavani
Copy link
Contributor Author

@gauritejusa @yash-learner @Jacobjeevan

Could you please review this pr?

@github-actions github-actions bot added needs-triage question Further information is requested labels Jan 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add loading skeleton for Queue Management page

1 participant