Skip to content

Add favorite sports selection screen - #122

Open
EmilJiang wants to merge 1 commit into
populated-profilefrom
edit-favorite-sports
Open

EmilJiang wants to merge 1 commit into
populated-profilefrom
edit-favorite-sports

Conversation

@EmilJiang

@EmilJiang EmilJiang commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #120; targets populated-profile.

The Favorite Sports Edit button opens a three-column selector with All/Men’s/Women’s filters. Selected sports appear first with green borders and remove badges. Tapping a sport adds or removes that division, and going back updates the profile favorites.

Screenshot 2026-10-28 at 2 14 00 PM

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4f7912c9-c749-4085-bacf-18722a325a92
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@EmilJiang
EmilJiang added this pull request to stack #121 October 28, 2026 18:14
@EmilJiang
EmilJiang requested a review from caleb-bit October 28, 2026 18:18

@caleb-bit caleb-bit left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Mostly looks good, left a few comments.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you format this file?


BackHandler(enabled = editingPicture) { editingPicture = false }
var editingSports by rememberSaveable { mutableStateOf(false) }
var favorites by rememberSaveable(data.favorites, stateSaver = listSaver<List<ProfileFavorite>, String>(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

remove redundant explicit type argument

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you format this file

val options = (favorites + favoriteSportOptions).distinct()
.filter { gender == GenderDivision.ALL || it.gender == gender }
.sortedWith(compareBy<ProfileFavorite> { it !in favorites }
.thenBy { it.sport.displayName }.thenBy { it.gender == GenderDivision.FEMALE })

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we extract this compareBy logic?

.fillMaxWidth().border(1.dp, GrayLight, CircleShape)
.padding(6.dp).selectableGroup()
) {
listOf(GenderDivision.ALL, GenderDivision.MALE, GenderDivision.FEMALE).forEach { division ->

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we just use GenderDivision.entries?

Box(Modifier.fillMaxWidth().aspectRatio(1f), contentAlignment = Alignment.Center) {
Box(
Modifier.fillMaxSize()
.background(if (selected) Color(0xFFF6FFF3) else GrayStroke, shape)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we extract the color

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.

2 participants