Skip to content

Minor Bug Fix & Bump Version#306

Merged
rtk-rnjn merged 13 commits intomainfrom
ui-fix
Mar 24, 2026
Merged

Minor Bug Fix & Bump Version#306
rtk-rnjn merged 13 commits intomainfrom
ui-fix

Conversation

@rtk-rnjn
Copy link
Copy Markdown
Owner

No description provided.

Arayauchiha and others added 5 commits March 23, 2026 22:48
Co-Authored-By: Ritik Ranjan <37435729+rtk-rnjn@users.noreply.github.com>
Co-Authored-By: Ritik Ranjan <37435729+rtk-rnjn@users.noreply.github.com>
Co-Authored-By: Ritik Ranjan <37435729+rtk-rnjn@users.noreply.github.com>
Co-Authored-By: Ritik Ranjan <37435729+rtk-rnjn@users.noreply.github.com>
Co-Authored-By: Ritik Ranjan <37435729+rtk-rnjn@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 23, 2026 23:10
@github-actions github-actions bot added swiftformat-pass Swiftformat Pass - Should only be auto assigned swiftlint-fail Swiftlint Fail - Should only be auto assigned labels Mar 23, 2026
Co-Authored-By: Ritik Ranjan <37435729+rtk-rnjn@users.noreply.github.com>
@github-actions github-actions bot added swiftlint-pass Swiftlint Pass - Should only be auto assigned and removed swiftlint-fail Swiftlint Fail - Should only be auto assigned labels Mar 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes and cleans up a broad set of SwiftUI screens while introducing new progress/HealthKit capabilities and bumping the marketing version to 0.21.

Changes:

  • Add a new ContentServiceHandler layer (plus extensions) for meal plan, exercises, and progress (steps/breathing/exercise completion), including HealthKit authorization and step-count background observation.
  • Update UI surfaces to consume new progress/nutrition inputs (e.g., dashboard diet card now supports “recommended” goal + experimental UI flag).
  • Large-scale formatting/style normalization (guards, imports, blank lines), plus removal of several DebugMenu components and related plumbing.

Reviewed changes

Copilot reviewed 150 out of 150 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
MomCare+/TriTrack Glance/Views/MediumWidgetView.swift Formatting cleanup (blank line removal).
MomCare+/TriTrack Glance/Views/LargeWidgetView.swift Guard formatting + minor layout whitespace cleanup.
MomCare+/TriTrack Glance/TriTrack_Glance.swift Formatting cleanup (blank line removal).
MomCare+/MomCare+/Views/TriTrackScreens/TriTrackView.swift Formatting + shared calendar expansion state usage.
MomCare+/MomCare+/Views/TriTrackScreens/TriTrackSymptomsSheetView.swift Formatting cleanup.
MomCare+/MomCare+/Views/TriTrackScreens/TriTrackSymptomsContentView.swift Guard formatting + whitespace cleanup.
MomCare+/MomCare+/Views/TriTrackScreens/TriTrackSymptomDetailView.swift Layout refactor/line splitting.
MomCare+/MomCare+/Views/TriTrackScreens/TriTrackCalendarItemContentView.swift Formatting cleanup.
MomCare+/MomCare+/Views/TriTrackScreens/TriTrackAddEditSymptomSheetView.swift Guard formatting + whitespace cleanup.
MomCare+/MomCare+/Views/TriTrackScreens/TriTrackAddCalendarItemSheetView.swift Formatting cleanup.
MomCare+/MomCare+/Views/TriTrackScreens/MapPickerView.swift Import ordering + whitespace cleanup.
MomCare+/MomCare+/Views/TriTrackScreens/EKReminderView.swift Import ordering + minor control-flow formatting.
MomCare+/MomCare+/Views/TriTrackScreens/EKEventView.swift Formatting cleanup.
MomCare+/MomCare+/Views/TriTrackScreens/Components/TriTrackRowLegendView.swift Formatting cleanup.
MomCare+/MomCare+/Views/TriTrackScreens/Components/TriTrackReminderRow.swift Guard formatting + minor style cleanup.
MomCare+/MomCare+/Views/TriTrackScreens/Components/TriTrackReminderDetailsContextView.swift Guard formatting + import ordering.
MomCare+/MomCare+/Views/TriTrackScreens/Components/TriTrackEventRow.swift Formatting cleanup.
MomCare+/MomCare+/Views/TriTrackScreens/Components/TriTrackEventDetailsContextView.swift Import ordering + whitespace cleanup.
MomCare+/MomCare+/Views/TriTrackScreens/Components/TriTrackAllSymptomsView.swift Guard formatting + whitespace cleanup.
MomCare+/MomCare+/Views/TriTrackScreens/Components/TriTrackAllRemindersView.swift Guard formatting + switch expression style cleanup.
MomCare+/MomCare+/Views/TriTrackScreens/Components/TriTrackAllCalendarItemView.swift Guard formatting + whitespace cleanup.
MomCare+/MomCare+/Views/ProfileScreens/ProfileView.swift Pass additional measurements into personal info view.
MomCare+/MomCare+/Views/ProfileScreens/ProfilePersonalInfoView.swift Personal info refactor: measurement fields + name parsing improvements.
MomCare+/MomCare+/Views/ProfileScreens/ProfileNotificationsView.swift Guard formatting + minor cleanup.
MomCare+/MomCare+/Views/ProfileScreens/ProfileMomCareWatchView.swift Formatting cleanup.
MomCare+/MomCare+/Views/ProfileScreens/ProfileHealthInfoView.swift Due date initialization + footer text; remove derived progress rows.
MomCare+/MomCare+/Views/ProfileScreens/ProfileAccountSecurityView.swift Apple identifier handling + security section restructuring.
MomCare+/MomCare+/Views/ProfileScreens/ProfileAccountManagementView.swift Formatting cleanup.
MomCare+/MomCare+/Views/ProfileScreens/Legal&Compliance/TermsOfServiceView.swift Formatting cleanup.
MomCare+/MomCare+/Views/ProfileScreens/Legal&Compliance/PrivacyPolicyView.swift Formatting cleanup.
MomCare+/MomCare+/Views/ProfileScreens/Legal&Compliance/GlobalRightsView.swift Formatting cleanup.
MomCare+/MomCare+/Views/ProfileScreens/AboutMomCare+/CreditsView.swift Formatting cleanup.
MomCare+/MomCare+/Views/ProfileScreens/AboutMomCare+/AboutUsView.swift Minor view-chain formatting.
MomCare+/MomCare+/Views/ProfileScreens/AboutMomCare+/AboutMomCareView.swift Import ordering + formatting cleanup.
MomCare+/MomCare+/Views/OnboardingScreens/SignUp/PreferencesSignUpView.swift Minor whitespace/guard formatting.
MomCare+/MomCare+/Views/OnboardingScreens/SignUp/HealthMetricsSignUpView.swift Guard formatting + missing selections formatting.
MomCare+/MomCare+/Views/OnboardingScreens/SignUp/BaseSignUpView.swift Conditional formatting + missing fields formatting.
MomCare+/MomCare+/Views/OnboardingScreens/SignInView.swift Conditional formatting cleanup.
MomCare+/MomCare+/Views/OnboardingScreens/OTPScreenView.swift Formatting cleanup.
MomCare+/MomCare+/Views/OnboardingScreens/OnboardingView.swift Formatting cleanup.
MomCare+/MomCare+/Views/MyPlanScreens/MyPlanView.swift Formatting cleanup.
MomCare+/MomCare+/Views/MyPlanScreens/MyPlanFoodItemSearchView.swift Guard formatting + minor conditional formatting.
MomCare+/MomCare+/Views/MyPlanScreens/MyPlanExercisePlanView.swift Refresh layout change + steps fetch onAppear.
MomCare+/MomCare+/Views/MyPlanScreens/MyPlanDietPlanView.swift Formatting cleanup.
MomCare+/MomCare+/Views/MyPlanScreens/Components/WaterIntake/WaterLogView.swift Guard formatting + minor UI cleanup.
MomCare+/MomCare+/Views/MyPlanScreens/Components/WaterIntake/WaterLogListView.swift Minor layout formatting + cleanup.
MomCare+/MomCare+/Views/MyPlanScreens/Components/WaterIntake/WaterLogEntry.swift Import ordering + guard formatting + small refactors.
MomCare+/MomCare+/Views/MyPlanScreens/Components/WaterIntake/WaterAnimationView.swift Guard formatting + whitespace cleanup.
MomCare+/MomCare+/Views/MyPlanScreens/Components/ExercisePlan/WeeklyProgressCardView.swift Guard formatting cleanup.
MomCare+/MomCare+/Views/MyPlanScreens/Components/ExercisePlan/WalkingHistoryView.swift Use shared calendar expansion state + add toolbar actions.
MomCare+/MomCare+/Views/MyPlanScreens/Components/ExercisePlan/WalkingCardView.swift Minor whitespace cleanup.
MomCare+/MomCare+/Views/MyPlanScreens/Components/ExercisePlan/MyPlanExerciseHelpView.swift Formatting cleanup.
MomCare+/MomCare+/Views/MyPlanScreens/Components/ExercisePlan/ExerciseInfoSheet.swift Formatting cleanup.
MomCare+/MomCare+/Views/MyPlanScreens/Components/ExercisePlan/ExerciseHistory.swift Use shared calendar expansion state + add toolbar actions.
MomCare+/MomCare+/Views/MyPlanScreens/Components/ExercisePlan/ExerciseCardView.swift Guard formatting cleanup.
MomCare+/MomCare+/Views/MyPlanScreens/Components/ExercisePlan/BreathingExerciseView.swift Guard formatting + small string literal style change.
MomCare+/MomCare+/Views/MyPlanScreens/Components/ExercisePlan/BreathingCardView.swift Formatting cleanup.
MomCare+/MomCare+/Views/MyPlanScreens/Components/DietPlan/VitalHistoryStore.swift Import ordering + switch-expression refactors.
MomCare+/MomCare+/Views/MyPlanScreens/Components/DietPlan/VitalDetailView.swift Minor computed property formatting + formatting cleanup.
MomCare+/MomCare+/Views/MyPlanScreens/Components/DietPlan/NutritionProgressCardHelpView.swift Formatting cleanup.
MomCare+/MomCare+/Views/MyPlanScreens/Components/DietPlan/NutritionGraphRootView.swift Import ordering + switch-expression refactors.
MomCare+/MomCare+/Views/MyPlanScreens/Components/DietPlan/MealTimelineCardView.swift Formatting cleanup.
MomCare+/MomCare+/Views/MyPlanScreens/Components/DietPlan/DietPlanHistory.swift Use shared calendar expansion state + add toolbar actions.
MomCare+/MomCare+/Views/MoodNestScreens/PlaylistCards.swift Formatting cleanup.
MomCare+/MomCare+/Views/MoodNestScreens/MusicPlayerView.swift Formatting cleanup.
MomCare+/MomCare+/Views/MoodNestScreens/MoodNestView.swift Minor view-chain formatting.
MomCare+/MomCare+/Views/MoodNestScreens/MoodNestSongsView.swift Formatting cleanup.
MomCare+/MomCare+/Views/MoodNestScreens/MoodNestPlaylistsView.swift Formatting cleanup.
MomCare+/MomCare+/Views/MoodNestScreens/MoodAnimation/SemiCircleAnimationView.swift Guard formatting cleanup.
MomCare+/MomCare+/Views/DebugScreens/PermissionsStatusView.swift Import ordering + switch-expression refactors.
MomCare+/MomCare+/Views/DebugScreens/OSLogView.swift Import ordering + switch-expression refactors.
MomCare+/MomCare+/Views/DebugScreens/NotificationTesterView.swift Switch-expression refactors.
MomCare+/MomCare+/Views/DebugScreens/LogsConsoleView.swift File contents removed (debug console functionality removed).
MomCare+/MomCare+/Views/DebugScreens/JSONTreeRow.swift JSON parsing refactor + guard formatting.
MomCare+/MomCare+/Views/DebugScreens/FeatureFlagsView.swift Introduce experimentalUI flag + new FeatureFlagState enum location.
MomCare+/MomCare+/Views/DebugScreens/DeviceInfoView.swift Import ordering + guard formatting.
MomCare+/MomCare+/Views/DebugScreens/DebugMenuView.swift Remove some debug sections/destinations.
MomCare+/MomCare+/Views/DebugScreens/DebugMenuStore.swift File contents removed (debug store functionality removed).
MomCare+/MomCare+/Views/DebugScreens/DataInspectorView.swift Guard formatting cleanup.
MomCare+/MomCare+/Views/DebugScreens/CrashSimulatorView.swift Remove debug logger usage + formatting cleanup.
MomCare+/MomCare+/Views/DebugScreens/AccessibilityInspectorView.swift Import ordering + formatting cleanup.
MomCare+/MomCare+/Views/DashboardScreens/DashboardView.swift Feed “recommended” nutrition goal + fetch steps onAppear.
MomCare+/MomCare+/Views/DashboardScreens/DashboardSnippets/DashboardWeekCardView.swift Formatting cleanup.
MomCare+/MomCare+/Views/DashboardScreens/DashboardSnippets/DashboardInsightCardView.swift Formatting cleanup.
MomCare+/MomCare+/Views/DashboardScreens/DashboardSnippets/DashboardExerciseCardView.swift Remove unused accessibility env vars + formatting cleanup.
MomCare+/MomCare+/Views/DashboardScreens/DashboardSnippets/DashboardEventCardView.swift Formatting cleanup.
MomCare+/MomCare+/Views/DashboardScreens/DashboardSnippets/DashboardDietCardView.swift Support experimental UI and “recommended” goal display/progress.
MomCare+/MomCare+/Views/AppCore/MomCareRootView.swift Remove unused env var + formatting cleanup.
MomCare+/MomCare+/Views/AppCore/MomCareMainTabView.swift Import ordering + error struct formatting + remove unused env object.
MomCare+/MomCare+/Views/AppCore/MomCareApp.swift Remove debug menu store injection + formatting cleanup.
MomCare+/MomCare+/Views/AppCore/Components/ReAuthenticationSheetView.swift Implement Apple re-auth flow + improved error handling.
MomCare+/MomCare+/View+UIKit/AppDelegate.swift Remove debug store wiring + formatting cleanup.
MomCare+/MomCare+/MomCare+.entitlements Enable HealthKit background delivery entitlement.
MomCare+/MomCare+/Handlers/MusicPlayerHandler.swift Guard formatting + minor refactor.
MomCare+/MomCare+/Handlers/EventKitHandler.swift Remove unused params/cancellables + formatting cleanup.
MomCare+/MomCare+/Handlers/ContentServiceHandler/StepDataPoint.swift New step history data type.
MomCare+/MomCare+/Handlers/ContentServiceHandler/ContentServiceHandler+Progress.swift New progress helpers (steps, breathing, weekly progress).
MomCare+/MomCare+/Handlers/ContentServiceHandler/ContentServiceHandler+MealPlan.swift New meal plan + HealthKit nutrition write helpers.
MomCare+/MomCare+/Handlers/ContentServiceHandler/ContentServiceHandler+HealthKit.swift New HealthKit auth + step observation/background delivery logic.
MomCare+/MomCare+/Handlers/ContentServiceHandler/ContentServiceHandler+Exercises.swift New exercise fetch/meta/update helpers.
MomCare+/MomCare+/Handlers/ContentServiceHandler/ContentServiceHandler.swift New content service observable state container.
MomCare+/MomCare+/Extensions/UserExerciseModel+ContentService.swift Guard formatting in async computed property.
MomCare+/MomCare+/Extensions/UIScreen+current.swift Guard formatting cleanup.
MomCare+/MomCare+/Extensions/Calendar+CompactCalendarView.swift Formatting cleanup.
MomCare+/Common/Utils.swift Change week range start day (firstWeekday) behavior.
MomCare+/Common/Static/TriTrackData.swift Guard formatting cleanup.
MomCare+/Common/Static/PregnancySymptoms.swift Formatting cleanup.
MomCare+/Common/Static/ModelSpecific/DietaryPreferenceData.swift Raw value simplification for vegan.
MomCare+/Common/Static/IndianStateData.swift Formatting cleanup.
MomCare+/Common/Models/UserModel.swift Conditional formatting cleanup.
MomCare+/Common/Models/SongModel.swift Guard formatting cleanup.
MomCare+/Common/Models/MealPlanModel.swift Remove redundant returns in computed/switch.
MomCare+/Common/KeychainHelper.swift Guard formatting cleanup.
MomCare+/Common/Extensions/URL+Normalization.swift Minor whitespace formatting.
MomCare+/Common/Extensions/Color+Hex.swift Split multi-declaration for clarity.
MomCare+/Common/Extensions/Array+Subscript.swift Minor whitespace formatting.
MomCare+/Common/Database.swift Add regex-based find helper + import ordering + guard formatting.
.swiftformat Expand enabled SwiftFormat rule set.
MomCare+/MomCare.xcodeproj/xcshareddata/xcschemes/TriTrack GlanceExtension.xcscheme Scheme option update (askForAppToLaunch).
MomCare+/MomCare.xcodeproj/project.pbxproj Bump MARKETING_VERSION to 0.21.
MomCare+/MomCare+/DataHandlers/NetworkManager.swift Remove debug menu plumbing + small refactors.
MomCare+/MomCare+/DataHandlers/NetworkLocalizedError.swift Switch-expression refactors + formatting cleanup.
MomCare+/MomCare+/DataHandlers/HTTPErrorResponse.swift Formatting cleanup + switch-expression refactors.
MomCare+/MomCare+/DataHandlers/Endpoint.swift Formatting cleanup.
MomCare+/MomCare+/DataHandlers/ContentRepository+Update.swift Minor whitespace formatting.
MomCare+/MomCare+/DataHandlers/ContentRepository.swift Remove redundant returns.
MomCare+/MomCare+/DataHandlers/AuthenticationService.swift Ensure credentials fetched after auth ops + fix credentials assignment bug.
MomCare+/MomCare+/Components/RingShape.swift Formatting cleanup.
MomCare+/MomCare+/Components/ReusableWrappers.swift Guard formatting cleanup.
MomCare+/MomCare+/Components/Onboarding/PickerViews/ValuePickerSheet.swift Formatting cleanup.
MomCare+/MomCare+/Components/Onboarding/PickerViews/StatePickerView.swift Formatting cleanup.
MomCare+/MomCare+/Components/Onboarding/PickerViews/MultiSelectPickerView.swift Guard formatting cleanup.
MomCare+/MomCare+/Components/Onboarding/PickerViews/CountryPickerView.swift Formatting cleanup.
MomCare+/MomCare+/Components/MultiPlatform/WatchConnector.swift Formatting cleanup.
MomCare+/MomCare+/Components/MoodNest/MoodResultViewModel.swift Formatting cleanup.
MomCare+/MomCare+/Components/LogSymptomIntent.swift Remove redundant return.
MomCare+/MomCare+/Components/LocationManager.swift Formatting cleanup.
MomCare+/MomCare+/Components/HapticsHandler.swift Formatting cleanup.
MomCare+/MomCare+/Components/ErrorAlertModifier.swift Formatting cleanup.
MomCare+/MomCare+/Components/ControlState.swift Formatting cleanup (constructor whitespace).
MomCare+/MomCare+/Components/Calendar/WeekStripView.swift Formatting cleanup.
MomCare+/MomCare+/Components/Calendar/MonthGridView.swift Guard/conditional formatting cleanup.
MomCare+/MomCare+/Components/Calendar/DayCell.swift Accessibility label formatting cleanup.
MomCare+/MomCare+/Components/Calendar/CompactCalendarView.swift Guard/conditional formatting cleanup.

Comment on lines +47 to +64
nonisolated func startStepCountObservation() async throws {
guard let stepType = HKQuantityType.quantityType(forIdentifier: .stepCount) else {
fatalError()
}

let now = Date()
let startOfDate = Calendar.current.startOfDay(for: now)
let predicate = HKQuery.predicateForSamples(withStart: startOfDate, end: now, options: .strictStartDate)

let query = HKObserverQuery(sampleType: stepType, predicate: predicate) { _, _, error in
if error != nil {
return
}
self.fetchTodaySteps()
}
healthStore.execute(query)
try await healthStore.enableBackgroundDelivery(for: stepType, frequency: .immediate)

Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

startStepCountObservation() sets up an HKObserverQuery but the update handler ignores the provided HKObserverQueryCompletionHandler (it must be called after processing). Without calling it, HealthKit may throttle/stop background deliveries. Also, fatalError() on missing .stepCount type will crash the app; return/throw an error instead.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Comment on lines +57 to +62
func markFoodsAs(consumed: Bool, mealType: MealType) async throws {
for foodReference in myPlanModel?[mealType] ?? [] {
Task {
try await markFoodAs(consumed: consumed, in: mealType, foodReference: foodReference)
}
}
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

markFoodsAs(consumed:mealType:) starts a new Task per item but never awaits them, so the function can return before any updates complete and any thrown errors are silently lost. This can also create a burst of concurrent HealthKit writes/network calls and races updating myPlanModel/meta. Prefer awaiting sequentially or using a withThrowingTaskGroup and awaiting completion before returning.

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +12
var shortLabel: String {
let fmt = DateFormatter()
fmt.dateFormat = "EEE"
return fmt.string(from: date)
}
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shortLabel creates a new DateFormatter every access. DateFormatters are relatively expensive and this will run for every point render. Consider using Date.FormatStyle or a cached/static formatter (and set locale/timeZone explicitly if needed).

Copilot uses AI. Check for mistakes.
Comment on lines +61 to +71
ToolbarItem(placement: .topBarTrailing) {
Button {
selectedDate = Date()
} label: {
Image(systemName: "\(Calendar.current.component(.day, from: Date())).calendar")
.font(.body)
.foregroundColor(Color.CustomColors.mutedRaspberry)
}
.accessibilityLabel(controlState.showingExpandedCalendar ? "Collapse calendar" : "Expand calendar")
.accessibilityIdentifier("expandCalendarButton")
}
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "jump to today" toolbar button reuses the calendar expand/collapse accessibility label and identifier (expandCalendarButton), which is misleading for VoiceOver and can break UI tests due to duplicate identifiers. Give this button its own label (e.g. "Jump to today") and a distinct identifier.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Comment on lines +99 to +109
ToolbarItem(placement: .topBarTrailing) {
Button {
selectedDate = Date()
} label: {
Image(systemName: "\(Calendar.current.component(.day, from: Date())).calendar")
.font(.body)
.foregroundColor(Color.CustomColors.mutedRaspberry)
}
.accessibilityLabel(controlState.showingExpandedCalendar ? "Collapse calendar" : "Expand calendar")
.accessibilityIdentifier("expandCalendarButton")
}
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "jump to today" toolbar button reuses the calendar expand/collapse accessibility label and identifier (expandCalendarButton). This is misleading for VoiceOver and duplicates identifiers in the toolbar. Use a distinct label/identifier for the today button.

Copilot uses AI. Check for mistakes.
Comment on lines +246 to +256
ToolbarItem(placement: .topBarTrailing) {
Button {
selectedDate = Date()
} label: {
Image(systemName: "\(Calendar.current.component(.day, from: Date())).calendar")
.font(.body)
.foregroundColor(Color.CustomColors.mutedRaspberry)
}
.accessibilityLabel(controlState.showingExpandedCalendar ? "Collapse calendar" : "Expand calendar")
.accessibilityIdentifier("expandCalendarButton")
}
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "jump to today" toolbar button reuses the calendar expand/collapse accessibility label and identifier (expandCalendarButton). This is misleading for VoiceOver and duplicates identifiers in the toolbar. Use a distinct label/identifier for the today button.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

@rtk-rnjn I've opened a new pull request, #307, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

@rtk-rnjn I've opened a new pull request, #308, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

@rtk-rnjn I've opened a new pull request, #309, to work on those changes. Once the pull request is ready, I'll request review from you.

…309)

* Initial plan

* Fix: only dismiss re-authentication sheet on successful Apple login

Co-authored-by: rtk-rnjn <37435729+rtk-rnjn@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rtk-rnjn/MomCare/sessions/47be7b1c-95f1-44bd-abed-f1357e87713c

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rtk-rnjn <37435729+rtk-rnjn@users.noreply.github.com>
@github-actions github-actions bot added the mergeable If all checks pass - Should only be auto assigned label Mar 23, 2026
* Initial plan

* Fix accessibility label and identifier for jump-to-today button in WalkingHistoryView

Co-authored-by: rtk-rnjn <37435729+rtk-rnjn@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rtk-rnjn/MomCare/sessions/20d46af5-8203-47ab-b8f9-5518d9d62bde

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rtk-rnjn <37435729+rtk-rnjn@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 23, 2026 23:22
… in startStepCountObservation (#307)

* Initial plan

* Fix startStepCountObservation: call completionHandler and use OSLog instead of fatalError

Co-authored-by: rtk-rnjn <37435729+rtk-rnjn@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rtk-rnjn/MomCare/sessions/d3252df0-6cec-42e5-8aca-a5fdf8f9a061

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rtk-rnjn <37435729+rtk-rnjn@users.noreply.github.com>
@github-actions github-actions bot added build-fail If build fails - Should only be auto assigned and removed build-pass labels Mar 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 150 out of 150 changed files in this pull request and generated 5 comments.

Comment on lines +110 to +116
) async throws {
guard let quantityType = HKQuantityType.quantityType(forIdentifier: quantityTypeIdentifier) else {
return
}

let calendar = Calendar.current
let start = calendar.startOfDay(for: Date())
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

writeHealthData saves HKQuantitySample entries spanning the entire day (startOfDaystartOfDay+1day). For incremental writes (e.g., logging food/water), this can distort time-based views and makes samples appear at midnight rather than when the user acted. Consider using Date() (or a passed-in timestamp) for start/end so samples reflect the actual event time.

Copilot uses AI. Check for mistakes.
static func weekRange(containing date: Date) -> [Date] {
var calendar = Calendar.current
calendar.firstWeekday = 2
calendar.firstWeekday = 1
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weekRange(containing:) hard-codes calendar.firstWeekday = 1, which forces a Sunday-based week regardless of the user’s locale/calendar settings. This can make “weekly” charts/calculations misaligned for users whose week starts on Monday (or other days). Prefer respecting Calendar.current.firstWeekday (i.e., don’t override it) unless there’s a strict product requirement.

Suggested change
calendar.firstWeekday = 1

Copilot uses AI. Check for mistakes.
Comment on lines +44 to +55
if let index = self.myPlanModel?[mealType].firstIndex(where: { $0.foodId == foodReference.foodId }) {
self.myPlanModel?[mealType][index].toggleConsume()
}

if let food = await foodReference.food {
try await consumeFoodInHealthKit(food, consume: consumed)
}

await fetchMyPlanMeta()

_ = try await ContentRepository.shared.markFoodAs(consumed: consumed, planId: myPlanModel._id, meal: mealType, foodId: foodReference.foodId)
}
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

markFoodAs(consumed:in:foodReference:) mutates local state and writes to HealthKit before the server call. If ContentRepository.shared.markFoodAs(...) fails, the method throws but the UI/HealthKit state has already been updated, leaving the app inconsistent with the backend. Consider either calling the server first, or adding a rollback/retry strategy when the network update fails.

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +8
final class ContentServiceHandler: ObservableObject {
// MARK: Lifecycle

Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ContentServiceHandler isn’t @MainActor, but many of its async methods assign to @Published properties (e.g., weeklyProgress, nutritionGoalTotals, todayFocusText). These functions can run off the main thread, which can trigger SwiftUI runtime warnings (“Publishing changes from background threads is not allowed”) and lead to racey UI updates. Consider marking the class (or mutation methods) as @MainActor, or wrapping @Published mutations in await MainActor.run { ... }.

Copilot uses AI. Check for mistakes.
Comment on lines 484 to 488
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 0.20;
MARKETING_VERSION = 0.21;
PRODUCT_BUNDLE_IDENTIFIER = com.Team05.MomCare;
PRODUCT_NAME = "$(TARGET_NAME)";
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR title suggests a “Minor Bug Fix”, but the diff includes broad refactors/feature work (new ContentServiceHandler, HealthKit integration, debug menu removals, extensive formatting churn) in addition to the version bump. Consider updating the PR title/description to reflect the actual scope so reviewers know what to focus on and risk is communicated accurately.

Copilot uses AI. Check for mistakes.
Co-Authored-By: Ritik Ranjan <37435729+rtk-rnjn@users.noreply.github.com>
@github-actions github-actions bot added build-pass and removed mergeable If all checks pass - Should only be auto assigned build-fail If build fails - Should only be auto assigned labels Mar 23, 2026
Co-Authored-By: Ritik Ranjan <37435729+rtk-rnjn@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 24, 2026 00:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@github-actions github-actions bot added mergeable If all checks pass - Should only be auto assigned swiftlint-fail Swiftlint Fail - Should only be auto assigned and removed swiftlint-pass Swiftlint Pass - Should only be auto assigned labels Mar 24, 2026
Co-Authored-By: Ritik Ranjan <37435729+rtk-rnjn@users.noreply.github.com>
@github-actions github-actions bot added swiftformat-fail Swiftformat Fail - Should only be auto assigned swiftlint-pass Swiftlint Pass - Should only be auto assigned and removed mergeable If all checks pass - Should only be auto assigned swiftformat-pass Swiftformat Pass - Should only be auto assigned swiftlint-fail Swiftlint Fail - Should only be auto assigned labels Mar 24, 2026
Co-Authored-By: Ritik Ranjan <37435729+rtk-rnjn@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 24, 2026 00:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@github-actions github-actions bot added swiftformat-pass Swiftformat Pass - Should only be auto assigned and removed swiftformat-fail Swiftformat Fail - Should only be auto assigned labels Mar 24, 2026
@rtk-rnjn rtk-rnjn merged commit f12b7d0 into main Mar 24, 2026
9 of 10 checks passed
@rtk-rnjn rtk-rnjn deleted the ui-fix branch March 24, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-pass swiftformat-pass Swiftformat Pass - Should only be auto assigned swiftlint-pass Swiftlint Pass - Should only be auto assigned

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants