Skip to content

Conversation

@zainbilalh
Copy link
Contributor

@zainbilalh zainbilalh commented Nov 14, 2025

Added HighlightsViewModel with loading, filtering, and clean separation of highlights into structured lists for the views.
Added NoHighlightView
Implemented networking for fetching articles and YouTube videos.

(This looks like a big PR, but the lines of code mostly come from HighlightsViewModel, which copies a lot of its structure from already existing GamesViewModel and PastGameViewModel

Networking:
I originally implemented both fetches using separate completion handlers, but since both are always needed, I switched to an async/await setup and grouped the calls.
This is my first time using async/await in Swift, so I’d appreciate extra attention on that part to make sure the approach is correct and safe.

Next Steps:

Logic:

  • Update date formatting once the backend provides consistent date fields
  • Re-test filtering once sportsType values are fixed on the backend

Style

  • Add an animated loading screen
  • Make the sticky headings work

Other

  • Explore ways to load images more efficiently (and retry on failure)

@zainbilalh zainbilalh marked this pull request as ready for review November 14, 2025 03:43
@zainbilalh zainbilalh self-assigned this Nov 14, 2025
Copy link
Contributor

@MrPeterss MrPeterss left a comment

Choose a reason for hiding this comment

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

Nice work zain, just a couple of comments!

}
}

var sport: Sport{
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add a space between the "t" and "{"

}

var sport: Sport{
switch self{
Copy link
Contributor

Choose a reason for hiding this comment

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

same here space before the "{"

}
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

i like both of the approaches with the complations and the async/await

.resizable()
.frame(width: 9.87, height: 18.57)
}
Spacer()
Copy link
Contributor

Choose a reason for hiding this comment

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

space above


struct NoHighlightView: View {
var body: some View {
VStack {
Copy link
Contributor

Choose a reason for hiding this comment

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

keep the spaces between the vstack children

)
}


Copy link
Contributor

Choose a reason for hiding this comment

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

there is an extra space

.onChange(of: viewModel.selectedSport) { _, _ in
viewModel.filter()
}

Copy link
Contributor

Choose a reason for hiding this comment

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

extra space above

NavigationLink(destination:
DetailedHighlightsView(title: title, highlightScope: scope)
.environmentObject(viewModel))
{
Copy link
Contributor

Choose a reason for hiding this comment

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

either put the "{" above on line 92 or move one of the closing ")" on line 93

Copy link
Contributor

@angelinaa-chen angelinaa-chen left a comment

Choose a reason for hiding this comment

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

Nice PR Zain! A couple comments, and maybe let's wait until back-end pushes their changes to test the sportsType filtering before merging. Otherwise, looks amazing :) great work!!

Copy link
Contributor

Choose a reason for hiding this comment

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

Small nit: HighlightStar is misspelled (missing the t)

"scale" : "1x"
},
{
"filename" : "kid_star (1).png",
Copy link
Contributor

Choose a reason for hiding this comment

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

The filename and the name of the actual image file differ -- could we have them uniform just in case?

@@ -0,0 +1,187 @@
//
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a general comment, but just leaving this here. The reason the tab bar wasn't showing when clicking the highlights tab was because the current image is called "Highlight-selected" instead of "highlight-selected". Changing that for me allowed it to work again. :)

image

.fontWeight(.bold)
.foregroundColor(Constants.Colors.white)
.underline()
// Text(article.source)
Copy link
Contributor

Choose a reason for hiding this comment

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

If this comment isn't needed anymore, could we go ahead and delete it? If not I think adding a comment as to what it might be used for in the future might be nice!

init(from gqlArticle: ArticlesQuery.Data.Article) {
self.id = gqlArticle.id ?? UUID().uuidString
self.image = gqlArticle.image ?? ""
self.title = gqlArticle.title
Copy link
Contributor

@angelinaa-chen angelinaa-chen Nov 21, 2025

Choose a reason for hiding this comment

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

Not sure if this will ever happen, but could we also put a fallback value for the title and url since the Article properties aren't optionals? An empty string would work as a default

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.

4 participants