Teetsh frontend code review for React/TypeScript PRs. Reviews component architecture, React Query, twin.macro styling, i18n, accessibility, responsive design, and testing...
Perform thorough frontend code reviews for the Teetsh React/TypeScript codebase.
Before reviewing, gather context:
Based on the review type, read appropriate references:
references/common-mistakes.md for Teetsh-specific antipatternsreferences/react-patterns.mdreferences/react-query.mdreferences/styling.mdreferences/i18n.mdreferences/testing.mdFull PR Review: Check all aspects - architecture, implementation, styling, i18n, tests
Component Review: Focus on patterns, props typing, accessibility, responsive design
Query Review: Focus on query keys, serializers, error handling, mutations
Styling Review: Focus on twin.macro usage, theme constants, responsive classes
Organize feedback by priority:
Security vulnerabilities, broken functionality, accessibility blockers, data loss risks
Missing error/loading states, incorrect patterns, i18n gaps, test gaps
Code clarity, performance optimizations, better patterns
Well-designed components, good test coverage, clean patterns
For each issue, provide:
Check adherence to Teetsh patterns:
useUser, useSchoolSchoolyear)useXxx)tw="lg:flex"), use useIsBelowBreakpoint only when layouts differ completely[schoolyearId, schoolId, KEY_CONSTANT, ...params]staleTime for data typeAxiosError typingtw macro, not className stringsthemeConstants.ts, never hardcodedcss={[tw..., condition && tw...]}`FormGrouplg: breakpoint for desktopuseTranslation(['namespace']) with namespace arraynamespace:section.keyformat() utility with localehtmlForComponent.browser.test.tsxutils.test.tsxit('should return X when Y')Structure your review as:
## Critical Issues
[Issues that must be fixed before merge]
## Important Issues
[Issues that should be fixed]
## Suggestions
[Optional improvements]
## Positive Feedback
[What was done well]
For each issue:
### [Area]: [Brief description]
**Problem**: [What's wrong and why it matters]
**Current code**:
```tsx
[Show problematic code]
Suggested fix:
[Show corrected code]
Reference: [Link to specific pattern]
## Example Review Snippets
### Missing FormGroup Wrapper
Problem: Form inputs should be wrapped with FormGroup for consistent styling and accessibility
Current code:
<Input
id="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
/>
Suggested fix:
<FormGroup
id="email"
label={t('common:form.email')}
error={errors.email}
>
<Input
id="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
hasError={!!errors.email}
/>
</FormGroup>
Reference: See references/styling.md - FormGroup Pattern
### Query Key Missing Dependencies
Problem: Query key must include schoolyearId and schoolId for proper cache isolation
Current code:
useQuery({
queryKey: [STUDENTS_KEY, classId],
queryFn: () => getStudents(classId),
});
Suggested fix:
const { schoolyear, school } = useSchoolSchoolyear();
useQuery({
queryKey: [schoolyear.id, school.id, STUDENTS_KEY, classId],
queryFn: () => getStudents({ schoolyearId: schoolyear.id, schoolId: school.id, classId }),
});
Reference: See references/react-query.md - Query Key Structure
### Hardcoded String
Problem: All user-facing text must use i18n for localization support
Current code:
<Button>Delete</Button>
Suggested fix:
const { t } = useTranslation(['common']);
<Button>{t('common:buttons.delete')}</Button>
Reference: See references/i18n.md - Translation Usage
### Using className Instead of tw
Problem: Project uses twin.macro for Tailwind, not className strings
Current code:
<div className="flex items-center gap-2">
Suggested fix:
<div tw="flex items-center gap-2">
Reference: See references/styling.md - twin.macro Usage
## When NOT to Comment
Avoid feedback on:
- Trivial formatting issues (Prettier handles this)
- Personal style preferences not in project patterns
- Nitpicks that don't affect functionality or maintainability
- Issues already addressed in other comments
## Multi-file Review Strategy
For PRs with many files:
1. Start with architecture overview (new containers, major changes)
2. Review core component/container logic first
3. Review queries and data handling
4. Review styling and i18n
5. Review tests
6. Summarize overall assessment
## After Review
If significant issues found:
- Summarize the most important themes
- Suggest whether changes are required before merge
- Offer to explain any patterns or practices in detail