Fix widget layout clipping and add comprehensive widget previews
- Fix LargeVotingView mood icons getting clipped at edges by using flexible HStack spacing with maxWidth: .infinity - Fix VotingView medium layout with smaller icons and even distribution - Add comprehensive #Preview macros for all widget states: - Vote widget: small/medium, voted/not voted, all mood states - Timeline widget: small/medium/large with various data states - Reduce icon sizes and padding to fit within widget bounds - Update accessibility labels and hints across views 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -277,6 +277,7 @@ struct EntryDetailView: View {
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: 34, height: 34)
|
||||
.foregroundColor(.white)
|
||||
.accessibilityLabel(currentMood.strValue)
|
||||
}
|
||||
.shadow(color: moodColor.opacity(0.4), radius: 8, x: 0, y: 4)
|
||||
|
||||
@@ -304,8 +305,12 @@ struct EntryDetailView: View {
|
||||
ForEach(Mood.allValues) { mood in
|
||||
Button {
|
||||
// Update local state immediately for instant feedback
|
||||
withAnimation(.easeInOut(duration: 0.15)) {
|
||||
if UIAccessibility.isReduceMotionEnabled {
|
||||
selectedMood = mood
|
||||
} else {
|
||||
withAnimation(.easeInOut(duration: 0.15)) {
|
||||
selectedMood = mood
|
||||
}
|
||||
}
|
||||
// Then persist the change
|
||||
onMoodUpdate(mood)
|
||||
@@ -320,6 +325,7 @@ struct EntryDetailView: View {
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: 28, height: 28)
|
||||
.foregroundColor(currentMood == mood ? .white : .gray)
|
||||
.accessibilityLabel(mood.strValue)
|
||||
)
|
||||
|
||||
Text(mood.strValue)
|
||||
|
||||
Reference in New Issue
Block a user