Skip to content
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

Merged
merged 19 commits into from
Jun 26, 2024
Merged

Conversation

charles-b-stb
Copy link
Contributor

Issue

  • close #ISSUE_NUMBER

Overview (Required)

  • Added better fake data
  • Adjusted layout to handle time blocks
  • Updated colors to better match other layouts and design

TODO

  • Still need to update tabs to highlight/de-highlight correctly
  • No live data connections yet
  • Scrolling also needs adjustment as it cuts off at the bottom

Links

Screenshot (Optional if screenshot test is present or unrelated to UI)

Before After
スクリーンショット 2024-06-04 0 36 17 スクリーンショット 2024-06-15 12 23 47

Movie (Optional)

Before After

Copy link
Contributor

@MrSmart00 MrSmart00 left a 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 ✍️

Comment on lines 60 to 62
public var startsTimeString: String
public var endsTimeString: String
public var items: [TimetableItem]
Copy link
Contributor

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.

Comment on lines 88 to 100
// 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>
Copy link
Contributor

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🤔?

Copy link
Contributor Author

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want linebreak plz🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

Comment on lines 74 to 75
let startsAt: String
let endsAt: String
Copy link
Contributor

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.

Copy link
Contributor Author

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 {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@charles-b-stb
Copy link
Contributor Author

@MrSmart00 Responded to your comments. Thanks!


public init(timetableItems: [TimetableItem]? = []) {
public init(timetableItems: [TimetableTimeGroupItems]? = []) {
Copy link
Contributor

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🙏

Suggested change
public init(timetableItems: [TimetableTimeGroupItems]? = []) {
public init(timetableItems: [TimetableTimeGroupItems] = []) {

I think the optional setting is meaningless.

Copy link
Contributor

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))
Copy link
Contributor

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?

charles-b-stb and others added 3 commits June 18, 2024 21:25
Co-authored-by: Usuda Shin <59346949+shin-usu@users.noreply.github.com>
…gi/conference-app-2024 into feature/timetable-feature-fixes
Comment on lines 1 to 7
//
// File.swift
//
//
// Created by CHARLES BOND on 2024/06/16.
//

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it was automatic

Comment on lines 53 to 54
public struct SampleData {
public let day1Results = [
Copy link
Contributor

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.

@charles-b-stb
Copy link
Contributor Author

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 {
Copy link
Contributor

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.

Suggested change
internal struct SampleData {
struct SampleData {

}

internal struct SampleData {
public let day1Results = [
Copy link
Contributor

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))
Copy link
Contributor

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.

Copy link
Contributor

@MrSmart00 MrSmart00 left a 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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public var body: some View {
var body: some View {

@@ -90,15 +126,15 @@ struct PhotoView: View {

public var body: some View {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public var body: some View {
var body: some View {

@@ -35,15 +38,41 @@ public struct TimetableListView: View {
}

public var body: some View {
Copy link
Contributor

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👍

Suggested change
public var body: some View {
var body: some View {

Reduce { state, action in
switch action {
case .onAppear:
state.timetableItems = SampleData.init().day1Results
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$0.timetableItems = SampleData.init().day1Results
$0.timetableItems = SampleData().day1Results

This is more like Swift👍

@charles-b-stb
Copy link
Contributor Author

@MrSmart00 @shin-usu Responded to your comments, thanks!

Copy link
Contributor

@MrSmart00 MrSmart00 left a 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!

Comment on lines +42 to +50
LazyVStack {
ForEach(store.timetableItems, id: \.self) { item in
TimeGroupMiniList(contents: item)
}
}.scrollContentBackground(.hidden)

.onAppear {
store.send(.onAppear)
}.background(Color(.backgroundColorset))
Copy link
Contributor

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?

Suggested change
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))

Comment on lines +96 to 100
}.foregroundStyle(Color(.onSurfaceColorset)).padding(10)
.overlay(
RoundedRectangle(cornerRadius: 5)
.stroke(Color.gray, lineWidth: 1)
.stroke(Color(.onSurfaceColorset), lineWidth: 1)
)
Copy link
Contributor

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)
)

Copy link
Contributor

@shin-usu shin-usu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM👍👍

@charles-b-stb charles-b-stb merged commit faa8d59 into main Jun 26, 2024
@charles-b-stb charles-b-stb deleted the feature/timetable-feature-fixes branch June 26, 2024 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants