Skip to content

Conversation

@amjiao
Copy link
Contributor

@amjiao amjiao commented Nov 15, 2025

Overview

HighlightsSearchScreen + HighlightsSubScreen
related components

Changes Made

All components for search screens complete
Updated nav bar so HighlightsScreen is accessible when app is run
Other search screens can be viewed via previews

Test Coverage

Visually matches figma

Next Steps

Code structure/logical flow def isn't perfect rn, will clean that up when I network

Screenshots

Screenshot 2025-11-14 at 11 16 40 PM Screenshot 2025-11-14 at 11 16 50 PM

search bar functionality

score_pr90.webm

@amjiao amjiao marked this pull request as ready for review November 15, 2025 04:23
@amjiao amjiao requested a review from zachseidner1 November 15, 2025 04:24
@amjiao amjiao marked this pull request as draft November 15, 2025 05:17
@zachseidner1 zachseidner1 removed their request for review November 15, 2025 14:36
@amjiao amjiao marked this pull request as ready for review November 19, 2025 03:44
}

@Composable
fun HighlightsSearchBarUI(
Copy link
Member

@AndrewCheung360 AndrewCheung360 Nov 19, 2025

Choose a reason for hiding this comment

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

What is the difference between this and the nonUI one? I think the naming is a little bit unclear since they are both in the UI, and I am curious if we need both?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The search bar on HighlightsScreen is a dummy search bar in the sense that it's just a clickable that navigates to access HighlightsSearchScreen where the functional search bar is. I thought it was cleaner to just have a separate UI-only version of the search bar than to have to toggle the enabled parameter of the BasicTextField (that led to some other errors)

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 agree with the point about confusing naming, I can't think of a better name rn though. I'll leave a comment in the code to explain this unless you have any suggestions?

Copy link
Member

Choose a reason for hiding this comment

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

I think the comment is good. I don't have a good name off the top of my head but maybe something like SearchEntryPointRow, but not the biggest deal as long as there is something explaining it.


@Composable
fun HighlightsSubScreen(
sportList: List<Sport>,
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as before for highlights screen about extracting parameters to vm. For testing purposes, you can maybe just define test variables within the composable

Copy link
Member

@AndrewCheung360 AndrewCheung360 left a comment

Choose a reason for hiding this comment

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

Awesome work as always! The UI is looking great and matches the figma pretty well! I just have some questions and potential considerations about the approach for handling the search logic along with some nits. I think one thing though, is that the use of focusrequester in the previews seems to be causing a lint check error, so we might want to get that fixed. Other than that, I'll leave it to Zach for anything I may have missed.

Copy link
Collaborator

@zachseidner1 zachseidner1 left a comment

Choose a reason for hiding this comment

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

I think Andrew got pretty much everything but have a few comments of my own. We need to resolve the lint before this gets merged!


@Preview
@Composable
private fun HighlightsSubScreenHeader() {
Copy link
Member

Choose a reason for hiding this comment

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

Should probably rename to have Preview at end since it currently shares the same name as the composable

private fun HighlightsSubScreenPreview() {
HighlightsSubScreen(
sportList = sportList,
recentSearchList = listOf(
Copy link
Member

Choose a reason for hiding this comment

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

Nit: can probably make use of the new testing constant that was added

.background(color = Color.White)
.padding(top = 24.dp)
) {
Row(modifier = Modifier.padding(horizontal = 24.dp)) {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Can probably apply the padding to the text itself without the row for less nesting

.background(color = Color.White)
.padding(top = 24.dp)
) {
Surface(
Copy link
Member

Choose a reason for hiding this comment

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

Nit: you could probably include the Surface part in the header composable as well

horizontalArrangement = Arrangement.SpaceBetween,
modifier = Modifier
.fillMaxWidth()
.clickable(onClick = {/*search the query*/ })
Copy link
Member

@AndrewCheung360 AndrewCheung360 Dec 1, 2025

Choose a reason for hiding this comment

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

Nit: could be passed in as onClick parameter

}

IconButton(
onClick = {/*delete this search from the recent searches list*/ },
Copy link
Member

Choose a reason for hiding this comment

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

Nit: can be passed as an onClick parameter

interactionSource = interactionSource,
indication = null
) { onSearchClick() }
.clickable { onSearchClick() }
Copy link
Member

Choose a reason for hiding this comment

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

Is this onSearchClick necessary for focusing or can we allow the basic text field focus to take care of that for us?

},
modifier = Modifier
.weight(1f)
.onFocusChanged { state ->
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if this is necessary if we have the logic in the text field?

modifier = Modifier
.padding(horizontal = 24.dp)
.clip(shape = RoundedCornerShape(100.dp))
.onFocusChanged { focusState ->
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if this ideal to have here or if we can just pass in some sort of onFocus function/logic to the search bar component

verticalAlignment = Alignment.CenterVertically
) {
HighlightsSearchBar(
onSearchClick = {
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if this is needed here if we have the focus change detection in the search bar itself? Maybe you can pass in an onFocus function?

"Cancel",
style = bodyMedium,
modifier = Modifier.clickable {
isFocused = true;
Copy link
Member

Choose a reason for hiding this comment

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

Should this be false?

}
}

@Preview
Copy link
Member

Choose a reason for hiding this comment

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

Nit: might be good to have a preview or preview parameter where we can see the highlights list as well instead of just recent searches

Column(
modifier = Modifier.padding(horizontal = 24.dp)
) {
if (recentSearchList.isNotEmpty() && query.isEmpty()) { //start state: no search attempted yet
Copy link
Member

Choose a reason for hiding this comment

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

Nit: It could be potentially worth considering using something like animatedcontent here to have more control over the transition between recent searches content and the search results


/* Used to display number of results in on HighlightsSearchScreen*/
@Composable
fun HighlightsCardLazyColumnNumResultsHeader(
Copy link
Member

Choose a reason for hiding this comment

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

Nit: probably don't need to abbreviate num or can potentially just remove num

Copy link
Member

@AndrewCheung360 AndrewCheung360 left a comment

Choose a reason for hiding this comment

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

I'm going to preemptively approve, but left some comments about the focus logic and some nits. Great work!

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