-
Notifications
You must be signed in to change notification settings - Fork 199
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 grid2 #367
Conversation
… feature/timetable-feature-grid2
…ll need to space welcometalk/lunch/etc.
app-ios/Sources/CommonComponents/Timetable/TimetableGridCard.swift
Outdated
Show resolved
Hide resolved
}.first | ||
} | ||
|
||
func getCellForRoom(room: RoomType, onTap: @escaping (TimetableItem) -> Void) -> TimetableGridCard { |
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 is the view code. Move this to the appropriate view definition 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.
Moved to the UI file. I still am using an extension because if the code in the loop gets too complicated iOS just fails to render the list.
If you have a better suggestion for this I am open for other ideas. 🙇
var body: some View { | ||
let rooms = RoomType.allCases.filter {$0 != RoomType.roomIj} | ||
|
||
ScrollView(.vertical) { |
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.
ScrollView([.horizontal, .vertical])
is useful.
…wift Co-authored-by: Ryoya Ito <[email protected]>
… feature/timetable-feature-grid2
@shin-usu Tested with the new TimetableRoom location and there are no problems. |
New build fail due to movement of shape?
This built locally but I will investigate the error and fix it before moving forward |
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 don't confirm all code in this pull request, but I left some comments!
I will check the rest of the code later.
// | ||
// File.swift | ||
// | ||
// | ||
// Created by CHARLES BOND on 2024/08/12. | ||
// |
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 you delete file header?
// | ||
|
||
import Foundation | ||
|
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.
Maybe unnecessary line.
if let url = URL(string: speaker.iconUrl) { | ||
AsyncImage(url: url) { | ||
$0.image?.resizable() | ||
} | ||
} else { | ||
Circle().stroke(Color.gray) | ||
} |
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.
Probably, it would be fine following code. Sorry if I am wrong...
AsyncImage(url: URL(string: speaker.iconUrl)) {
$0.image?.resizable()
} placeholder: {
Color.gray
}
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 copied this code from TImetableCard... maybe they could share this fix?
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.
Yes, I think it can be shared!
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 image part was slightly wrong but I fixed it.
… feature/timetable-feature-grid2
Looks like a merge just right after my last pull broke it. I will look for a work-around |
ForEach(rooms, id: \.self) { room in | ||
|
||
timeBlock.getCellForRoom(room: room, onTap: { item in | ||
store.send(.view(.timetableItemTapped)) |
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.
TimetableItemWithFavorite
instance should be passed to timetableItemTapped
🙏🏼
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 need to backmerge for this to work, so I will fix that soon.
VStack { | ||
//Empty on purpose | ||
} |
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.
Is it possible to instead it to EmptyView() ?
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 try it
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.
Empty view collapses. We need something that will hold the space open.
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.
How about following?
Color.clear
.frame(maxWidth: .infinity)
.padding(12)
.frame(width: 192, height: 153)
.clipShape(RoundedRectangle(cornerRadius: 4))
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.
Is it correct my understanding that sample data no longer used?
If so, I don't think this file name is appropriate.
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 sample data is still used in previews. I can refactor this to break out data class items.
app-ios/Sources/CommonComponents/Timetable/TimetableGridCard.swift
Outdated
Show resolved
Hide resolved
app-ios/Sources/CommonComponents/Timetable/TimetableGridCard.swift
Outdated
Show resolved
Hide resolved
app-ios/Sources/CommonComponents/Timetable/TimetableGridCard.swift
Outdated
Show resolved
Hide resolved
EdgeInsets(top: 2,leading: 7, bottom: 2, trailing: 7)) | ||
.border(highlight ? AssetColors.Custom.flamingo.swiftUIColor : AssetColors.Surface.onSurface.swiftUIColor) | ||
.padding(-2) | ||
func getTimetableRoom(type: RoomType) -> TimetableRoom { |
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 it would be more Swift-Like to implement this convert logic in extension.
Also, you can narrow the scope in which this function can be used.
extension RoomType {
func toRoom() -> TimetableRoom {
...
}
}
let type: RoomType = .roomI
let room = type.toRoom()
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.
fixed
jaTitle: "All", | ||
enTitle: "All" |
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 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.
Is there not an item for all rooms? From the UI it looked like some events fill the whole screen.
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.
Bigger question: Do we have any examples of Iguana and Jellyfish? It seems like a case we should test in grid mode.
… feature/timetable-feature-grid2
Co-authored-by: Usuda Shin <[email protected]>
…wift Co-authored-by: Usuda Shin <[email protected]>
…wift Co-authored-by: Usuda Shin <[email protected]>
…wift Co-authored-by: Usuda Shin <[email protected]>
…gi/conference-app-2024 into feature/timetable-feature-grid2
@shin-usu Responded to comments. |
also @ry-itto I responded to your comments. |
.overlay(RoundedRectangle(cornerRadius: 4).stroke(timetableItem.room.roomTheme.primaryColor, lineWidth: 1)) | ||
} | ||
} else { | ||
Spacer() |
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.
@charles-b-stb
@ry-itto suggested the Color.clear.
Is there a reason you used Spacer?
I don't think Spacer is often used for this case.
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.
@shin-usu
I didn't see the Color.clear suggestion, sorry.
(This thread is getting very long)
Spacer holds the spot properly so it seemed like a valid use case. It seems more weird to me to use color here but if that is normal for iOS I can switch to that.
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.
…gi/conference-app-2024 into feature/timetable-feature-grid2
app-ios/Sources/CommonComponents/Timetable/TimetableGridCard.swift
Outdated
Show resolved
Hide resolved
No other places of concern other than ry-itto's comment. |
Co-authored-by: Ryoya Ito <[email protected]>
…wift Co-authored-by: Ryoya Ito <[email protected]>
Co-authored-by: Ryoya Ito <[email protected]>
@ry-itto Fixed as recommended. Thank you |
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.
left a comment!
please check it🙏
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 isn't common component I think.
you should move to Timetable package please🙏
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 moved it, but it did require me to make one shared class between the card classes public (it was package before)
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 a comment!
check it please🙏
import class shared.TimetableItem | ||
|
||
public struct TimetableGridCard: View { | ||
let timetableItem: 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.
Could you change this property to be required?
maybe its more than smart and simple 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.
@MrSmart00 Currently empty cells depend on this value being able to be null. I don't think I can make this not null-able without breaking empty cells.
Do you have an alternate suggestion for empty cells? 🙇
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.
@charles-b-stb
I know you said situation.
I said means nil check should be out of the view.
you show the view or Color.clear with the property's nil check right?
but Color.clear is not TimetableGridCard view 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.
@MrSmart00 I rewrote the code to move Clear outside of TimetableGridCard.
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!!!
LGTM👍
Issue
Overview (Required)
Links
Screenshot (Optional if screenshot test is present or unrelated to UI)
Movie (Optional)
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-08-13.at.00.25.11.mp4