Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR adjusts the SwiftUI layout of the message header details to improve horizontal alignment of header content (sender/recipients and date) by switching to a Grid-based layout.
Changes:
- Replaced the
VStack-stackedRecipientLabelrows + dateHStackwith aGridcontaining alignedGridRows. - Updated
RecipientLabelto render as aGridRowand tweaked recipient text display (avoid showing email twice when name == email).
Comments suppressed due to low confidence (1)
Mail/Views/Thread/Message/MessageHeader/MessageHeaderDetailView.swift:70
.onPreferenceChange(ViewWidthKey.self)now only updateslabelWidth, but that state isn't read anywhere in the view hierarchy anymore. This can be removed to avoid extra layout passes/state updates.
.onPreferenceChange(ViewWidthKey.self) {
labelWidth = $0
}
| Text(title) | ||
| .textStyle(.bodySmallSecondary) | ||
| .background(ViewGeometry(key: ViewWidthKey.self, property: \.size.width)) | ||
| .frame(width: labelWidth, alignment: .leading) | ||
| VStack(alignment: .leading, spacing: 4) { |
There was a problem hiding this comment.
ViewGeometry(key: ViewWidthKey.self, ...) looks like leftover from the old fixed-label-width approach. If you remove the ViewWidthKey preference handling (since Grid aligns columns automatically), you can also drop this geometry measurement to reduce layout overhead.
| @State private var labelWidth: CGFloat = 100 | ||
|
|
There was a problem hiding this comment.
labelWidth is no longer used to drive any layout (the RecipientLabel binding/frame was removed), so keeping it as @State just adds unnecessary state and view invalidations. Consider removing labelWidth entirely along with the preference-driven width measurement if the Grid alignment is now sufficient.



No description provided.