Sangeetha-Grantha

Metadata Value
Status Active
Version 1.1.0
Last Updated 2026-09-10
Author Sangeetha Grantha Team
Document Type Evidence record

Frontend Pages Refactoring Checklist


[!NOTE] Historical evidence: results, counts, commands, and observations below belong to the original work described here. The editorial update date is not a new test or corpus verification. For present behavior, use current quality checks.

Related Review: frontend-pages-code-review.md Scope: All pages in modules/frontend/sangita-admin-web/src/pages/


Priority 1: Critical (KrithiEditor + ReferenceData + Cross-Cutting)

1.1 KrithiEditor.tsx Refactoring

See detailed checklist: krithi-editor-refactor-checklist.md

Summary: 47 P1 items including tab extraction, TypeScript interfaces, useReducer implementation, and business logic extraction.


1.2 ReferenceData.tsx Decomposition

1.2.1 Remove Duplicate Type Definitions

1.2.2 Extract Entity Form Component

1.2.3 Extract Form Input Components

1.2.4 Extract Data Mappers

1.2.5 Consolidate Validation Logic

1.2.6 Simplify Entity CRUD Logic

1.2.7 Fix TypeScript Issues


1.3 Cross-Cutting: Remove All any Types

Frontend-wide Type Cleanup


1.4 Cross-Cutting: Standardize Error Handling

Create Error Handling Utilities

Apply to Each Page


Priority 2: High (BulkImport + ImportReview + Modals)

2.1 BulkImport.tsx Improvements

2.1.1 Extract Action Handler

2.1.2 Extract Modal Components

2.1.3 Improve Polling

2.1.4 Remove Console Logs


2.2 ImportReview.tsx Improvements

2.2.1 Add JSON Validation

2.2.2 Improve Bulk Operations

2.2.3 Consolidate Form State


2.3 Create Accessible Modal Component

2.3.1 Build Modal Infrastructure

2.3.2 Create Confirmation Modal


2.4 Implement Request Cancellation

2.4.1 Add AbortController Support

2.4.2 Apply to Pages


Priority 3: Medium (Minor Pages + Accessibility)

3.1 TagsPage.tsx Cleanup


3.2 ImportsPage.tsx Cleanup


3.3 Dashboard.tsx Improvements


3.4 AutoApproveQueue.tsx Cleanup


3.5 KrithiList.tsx Cleanup


3.6 Accessibility Improvements

Add ARIA Attributes

Keyboard Navigation


Priority 4: Nice-to-Have (Polish)

4.1 Performance Optimizations

Add React.memo

Add useCallback

Add useMemo

Add Virtualization


4.2 UX Improvements

Skeleton Loaders

Optimistic Updates


4.3 Code Style Consistency

Naming Conventions

Clean Up


File Structure After Refactoring

src/
├── pages/
│   ├── AutoApproveQueue.tsx      # ~150 lines
│   ├── BulkImport.tsx            # ~400 lines
│   ├── Dashboard.tsx             # ~150 lines
│   ├── ImportReview.tsx          # ~300 lines
│   ├── ImportsPage.tsx           # ~200 lines
│   ├── KrithiEditor.tsx          # ~200 lines (orchestration)
│   ├── KrithiList.tsx            # ~150 lines
│   ├── ReferenceData.tsx         # ~300 lines (orchestration)
│   ├── RolesPage.tsx             # Placeholder
│   ├── TagsPage.tsx              # ~250 lines
│   └── UsersPage.tsx             # Placeholder
├── components/
│   ├── form/
│   │   ├── FormInput.tsx
│   │   ├── FormTextarea.tsx
│   │   ├── FormSelect.tsx
│   │   ├── FormCheckbox.tsx
│   │   └── index.ts
│   ├── Modal.tsx
│   ├── ConfirmationModal.tsx
│   ├── Skeleton.tsx
│   ├── krithi-editor/
│   │   ├── MetadataTab.tsx
│   │   ├── StructureTab.tsx
│   │   ├── LyricsTab.tsx
│   │   ├── TagsTab.tsx
│   │   ├── AuditTab.tsx
│   │   └── index.ts
│   ├── reference-data/
│   │   ├── EntityForm.tsx
│   │   ├── EntityList.tsx
│   │   └── index.ts
│   ├── bulk-import/
│   │   ├── TaskLogDrawer.tsx
│   │   ├── DeleteConfirmModal.tsx
│   │   ├── BatchTable.tsx
│   │   └── index.ts
│   └── dashboard/
│       ├── StatCard.tsx
│       ├── RecentItem.tsx
│       └── index.ts
├── hooks/
│   ├── useKrithiEditorReducer.ts
│   ├── useKrithiData.ts
│   ├── useReferenceData.ts
│   ├── useEntityCrud.ts
│   ├── useBatchActions.ts
│   ├── useAbortController.ts
│   └── index.ts
├── utils/
│   ├── error-handler.ts
│   ├── reference-data-mappers.ts
│   ├── reference-data-validation.ts
│   ├── krithi-mapper.ts
│   └── index.ts
└── types/
    ├── api-params.ts
    ├── form-state.ts
    ├── krithi-editor.types.ts
    └── index.ts

Progress Tracking

Priority Section Total Items Completed %
P1 KrithiEditor 47 0 0%
P1 ReferenceData 32 0 0%
P1 Remove any Types 8 0 0%
P1 Standardize Errors 11 0 0%
P2 BulkImport 16 0 0%
P2 ImportReview 7 0 0%
P2 Modal Component 12 0 0%
P2 Request Cancellation 8 0 0%
P3 TagsPage 4 0 0%
P3 ImportsPage 4 0 0%
P3 Dashboard 4 0 0%
P3 AutoApproveQueue 4 0 0%
P3 KrithiList 2 0 0%
P3 Accessibility 8 0 0%
P4 Performance 8 0 0%
P4 UX (Skeletons) 6 0 0%
P4 Code Style 4 0 0%
TOTAL   185 0 0%

Definition of Done

For each checklist item:

  1. Code compiles without TypeScript errors
  2. No any types (where applicable)
  3. Unit tests pass (where applicable)
  4. Component renders correctly
  5. No console errors/warnings
  6. Accessibility checked (keyboard, screen reader)
  7. Code reviewed

Suggested Execution Order

Phase 1: Foundation (Weeks 1-2)

  1. Create shared form components with types
  2. Create error handling utility
  3. Create Modal/ConfirmationModal
  4. Create useAbortController hook

Phase 2: Critical Pages (Weeks 3-5)

  1. Refactor KrithiEditor (largest effort)
  2. Refactor ReferenceData
  3. Apply new components to both

Phase 3: Secondary Pages (Weeks 6-7)

  1. Improve BulkImport
  2. Improve ImportReview
  3. Apply ConfirmationModal everywhere

Phase 4: Polish (Week 8)

  1. Clean up minor pages
  2. Add accessibility
  3. Performance optimizations
  4. Documentation

Section index · Documentation home · Feature status