Add pulsing icon for residences with overdue tasks

- Add overdueCount field to ResidenceResponse model
- ResidenceCard shows PulsingIconView when residence has overdue tasks
- SummaryCard uses static CaseraIconView (never pulses)
- APILayer refreshes residence data after task completion to update
  overdue counts and animation state

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-07 12:19:28 -06:00
parent 9d6e7c4f2a
commit bb4ff216b1
7 changed files with 343 additions and 20 deletions

View File

@@ -17410,6 +17410,10 @@
"comment" : "A button label that says \"Mark Task In Progress\".",
"isCommentAutoGenerated" : true
},
"MyCrib Icon Animations" : {
"comment" : "The title of the playground interface.",
"isCommentAutoGenerated" : true
},
"Need inspiration?" : {
},
@@ -21334,6 +21338,10 @@
},
"Remove User" : {
},
"Replay" : {
"comment" : "A button that replays the current animation.",
"isCommentAutoGenerated" : true
},
"Reset Password" : {
"comment" : "The title of the screen where users can reset their passwords.",

View File

@@ -3,24 +3,27 @@ import ComposeApp
struct ResidenceCard: View {
let residence: ResidenceResponse
/// Check if this residence has any overdue tasks
private var hasOverdueTasks: Bool {
Int(residence.overdueCount) > 0
}
var body: some View {
VStack(alignment: .leading, spacing: AppSpacing.md) {
// Header with property type icon
// Header with property type icon (pulses when overdue tasks exist)
HStack(spacing: AppSpacing.sm) {
VStack {
Image("house_outline")
.resizable()
.frame(width: 44, height: 44)
.foregroundColor(Color.appTextOnPrimary)
.background(content: {
RoundedRectangle(cornerRadius: AppRadius.sm)
.fill(LinearGradient(colors: [Color.appPrimary, Color.appPrimary.opacity(0.8)], startPoint: .topLeading, endPoint: .bottomTrailing))
.frame(width: 44, height: 44)
.shadow(color: Color.appPrimary.opacity(0.3), radius: 6, y: 3)
})
.padding([.trailing], AppSpacing.md)
if hasOverdueTasks {
PulsingIconView()
.frame(width: 44, height: 44)
.padding([.trailing], AppSpacing.md)
} else {
CaseraIconView()
.frame(width: 44, height: 44)
.padding([.trailing], AppSpacing.md)
}
Spacer()
}
@@ -132,6 +135,7 @@ struct ResidenceCard: View {
purchasePrice: nil,
isPrimary: true,
isActive: true,
overdueCount: 1,
createdAt: "2024-01-01T00:00:00Z",
updatedAt: "2024-01-01T00:00:00Z"
))

View File

@@ -7,8 +7,9 @@ struct SummaryCard: View {
var body: some View {
VStack(spacing: 16) {
HStack {
Image(systemName: "chart.bar.doc.horizontal")
.font(.title3)
CaseraIconView()
.frame(width: 32, height: 32)
Text("Overview")
.font(.title3)
.fontWeight(.bold)