-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Active poll history UI (PSG-906) #7267
Conversation
21689e4
to
c7c3b85
Compare
Codecov ReportBase: 11.83% // Head: 11.94% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #7267 +/- ##
===========================================
+ Coverage 11.83% 11.94% +0.10%
===========================================
Files 1630 1637 +7
Lines 160317 160581 +264
Branches 65489 65618 +129
===========================================
+ Hits 18977 19184 +207
- Misses 140701 140758 +57
Partials 639 639
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good 👏, some thoughts inline, nothing major though :)
let enumeratedPolls = Array(viewModel.viewState.polls.enumerated()) | ||
|
||
ForEach(enumeratedPolls, id: \.offset) { _, pollData in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems more sensible to make PollListData
conform to Identifiable
(using the poll start event ID presumably) than enumerating them just for an index which is potentially an unstable ID for the poll if the order changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PollListData
is totally a mock for now.
This will change a lot in next PRs I guess...
struct PollListData { | ||
let startDate: Date | ||
let question: String | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably go in PollHistoryModels
fwiw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fell like dumb data model can stay in the same file of the view that consumes them.
Doing so you have everything you need to work on the component in a single file.
I'm not against moving it btw.
|
||
import SwiftUI | ||
|
||
struct SegmentedPicker<Tag: Hashable>: View { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah its a shame we can't use a custom PickerStyle
here to get voiceover support for free. Looks to be a private API for now 😕
Should probably add the necessary accessibility modifiers to the segments to communicate what is/isn't selected for now I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah its a shame we can't use a custom PickerStyle here to get voiceover support for free. Looks to be a private API for now
Yeah, I tried that before I invented a new component.
Apple you need to do the right thing here! 😄
Added the accessibility labels btw: 5735b5d
RiotSwiftUI/Modules/Room/PollHistory/View/SegmentedPicker.swift
Outdated
Show resolved
Hide resolved
.font(isSelectedSegment ? theme.fonts.headline : theme.fonts.body) | ||
.underline(isSelectedSegment) | ||
} | ||
.accentColor(isSelectedSegment ? theme.colors.accent : theme.colors.primaryContent) | ||
.accessibilityLabel(segment.description + (isSelectedSegment ? "-selected" : "")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be wrong, but maybe you can use .accessibilityValue
here for selected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UI tests (like they are now) fail switching to .accessibilityValue
.
Why do you think it would be a better option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed here -> 25a52a2
Kudos, SonarCloud Quality Gate passed! |
This PR:
Result