chore: archive cleanup-debug-logging and complete-i18n-coverage proposals
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,30 +0,0 @@
|
|||||||
# Cleanup Debug Logging
|
|
||||||
|
|
||||||
## Problem Statement
|
|
||||||
|
|
||||||
The frontend codebase contains 60+ console.log and console.error statements scattered across components. These debug statements:
|
|
||||||
|
|
||||||
1. May expose sensitive information (tokens, user data, API responses) in browser console
|
|
||||||
2. Clutter the browser console in production
|
|
||||||
3. Impact performance from excessive logging
|
|
||||||
4. Present an unprofessional appearance to users who open developer tools
|
|
||||||
|
|
||||||
## Proposed Solution
|
|
||||||
|
|
||||||
1. Remove all unnecessary console.log/console.error statements
|
|
||||||
2. For essential logging, implement environment-aware logging that only outputs in development
|
|
||||||
3. Create a centralized logging utility that respects environment settings
|
|
||||||
|
|
||||||
## Affected Components
|
|
||||||
|
|
||||||
Key files with debug logging:
|
|
||||||
- `contexts/NotificationContext.tsx` - WebSocket event logging
|
|
||||||
- `contexts/ProjectSyncContext.tsx` - Debug logging functions
|
|
||||||
- `components/GanttChart.tsx` - Progress change logging
|
|
||||||
- Multiple other components with error logging
|
|
||||||
|
|
||||||
## Success Criteria
|
|
||||||
|
|
||||||
- No console.log statements in production build output
|
|
||||||
- Essential error logging preserved with environment checks
|
|
||||||
- All frontend tests continue to pass
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
## 1. Create Logging Utility
|
|
||||||
- [x] 1.1 Create `utils/logger.ts` with environment-aware logging
|
|
||||||
- [x] 1.2 Export debug, info, warn, error functions
|
|
||||||
- [x] 1.3 Only output logs when `import.meta.env.DEV` is true
|
|
||||||
|
|
||||||
## 2. Cleanup Context Files
|
|
||||||
- [x] 2.1 Remove/replace console statements in NotificationContext.tsx
|
|
||||||
- [x] 2.2 Remove/replace console statements in ProjectSyncContext.tsx
|
|
||||||
- [x] 2.3 Remove/replace console statements in AuthContext.tsx
|
|
||||||
|
|
||||||
## 3. Cleanup Component Files
|
|
||||||
- [x] 3.1 Remove/replace console statements in GanttChart.tsx
|
|
||||||
- [x] 3.2 Remove/replace console statements in CalendarView.tsx
|
|
||||||
- [x] 3.3 Audit and clean remaining components
|
|
||||||
|
|
||||||
## 4. Cleanup Page Files
|
|
||||||
- [x] 4.1 Remove/replace console statements in Tasks.tsx
|
|
||||||
- [x] 4.2 Remove/replace console statements in other page files
|
|
||||||
- [x] 4.3 Audit and clean remaining pages
|
|
||||||
|
|
||||||
## 5. Cleanup Service Files
|
|
||||||
- [x] 5.1 Remove/replace console statements in api.ts
|
|
||||||
- [x] 5.2 Audit and clean remaining services
|
|
||||||
|
|
||||||
## 6. Verification
|
|
||||||
- [x] 6.1 Run frontend build successfully
|
|
||||||
- [x] 6.2 Verify no console.log in production build
|
|
||||||
- [x] 6.3 Test error handling still works correctly
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
# Complete i18n Coverage
|
|
||||||
|
|
||||||
## Problem Statement
|
|
||||||
|
|
||||||
Several frontend components contain hardcoded English strings that are not internationalized. This breaks the multi-language support for users who prefer Chinese (Traditional) or other locales.
|
|
||||||
|
|
||||||
## Affected Components
|
|
||||||
|
|
||||||
1. **WeeklyReportPreview.tsx** (~20 hardcoded strings)
|
|
||||||
- Report labels, status names, error messages
|
|
||||||
- Date formatting uses hardcoded locale
|
|
||||||
|
|
||||||
2. **ReportHistory.tsx** (~10 hardcoded strings)
|
|
||||||
- History labels, loading states, empty states
|
|
||||||
|
|
||||||
3. **AuditPage.tsx** (~30 hardcoded strings in modal)
|
|
||||||
- Detail modal labels, verification modal text
|
|
||||||
- Field names, status messages
|
|
||||||
|
|
||||||
4. **WorkloadPage.tsx** (1 hardcoded error message)
|
|
||||||
|
|
||||||
## Proposed Solution
|
|
||||||
|
|
||||||
1. Add all missing translation keys to locale files
|
|
||||||
2. Replace hardcoded strings with `t()` function calls
|
|
||||||
3. Use dynamic locale for date formatting based on `i18n.language`
|
|
||||||
|
|
||||||
## Success Criteria
|
|
||||||
|
|
||||||
- All user-visible strings use i18n translation keys
|
|
||||||
- Both `en/common.json` and `zh-TW/common.json` contain all keys
|
|
||||||
- Date/time formatting respects user's language preference
|
|
||||||
- Frontend builds and functions correctly
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
## 1. WeeklyReportPreview i18n
|
|
||||||
- [x] 1.1 Add translation keys for report labels and status names
|
|
||||||
- [x] 1.2 Add translation keys for error and loading messages
|
|
||||||
- [x] 1.3 Replace hardcoded strings with t() calls
|
|
||||||
- [x] 1.4 Use dynamic locale for date formatting
|
|
||||||
|
|
||||||
## 2. ReportHistory i18n
|
|
||||||
- [x] 2.1 Add translation keys for history labels
|
|
||||||
- [x] 2.2 Add translation keys for loading/empty states
|
|
||||||
- [x] 2.3 Replace hardcoded strings with t() calls
|
|
||||||
|
|
||||||
## 3. AuditPage Modal i18n
|
|
||||||
- [x] 3.1 Add translation keys for detail modal labels
|
|
||||||
- [x] 3.2 Add translation keys for verification modal
|
|
||||||
- [x] 3.3 Add translation keys for field names and status messages
|
|
||||||
- [x] 3.4 Replace hardcoded strings with t() calls
|
|
||||||
|
|
||||||
## 4. WorkloadPage i18n
|
|
||||||
- [x] 4.1 Replace hardcoded error message with t() call
|
|
||||||
|
|
||||||
## 5. Update Locale Files
|
|
||||||
- [x] 5.1 Add all new keys to en/common.json
|
|
||||||
- [x] 5.2 Add all new keys to zh-TW/common.json
|
|
||||||
- [x] 5.3 Verify key structure consistency
|
|
||||||
|
|
||||||
## 6. Verification
|
|
||||||
- [x] 6.1 Test English locale displays correctly
|
|
||||||
- [x] 6.2 Test Chinese locale displays correctly
|
|
||||||
- [x] 6.3 Verify no untranslated strings remain
|
|
||||||
- [x] 6.4 Frontend builds successfully
|
|
||||||
Reference in New Issue
Block a user