Enhance ChoresPage accessibility and functionality

- Added ARIA roles and attributes to buttons and modals for improved accessibility.
- Updated chore types and properties in the Chore interface to allow for null values.
- Refactored chore loading and filtering logic to handle edge cases and improve performance.
- Enhanced calendar and list views with better user feedback for empty states and loading indicators.
- Improved styling for mobile responsiveness and dark mode support.

These changes aim to enhance user experience, accessibility, and maintainability of the ChoresPage component.
This commit is contained in:
mohamad 2025-06-01 22:00:11 +02:00
parent 843b3411e4
commit 5cb13862ef
2 changed files with 1085 additions and 465 deletions

File diff suppressed because it is too large Load Diff

View File

@ -5,12 +5,12 @@ export type ChoreType = 'personal' | 'group'
export interface Chore { export interface Chore {
id: number id: number
group_id?: number group_id?: number | null
name: string name: string
description?: string description?: string | null
created_by_id: number created_by_id: number
frequency: ChoreFrequency frequency: ChoreFrequency
custom_interval_days?: number custom_interval_days?: number | null
next_due_date: string next_due_date: string
last_completed_at?: string last_completed_at?: string
created_at: string created_at: string
@ -22,36 +22,23 @@ export interface Chore {
email: string email: string
} }
assignments?: ChoreAssignment[] assignments?: ChoreAssignment[]
is_completed: boolean
completed_at: string | null
} }
export interface ChoreCreate { export interface ChoreCreate extends Omit<Chore, 'id'> { }
name: string
description?: string
frequency: ChoreFrequency
custom_interval_days?: number
next_due_date: string
type: ChoreType
group_id?: number
}
export interface ChoreUpdate { export interface ChoreUpdate extends Partial<ChoreCreate> { }
name?: string
description?: string
frequency?: ChoreFrequency
custom_interval_days?: number
next_due_date?: string
type?: ChoreType
group_id?: number
}
// Chore Assignment Types // Chore Assignment Types
export interface ChoreAssignment { export interface ChoreAssignment {
id: number id: number
chore_id: number chore_id: number
assigned_to_user_id: number assigned_to_id: number
assigned_by_id: number
due_date: string due_date: string
is_complete: boolean is_complete: boolean
completed_at?: string completed_at: string | null
created_at: string created_at: string
updated_at: string updated_at: string
chore?: Chore chore?: Chore
@ -60,11 +47,11 @@ export interface ChoreAssignment {
export interface ChoreAssignmentCreate { export interface ChoreAssignmentCreate {
chore_id: number chore_id: number
assigned_to_user_id: number assigned_to_id: number
due_date: string due_date: string
} }
export interface ChoreAssignmentUpdate { export interface ChoreAssignmentUpdate {
is_complete?: boolean
due_date?: string due_date?: string
is_complete?: boolean
} }