Conversation
There was a problem hiding this comment.
Pull Request Overview
This patch adds @MainActor annotations to view-related protocols and functions to ensure thread safety for UI operations in SwiftUI. It also introduces a new abbreviated weekday symbol format option.
- Add
@MainActorannotations to view protocols and functions for thread safety - Introduce new
abbreviatedcase toWeekdaySymbolFormatenum - Implement formatting logic for the new abbreviated weekday format
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Public+WeekdaysView.swift | Adds @MainActor to WeekdaysView protocol |
| Public+WeekdayLabel.swift | Adds @MainActor to WeekdayLabel protocol |
| Public+MonthLabel.swift | Adds @MainActor to MonthLabel protocol |
| Public+DayView.swift | Adds @MainActor to DayView protocol and body/function implementations |
| Public+View.swift | Adds @MainActor to erased() function |
| Public+WeekdaySymbolFormat.swift | Adds new abbreviated case to enum |
| MDateFormatter.swift | Implements formatting logic for abbreviated weekday symbols |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| static func getString(for weekday: MWeekday, format: WeekdaySymbolFormat) -> String { | ||
| switch format { | ||
| case .veryShort: return getFormatter().veryShortWeekdaySymbols[weekday.rawValue - 1].capitalized | ||
| case .abbreviated: return getFormatter().standaloneWeekdaySymbols[weekday.rawValue - 1].prefix(2).capitalized |
There was a problem hiding this comment.
The .capitalized method on String.SubSequence may not produce the expected result. Since prefix(2) returns a SubSequence, calling .capitalized might not properly capitalize only the first letter. Consider converting to String first: String(getFormatter().standaloneWeekdaySymbols[weekday.rawValue - 1].prefix(2)).capitalized
| case .abbreviated: return getFormatter().standaloneWeekdaySymbols[weekday.rawValue - 1].prefix(2).capitalized | |
| case .abbreviated: return String(getFormatter().standaloneWeekdaySymbols[weekday.rawValue - 1].prefix(2)).capitalized |
feat: