Skip to content

Feature/445 stretchfield#603

Merged
charles-b-stb merged 10 commits into
mainfrom
feature/445-stretchfield
Aug 25, 2024
Merged

Feature/445 stretchfield#603
charles-b-stb merged 10 commits into
mainfrom
feature/445-stretchfield

Conversation

@charles-b-stb

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

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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

@charles-b-stb

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

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

@MrSmart00 MrSmart00 left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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😅


extension RoomType {
func toRoom() -> TimetableRoom {
public func toRoom() -> TimetableRoom {

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

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

@MrSmart00 MrSmart00 left a comment

Copy link
Copy Markdown
Contributor

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🙏


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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

) {
self.timetableItem = timetableItem
self.onTap = onTap
self.cellCount = cellCount ?? 1

Copy link
Copy Markdown
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👍

Comment thread app-ios/Sources/TimetableFeature/TimetableGridCard.swift Outdated
Ok. I will commit this one as-is. Thanks!

Co-authored-by: Hiroya Hinomori <nexearth@gmail.com>

@MrSmart00 MrSmart00 left a comment

Copy link
Copy Markdown
Contributor

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