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/445 stretchfield #603

Merged
merged 10 commits into from
Aug 25, 2024
Merged

Feature/445 stretchfield #603

merged 10 commits into from
Aug 25, 2024

Conversation

charles-b-stb
Copy link
Contributor

@charles-b-stb charles-b-stb commented Aug 18, 2024

Issue

Overview (Required)

  • Attempted to stretch cell across 5 columns in cases that appear to meet the situations shown in the figma design
  • TODO: The cell spacing needs adjustment.
  • TODO: The stretched cells should have the room color removed. colors fixed

Based off #367 and should not be merged until after the grid merge is complete.

Links

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

Before After

Movie (Optional)

Before After

@charles-b-stb
Copy link
Contributor Author

This still needs more work. For some reason other fields are getting double entries.

@charles-b-stb
Copy link
Contributor Author

Fixed build issue (from merge) and fixed colors for extended fields. Ready for some prelim review... what do folks think of this kind of implementation?

@charles-b-stb
Copy link
Contributor Author

After talking discussions about what the website is doing, I decided to try and extend just the lunch field. Still needs to be discussed with the mobile team to see if this change is worth keeping.

@charles-b-stb charles-b-stb marked this pull request as ready for review August 19, 2024 15:30
@charles-b-stb
Copy link
Contributor Author

Let's go ahead and review this one and merge if possible.

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.

Thanks!!
I left some comments!
Please check them🙏


public init(
timetableItem: TimetableItem,
cellCount: Int? = 1,
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 argument is no needed an optional 🤔
and required property is no needed a default value 👍

Suggested change
cellCount: Int? = 1,
cellCount: Int,

Text("\(timetableItem.startsTimeString) - \(timetableItem.endsTimeString)")
.textStyle(.labelMedium)
.foregroundStyle(timetableItem.room.roomTheme.primaryColor)
.foregroundStyle(cellCount>1 ? AssetColors.Surface.onSurfaceVariant.swiftUIColor : timetableItem.room.roomTheme.primaryColor)
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
.foregroundStyle(cellCount>1 ? AssetColors.Surface.onSurfaceVariant.swiftUIColor : timetableItem.room.roomTheme.primaryColor)
.foregroundStyle(cellCount > 1 ? AssetColors.Surface.onSurfaceVariant.swiftUIColor : timetableItem.room.roomTheme.primaryColor)

I want add spaces for any operators left and right😅

@@ -198,7 +209,7 @@ fileprivate var bottomTabBarPadding: some View {
}

extension RoomType {
func toRoom() -> TimetableRoom {
public func toRoom() -> TimetableRoom {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you add this public🤔?
I seem this PR doesn't reference this method.

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 using it elsewhere, but on closer inspection it was in the same file so public was not needed.

@shin-usu shin-usu requested a review from ry-itto August 21, 2024 16:48
@charles-b-stb
Copy link
Contributor Author

@MrSmart00 Thanks for your comments! I responded and made some adjustments.

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.

left some comments~
please check them🙏

@@ -265,9 +276,9 @@ extension RoomType {
}

extension TimetableTimeGroupItems {
func getCellForRoom(room: RoomType, onTap: @escaping (TimetableItemWithFavorite) -> Void) -> TimetableGridCard? {
func getCellForRoom(room: RoomType, cellCount: Int?=1, onTap: @escaping (TimetableItemWithFavorite) -> Void) -> TimetableGridCard? {
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
func getCellForRoom(room: RoomType, cellCount: Int?=1, onTap: @escaping (TimetableItemWithFavorite) -> Void) -> TimetableGridCard? {
func getCellForRoom(room: RoomType, cellCount: 1, onTap: @escaping (TimetableItemWithFavorite) -> Void) -> TimetableGridCard? {

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 might be wrong, but I think the intended change is removing "?=1" not the Int part... correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry it's wrong😅

func getCellForRoom(room: RoomType, cellCount: Int, onTap: @escaping (TimetableItemWithFavorite) -> Void) -> TimetableGridCard? {

is correct👍
@charles-b-stb

onTap: @escaping (TimetableItem) -> Void
) {
self.timetableItem = timetableItem
self.onTap = onTap
self.cellCount = cellCount ?? 1
Copy link
Contributor

Choose a reason for hiding this comment

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

you have ?? 1 is never used used warning yet.
you should remove it👍

Ok. I will commit this one as-is. Thanks!

Co-authored-by: Hiroya Hinomori <[email protected]>
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.

LGTM 🙏

@charles-b-stb charles-b-stb merged commit ee24c70 into main Aug 25, 2024
5 checks passed
@charles-b-stb charles-b-stb deleted the feature/445-stretchfield branch August 25, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[iOS] Timetable Grid: Double Field events
2 participants