diff --git a/fe/src/pages/ChoresPage.vue b/fe/src/pages/ChoresPage.vue index 15f4e30..2952a03 100644 --- a/fe/src/pages/ChoresPage.vue +++ b/fe/src/pages/ChoresPage.vue @@ -1,10 +1,10 @@ @@ -338,19 +430,35 @@ const toggleCompletion = async (chore: ChoreWithCompletion) => { {{ formatDateHeader(group.date) }} - + - - {{ chore.name }} - + + + {{ chore.name }} + + + Group + Overdue + Due + Today + + + {{ chore.description }} {{ chore.subtext }} + + 📋 + + + 📅 + {{ t('choresPage.edit', 'Edit') }} @@ -460,6 +568,113 @@ const toggleCompletion = async (chore: ChoreWithCompletion) => { + + + + + + {{ selectedChore?.name }} + + × + + + + + Details + + + Type: + {{ selectedChore.type === 'group' ? 'Group' : 'Personal' }} + + + Created by: + {{ selectedChore.creator?.name || selectedChore.creator?.email || 'Unknown' + }} + + + Due date: + {{ format(new Date(selectedChore.next_due_date), 'PPP') }} + + + Frequency: + + {{selectedChore?.frequency === 'custom' && selectedChore?.custom_interval_days + ? `Every ${selectedChore.custom_interval_days} days` + : frequencyOptions.find(f => f.value === selectedChore?.frequency)?.label || selectedChore?.frequency + }} + + + + Description: + {{ selectedChore.description }} + + + + + + Assignments + Loading... + + No assignments found for this chore. + + + + + {{ assignment.assigned_user?.name || assignment.assigned_user?.email + }} + + {{ assignment.is_complete ? '✅ Completed' : '⏳ Pending' }} + + + + Due: {{ format(new Date(assignment.due_date), 'PPP') }} + + Completed: {{ format(new Date(assignment.completed_at), 'PPP') }} + + + + + + + + + + + + + + + History: {{ selectedChore?.name }} + + × + + + + Loading history... + + No history found for this chore. + + + + + {{ formatHistoryEntry(entry) }} + + + Details + {{ JSON.stringify(entry.event_data, null, 2) }} + + + + + + + + + @@ -679,4 +894,212 @@ const toggleCompletion = async (chore: ChoreWithCompletion) => { transform: scaleX(1); transform-origin: left; } + +/* New styles for enhanced UX */ +.chore-main-info { + display: flex; + align-items: center; + gap: 0.5rem; + flex-wrap: wrap; +} + +.chore-badges { + display: flex; + gap: 0.25rem; +} + +.badge { + font-size: 0.75rem; + padding: 0.125rem 0.375rem; + border-radius: 0.25rem; + font-weight: 500; + text-transform: uppercase; + letter-spacing: 0.025em; +} + +.badge-group { + background-color: #3b82f6; + color: white; +} + +.badge-overdue { + background-color: #ef4444; + color: white; +} + +.badge-due-today { + background-color: #f59e0b; + color: white; +} + +.chore-description { + font-size: 0.875rem; + color: var(--dark); + opacity: 0.8; + margin-top: 0.25rem; + font-style: italic; +} + +/* Status-based styling */ +.status-overdue { + border-left: 4px solid #ef4444; +} + +.status-due-today { + border-left: 4px solid #f59e0b; +} + +.status-completed { + opacity: 0.7; +} + +/* Modal styles */ +.detail-modal .modal-container, +.history-modal .modal-container { + max-width: 600px; + max-height: 80vh; + overflow-y: auto; +} + +.detail-section { + margin-bottom: 1.5rem; +} + +.detail-section h4 { + margin-bottom: 0.75rem; + font-weight: 600; + color: var(--dark); + border-bottom: 1px solid #e5e7eb; + padding-bottom: 0.25rem; +} + +.detail-grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 0.75rem; +} + +.detail-item { + display: flex; + flex-direction: column; + gap: 0.25rem; +} + +.detail-item.full-width { + grid-column: 1 / -1; +} + +.detail-item .label { + font-weight: 600; + font-size: 0.875rem; + color: var(--dark); + opacity: 0.8; +} + +.detail-item .value { + font-size: 0.875rem; + color: var(--dark); +} + +.assignments-list { + display: flex; + flex-direction: column; + gap: 0.75rem; +} + +.assignment-item { + padding: 0.75rem; + border: 1px solid #e5e7eb; + border-radius: 0.5rem; + background-color: #f9fafb; +} + +.assignment-main { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 0.5rem; +} + +.assigned-user { + font-weight: 500; + color: var(--dark); +} + +.assignment-status { + font-size: 0.875rem; + padding: 0.25rem 0.5rem; + border-radius: 0.25rem; + background-color: #fbbf24; + color: white; +} + +.assignment-status.completed { + background-color: #10b981; +} + +.assignment-details { + display: flex; + flex-direction: column; + gap: 0.25rem; + font-size: 0.875rem; + color: var(--dark); + opacity: 0.8; +} + +.history-list { + display: flex; + flex-direction: column; + gap: 0.5rem; +} + +.history-item { + padding: 0.75rem; + border-left: 3px solid #e5e7eb; + background-color: #f9fafb; + border-radius: 0 0.25rem 0.25rem 0; +} + +.history-text { + font-size: 0.875rem; + color: var(--dark); +} + +.history-data { + margin-top: 0.5rem; +} + +.history-data details { + font-size: 0.75rem; +} + +.history-data summary { + cursor: pointer; + color: var(--primary); + font-weight: 500; +} + +.history-data pre { + margin-top: 0.25rem; + padding: 0.5rem; + background-color: #f3f4f6; + border-radius: 0.25rem; + font-size: 0.75rem; + overflow-x: auto; +} + +.loading-spinner { + text-align: center; + padding: 1rem; + color: var(--dark); + opacity: 0.7; +} + +.no-data { + text-align: center; + padding: 1rem; + color: var(--dark); + opacity: 0.7; + font-style: italic; +}
{{ JSON.stringify(entry.event_data, null, 2) }}