-
Notifications
You must be signed in to change notification settings - Fork 204
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
Feature/timetable feature fixes #48
Conversation
… feature/timetable-feature-fixes
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.
Thx!!
I left some comments ✍️
public var startsTimeString: String | ||
public var endsTimeString: String | ||
public var items: [TimetableItem] |
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.
These properties should be let
.
because these don't change without constructor.
// TODO: The actual class will look more like this | ||
// public abstract val id: TimetableItemId | ||
// public abstract val title: MultiLangText | ||
// public abstract val startsAt: Instant | ||
// public abstract val endsAt: Instant | ||
// public abstract val category: TimetableCategory | ||
// public abstract val sessionType: TimetableSessionType | ||
// public abstract val room: TimetableRoom | ||
// public abstract val targetAudience: String | ||
// public abstract val language: TimetableLanguage | ||
// public abstract val asset: TimetableAsset | ||
// public abstract val levels: PersistentList<String> | ||
// public abstract val speakers: PersistentList<TimetableSpeaker> |
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.
What is the meaning of these🤨?
Who are these comments for???
the production codes is not needed some comment-out codes I think🤔?
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.
These were mostly for me. I can remove them.
This is based off of the existing object from the 2023 build. I was expecting to have to change to these objects later but I can just adjust to the object we get when the backend api is up and running.
Text(tagText).foregroundColor (highlight ? Color.green : Color.gray) | ||
}.padding(EdgeInsets(top: 2,leading: 7,bottom: 2,trailing: 7)).border(highlight ? Color.green : Color.gray).padding(-2) | ||
Text(tagText).foregroundColor (highlight ? Color.green : Color(.onSurfaceColorset)) | ||
}.padding(EdgeInsets(top: 2,leading: 7,bottom: 2,trailing: 7)).border(highlight ? Color.green : Color(.onSurfaceColorset)).padding(-2) |
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 want linebreak plz🙏
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.
will do
let startsAt: String | ||
let endsAt: 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.
These should change to Date type I recommend.
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 was expecting it to change to "instant" type but I can change to Date for now and swap out (or convert?) later.
self.items = items | ||
} | ||
} | ||
|
||
public struct TimetableItem: Equatable, Hashable { |
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.
The struct will needs convert from KMP right?
Such processing should be handled in a separate file, such as Middleware, so it seems better to separate this struct into another file.
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.
Ok, I will move this do another file for now. Its likely to get replaced in the future either way.
Co-authored-by: Hiroya Hinomori <nexearth@gmail.com>
…gi/conference-app-2024 into feature/timetable-feature-fixes
@MrSmart00 Responded to your comments. Thanks! |
|
||
public init(timetableItems: [TimetableItem]? = []) { | ||
public init(timetableItems: [TimetableTimeGroupItems]? = []) { |
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.
Sorry, I missed a comment for here🙏
public init(timetableItems: [TimetableTimeGroupItems]? = []) { | |
public init(timetableItems: [TimetableTimeGroupItems] = []) { |
I think the optional setting is meaningless.
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.
After all this time, I think TimetableReducer would be an appropriate file name.
@@ -78,8 +110,12 @@ struct TagView: View { | |||
Image(systemName: "diamond.fill").resizable().frame(width: 11,height: 11).foregroundColor(.green) | |||
.padding(-3) | |||
} | |||
Text(tagText).foregroundColor (highlight ? Color.green : Color.gray) | |||
}.padding(EdgeInsets(top: 2,leading: 7,bottom: 2,trailing: 7)).border(highlight ? Color.green : Color.gray).padding(-2) | |||
Text(tagText).foregroundColor(highlight ? Color.green : Color(.onSurfaceColorset)) |
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.
Can green also be replaced by color set?
Co-authored-by: Usuda Shin <59346949+shin-usu@users.noreply.github.com>
…gi/conference-app-2024 into feature/timetable-feature-fixes
// | ||
// File.swift | ||
// | ||
// | ||
// Created by CHARLES BOND on 2024/06/16. | ||
// | ||
|
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 think this header comment is unnecessary.
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.
Sorry it was automatic
public struct SampleData { | ||
public let day1Results = [ |
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.
This sample data is only used in this module, right?
If so, I think that accessors should be at the internal level.
Responded to comments cc @MrSmart00 @shin-usu |
//TODO: This object is likely to change a lot when we get live data changes | ||
} | ||
|
||
internal struct SampleData { |
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.
Thank you for the correction!
By the way, Swift's default accessor is internal, so there is no need to explicitly describe it.
internal struct SampleData { | |
struct SampleData { |
} | ||
|
||
internal struct SampleData { | ||
public let day1Results = [ |
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.
Please change this to the internal level, too🙏🏻
And please make same corrections to the other sample data.
@@ -15,7 +15,8 @@ public struct TimetableView: View { | |||
Button(action: { | |||
store.send(.selectDay(tabItem)) | |||
}, label: { | |||
Text(tabItem.rawValue).foregroundColor(.green) | |||
//TODO: Only selected button should be green and underlined | |||
Text(tabItem.rawValue).foregroundColor(Color(.greenSelectColorset)) |
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.
There are still a few areas that are foregroundColor.
Please change to foregroundStyle.
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.
THX!!!
I left some comments 👍
struct TimeGroupMiniList: View { | ||
let contents: TimetableTimeGroupItems | ||
|
||
public var body: some 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.
public var body: some View { | |
var body: some View { |
You should match the accessors to set them as default.👍
@@ -75,11 +107,15 @@ struct TagView: View { | |||
public var body: some 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.
public var body: some View { | |
var body: some View { |
@@ -90,15 +126,15 @@ struct PhotoView: View { | |||
|
|||
public var body: some 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.
public var body: some View { | |
var body: some View { |
@@ -35,15 +38,41 @@ public struct TimetableListView: View { | |||
} | |||
|
|||
public var body: some 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.
This View class accessor should be default👍
public var body: some View { | |
var body: some View { |
Reduce { state, action in | ||
switch action { | ||
case .onAppear: | ||
state.timetableItems = SampleData.init().day1Results |
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.
SampleData should be a member property👍
ex)
public struct TimetableReducer {
let sample = SampleData()
...
public var body: some Reducer<State, Action> {
Reducer{ state, action in
switch action {
case .onAppear:
state.timetableItems = sample.day1Results
..
@@ -8,7 +8,7 @@ final class TimetableTests: XCTestCase { | |||
TimetableReducer() | |||
} | |||
await store.send(.onAppear) { | |||
$0.timetableItems = SampleData.init().day1Data | |||
$0.timetableItems = SampleData.init().day1Results |
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.
$0.timetableItems = SampleData.init().day1Results | |
$0.timetableItems = SampleData().day1Results |
This is more like Swift👍
@MrSmart00 @shin-usu Responded to your comments, thanks! |
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.
THX🙏
I left some comments!
check them please!
LazyVStack { | ||
ForEach(store.timetableItems, id: \.self) { item in | ||
TimeGroupMiniList(contents: item) | ||
} | ||
}.scrollContentBackground(.hidden) | ||
|
||
.onAppear { | ||
store.send(.onAppear) | ||
}.background(Color(.backgroundColorset)) |
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 think this style difficult for review...
you should alignment with indent.
could you fix them to below?
LazyVStack { | |
ForEach(store.timetableItems, id: \.self) { item in | |
TimeGroupMiniList(contents: item) | |
} | |
}.scrollContentBackground(.hidden) | |
.onAppear { | |
store.send(.onAppear) | |
}.background(Color(.backgroundColorset)) | |
LazyVStack { | |
ForEach(store.timetableItems, id: \.self) { item in | |
TimeGroupMiniList(contents: item) | |
} | |
} | |
.scrollContentBackground(.hidden) | |
.onAppear { | |
store.send(.onAppear) | |
} | |
.background(Color(.backgroundColorset)) |
}.foregroundStyle(Color(.onSurfaceColorset)).padding(10) | ||
.overlay( | ||
RoundedRectangle(cornerRadius: 5) | ||
.stroke(Color.gray, lineWidth: 1) | ||
.stroke(Color(.onSurfaceColorset), lineWidth: 1) | ||
) |
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.
VStack(alignment: .leading) {
...
}
.foregroundStyle(Color(.onSurfaceColorset)).padding(10)
.overlay(
RoundedRectangle(cornerRadius: 5)
.stroke(Color(.onSurfaceColorset), lineWidth: 1)
)
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.
LGTM👍👍
Issue
Overview (Required)
TODO
Links
Screenshot (Optional if screenshot test is present or unrelated to UI)
Movie (Optional)