fix: volunteer queue-flow regressions, missing translations, and notification handling inconsistencies in the frontend
Merge Request
Overview
This MR fixes volunteer queue-flow regressions, missing translations, and notification handling inconsistencies in the frontend.
It addresses three primary issues:
- queue filters and labels still contained hardcoded English or missing locale strings
- verify-medicines flow was updating patients to the wrong next status and redirecting incorrectly
- consultation waiting queue regression caused
in_consultationpatients to remain visible in the waiting queue UI - notification flow inconsistently used
useAlertReplacementinstead of standardizedtoastusage fromsonner - TypeScript error
TS2552inAppLayoutdue to undefinedaddNotification
This change is needed to ensure:
- correct volunteer queue progression
- proper localized UI text in English / Hindi / Telugu
- consistent notification handling
- removal of queue-flow regressions
- clean TypeScript compilation
What does this MR do and why?
Motivation
The volunteer queue workflow depends on accurate queue transitions and clear localized labels.
The branch had regressions causing:
- patients appearing in wrong queues
- wrong redirection after medicine verification
- untranslated queue labels
- TypeScript build failures
- inconsistent alert / toast patterns
This reduced confidence in volunteer workflows and introduced compilation issues.
Approach Taken
This MR intentionally keeps the scope focused and minimal:
- fix affected queue transitions only
- restore intended waiting vs in-consultation split
- replace hardcoded queue labels with i18n keys
- standardize toast notifications using
sonner - remove unnecessary wrapper hook
- update regression tests
Trade-offs
- no full app-wide i18n cleanup
- no global notification architecture refactor
- existing test warnings remain but tests pass
Changes Made
Files Modified
src/components/PatientCard.tsxsrc/components/QueueDisplay.tsxsrc/locales/en/translations.jsonsrc/locales/hi/translations.jsonsrc/locales/te/translations.jsonsrc/pages/DashboardPage.tsxsrc/pages/volunteer/ConsultationQueuePage.tsxsrc/pages/volunteer/CounselingQueuePage.tsxsrc/pages/volunteer/KYPQueuePage.tsxsrc/pages/volunteer/MedicinePickupQueuePage.tsxsrc/pages/volunteer/PrescriptionsQueuePage.tsxsrc/pages/volunteer/VerifyMedicinesPage.tsxsrc/pages/volunteer/VerifyMedicinesQueuePage.tsxsrc/pages/volunteer/VitalsQueuePage.tsxsrc/pages/volunteer/VitalsWaitingQueuePage.tsxsrc/components/AppLayout.tsxtests/PatientCard.test.tsxtests/pages/DashboardPage.test.tsxtests/unit/components/ConsultationQueuePage.test.tsxtests/volunteers/VerifyMedicinesPage.test.tsxCHANGELOG.md
Functional Changes
- replaced hardcoded queue labels with i18n lookups
- added missing translations in:
- English
- Hindi
- Telugu
- fixed leaf-key i18n lookups
- verify-medicines now updates status to
counselling - verify flow redirects correctly to verify queue
- consultation waiting queue now shows only
waiting -
in_consultationpatients stay in dedicated page - replaced
useAlertReplacementwith directtoast - fixed
TS2552undefinedaddNotification
New Components / Hooks / Utilities
No new components introduced.
Removed unnecessary wrapper:
useAlertReplacement
API Endpoint Changes
No endpoint changes.
Existing queue status update endpoint now uses correct status value:
counselling
Configuration Changes
None
Technical Details
Root Causes
- object-root i18n keys rendered incorrectly
- hardcoded queue labels
- wrong verify queue transition
- consultation queue mixed
waiting+in_consultation - inconsistent alert abstraction
- undefined notification reference in layout
How the Fix Addresses It
- uses leaf i18n keys
- restores waiting-only consultation queue
- updates verify flow to correct next status
- standardizes
toastusage - removes wrapper hook complexity
- resolves TS compile issue
Architecture Decisions
- standardize notifications using
sonner - keep existing queue architecture
- minimal focused regression fix
- preserve existing routing structure
State Management Approach
- page-local state preserved
- TanStack Query unchanged
- direct toast invocation for notifications
Component Structure and Data Flow
- queue pages render correct filtered statuses
- verify flow updates status then redirects
- shared queue components use i18n-backed labels
- notifications use direct toast calls
Type of Change
-
🐛 Bug fix -
✨ New feature -
💥 Breaking change -
📝 Documentation update -
🎨 UI/UX improvement -
♻ ️ Refactor -
⚡ Performance improvement -
🧪 Test update -
🔧 Configuration change -
🚨 Security fix
Related Issues / References
- Related to queue progression regressions
- Related to i18n volunteer flow issues
- Related to notification handling cleanup
Screenshots or Screen Recordings
| Before | After |
|---|---|
| in_consultation visible in waiting queue | shown only in dedicated queue |
| verify flow → wrong queue | verify flow → verify queue |
| hardcoded English labels | translated queue labels |
| wrapper alerts | direct toast notifications |
How to Set Up and Validate Locally
Setup
bun install
bun dev
Validate Queue Flow
- open volunteer dashboard
- start consultation
- confirm patient leaves waiting queue
- open verify medicines queue
- complete verification
- confirm status →
counselling - confirm redirect stays in verify queue
Validate i18n
Switch language:
- Hindi
- Telugu
Validate:
- queue labels
- filter labels
- dropdowns
Validate Notifications
Trigger flows that previously used alerts:
- KYP page
- AppLayout notifications
- medicine pickup
Confirm toast notifications render correctly.
Testing Done
-
Manual testing completed -
Unit tests added/updated
Test Cases Covered
| Scenario | Expected Result | Status |
|---|---|---|
| waiting queue filter | only waiting patients | |
| verify status update | moves to counselling | |
| verify redirect | verify queue | |
| i18n labels | translated | |
| TypeScript build | passes | |
| test suite | passes |
Code Quality Checklist
-
follows conventions -
no console/debugger -
no unused code -
types correct -
errors toasted properly -
i18n fixes added -
CHANGELOG updated
Known Limitations / Technical Debt
- no full i18n audit
- pre-existing warnings remain:
- React
act(...) - Radix dialog warnings
- jsdom navigation warnings
- React
Additional Notes
This MR is intentionally minimal and focused on:
- queue regressions
- i18n fixes
- toast standardization
- TS error resolution
No backend or config changes required.
MR Acceptance Checklist
-
queue transitions fixed -
waiting queue restored -
verify flow corrected -
i18n labels fixed -
TS build error resolved -
tests passing