Implemented Club Suggestions Dropdown and fixed UI updates for saved edits to clubs#114
Implemented Club Suggestions Dropdown and fixed UI updates for saved edits to clubs#114laylaliuuu merged 5 commits intomainfrom
Conversation
✅ Deploy Preview for redi-love ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
abrar-amin
left a comment
There was a problem hiding this comment.
I think this is pretty good! If Clement is happy with the UI, I am happy with the UI (though double check the behavior of my add hometown PR just so that the app looks consistent).
Aside from minor/pedantic points, lgtm!
frontend/app/(auth)/edit-clubs.tsx
Outdated
| const filterSuggestions = (text: string, currentClubs: string[]) => | ||
| CLUBS.filter( | ||
| (c) => | ||
| c.name.toLowerCase().includes(text.toLowerCase()) && |
There was a problem hiding this comment.
nit: since text doesn't change for the whole method call, you may as well just call toLowerCase() once and then use that in filter
| placeholder="e.g., Debate, Sports, Drama" | ||
| value={editValue} | ||
| onChangeText={setEditValue} | ||
| onChangeText={handleEditValueChange} |
There was a problem hiding this comment.
Not your fault (prob Claudia's fault), but setEditValue and having the state just have editValue just sounds so vague..
frontend/app/(auth)/edit-clubs.tsx
Outdated
| suggestionsContainer: { | ||
| backgroundColor: AppColors.backgroundDimmer, | ||
| borderRadius: 12, | ||
| overflow: 'hidden', |
There was a problem hiding this comment.
i'm not sure how @clementroze feels about this, but I think our styling for adding clubs and adding hometown should match
There was a problem hiding this comment.
Yeah I feel like we could talk about the styling in the work session tomorrow, because there are a few things I was wondering if would be a better UX and more user friendly
| @@ -0,0 +1,74 @@ | |||
| /** | |||
| * Fetches Cornell club data from the CampusGroups RSS feed and writes | |||
There was a problem hiding this comment.
I'm not quite sure if the number of clubs changes a ton... but if you wanted to resume farm, you could add some kind of work flow that checks for new clubs every once and a while and makes a PR to the repo
|
Also, I think we can ignore SonarCloud on this one?? It's primarily yelling at the backend script for fetching from the RSS feed. |
laylaliuuu
left a comment
There was a problem hiding this comment.
Absolutely awesome work on your first PR! The autocomplete dropdown is a great UX upgrade, and standardizing the club data is going to be a total game-changer for our future matching algorithms.
I've left a few comments on the files, and for some, we can discuss it with Clement to see which design is most user-friendly, and for some future suggestions, we can discuss them with the team to see what the best engineering decision is for this.
Great work!
| CLUBS.filter( | ||
| (c) => | ||
| c.name.toLowerCase().includes(text.toLowerCase()) && | ||
| !currentClubs.includes(c.name) |
There was a problem hiding this comment.
Nice logic here to ensure that dropdown doesn't suggest a club that user has alrady added to their profile
| returnKeyType="done" | ||
| onSubmitEditing={addClub} | ||
| /> | ||
| {suggestions.length > 0 && ( |
There was a problem hiding this comment.
I love the autocomplete feature! And it's pretty consistent with other fields of editing as well. One quick UX thing we could discuss with clement is that right now, as I type the number of suggested changes (from 5 down to 1, etc.), the container dynamically resizes, which I personally think maybe we can have a fix size container.
I also wonder when on the actual mobile device, with the mobile keyboard open, will you still see the "Add" button?
Because right now, "select your major" is using similar autocomplete stuff, and it looks off: 1) without "Add" button 2)the position of popup looks odd. 3) I personally don't like the fact that as number of suggested changes the container dynamically resizes (we can talk about it with Clement)
| @@ -0,0 +1,6107 @@ | |||
| // Auto-generated by scripts/fetch-clubs.ts — do not edit manually | |||
There was a problem hiding this comment.
I took a look at the auto-generated clubs.ts list, this is awesome! Standardizing the club names is going to make building the matching algorithm definetely easier. Also, absolutely brilliant move grabbing the category field from CampusGroups along with the names, which opens up a whole new layer of category-based matching for us in the future.
Just thinking of some possible long term suggestion:
- Because this list is hardcoded into the app's files, if a new club is created at Cornell mid-semester, it will not appear in the app. The only way to update the list is to run the script, build a new version of the app, and wait for Apple/Google to approve a brand new App Store update. Long-term fix could be to move this data to a backend database in the Firebase and fetch it on the app so it's always up-to-date.
- Right now it's a manual script, we could set up a GitHub Action (cron job) to run this script automatically on the 1st of every month an dpush any new clubs directly to the backend database.
There was a problem hiding this comment.
+1 on the pushing to our database for these! It'll make it easier to access and not add more to the codebase clutter. We can also talk about moving the majors into DB as well, but since those are more intertwined within each College and the clubs aren't, I think we can just focus on moving this exact format into DB.
You'll need to create a new collection (Clubs) and fields are name and category.
There was a problem hiding this comment.
Having it on the backend would be nice since we can do fun stuff in backend with regards to matching if we know all of the possible clubs at Cornell.
| * Run with: npx tsx scripts/fetch-clubs.ts | ||
| */ | ||
|
|
||
| import * as fs from 'fs'; |
There was a problem hiding this comment.
It would be great if you could just address those warnings. Usually, it's always best not to ignore any warnings just to be safe.
| @@ -0,0 +1,74 @@ | |||
| /** | |||
| * Fetches Cornell club data from the CampusGroups RSS feed and writes | |||
There was a problem hiding this comment.
I love that you wrote a scraper for this instead of doing it by hand! Amazing automation!!
| } | ||
|
|
||
| function extractTag(xml: string, tag: string): string { | ||
| const match = xml.match(new RegExp(`<${tag}>([\\s\\S]*?)<\\/${tag}>`)); |
There was a problem hiding this comment.
Quick thought on this, since right now we are using Regex to parse, and it works for how CampusGroups is structured right now. I wonder, let's say if we have a weird character like "Ben & Jerry Club", will the "&" throw off the Regex?
I'm also wondering as a heads-up for the future, if CampusGroups ever changes their structure or format, this Regex will most likely break. If that happens, we might need to find an alternative or safer way to do it. Definitely not a blocker for this PR, just something to keep in the back of mind if the script ever suddenly stops working
scripts/fetch-clubs.ts
Outdated
| const name = decodeHtmlEntities(extractTag(item, 'groupName')); | ||
| const rawCategory = extractTag(item, 'category'); | ||
| // Category can be semicolon-separated — use the first one | ||
| const category = decodeHtmlEntities(rawCategory.split(';')[0].trim()); |
There was a problem hiding this comment.
I think the category is separated by "," not ";", at least that's what it shows in club.ts file. It might fail to separate the list and save the entire multi-category string anyway, and later for the future matching algorithm, it will fail too.
jacquelinecai
left a comment
There was a problem hiding this comment.
Great work on your first PR, Gillio! Everyone's pretty much covered most of the comments I had, but I would emphasize not storing all clubs in our codebase since it does get incredibly bulky. The fetching can also be done faster if most clubs are already in the DB anyways.
| @@ -0,0 +1,6107 @@ | |||
| // Auto-generated by scripts/fetch-clubs.ts — do not edit manually | |||
There was a problem hiding this comment.
+1 on the pushing to our database for these! It'll make it easier to access and not add more to the codebase clutter. We can also talk about moving the majors into DB as well, but since those are more intertwined within each College and the clubs aren't, I think we can just focus on moving this exact format into DB.
You'll need to create a new collection (Clubs) and fields are name and category.
Screen.Recording.2026-03-11.at.8.44.16.PM.movThis most recent commit covers the following:
Note:
UX changes (Please lmk what we think about the direction)
Future thoughts |
jacquelinecai
left a comment
There was a problem hiding this comment.
I think this looks a lot better! There might need to be some UI changes once we test on physical device with keyboard interaction and stuff but that can be in a separate PR fs! Once everyone approves this PR, TPMs can help you merge since the duplication is only from the clubs.ts file.
|
For future PRs with videos, make sure to use the physical keyboard on the simulator |
laylaliuuu
left a comment
There was a problem hiding this comment.
I like the new UI changes a lot more than before. Nice job. Just need to double test it on an actual mobile device to see what it looks like with the keyboard open.
|




Summary
frontend/app/(auth)/edit-clubs.tsx
This pull requests allows for users to select from a suggestions dropdown that pulls from the list of all current Cornell student orgs.
Test Plan
Tested in dev sandbox
edit-clubs-demo.mov
Notes
Next Steps: Seems like the save button functionality isn't implemented for the profile edit page? Should be a similar fix to above