feat(con): turn mentoring-topics checkboxes into multiselect-dropdowns
What Github issue does this PR relate to? Insert link.
Closes #622
What should the reviewer know?
Previously:
New implementation:
Only for mentees, when limit of 4 topics is reached:
Short comparison + demo video https://github.com/user-attachments/assets/ed1c5f1c-b327-4b60-ac08-098ed41973ac
Summary by CodeRabbit
Summary by CodeRabbit
-
New Features
- Enhanced mentorship topics management with an improved user interface using
FormSelectcomponents for better category selection. - Notification system added to alert users when the maximum number of selectable topics is reached.
- Dynamic form initialization based on user profile type and selected categories.
- Enhanced mentorship topics management with an improved user interface using
-
Bug Fixes
- Improved handling of category selections for users of type 'MENTEE' to enforce limits on selections.
-
Refactor
- Streamlined form values structure for better organization and maintainability.
- Simplified category representation by removing emoji icons for improved readability.
Walkthrough
The recent changes enhance the EditableMentoringTopics component by restructuring the representation of mentorship categories. The MentoringFormValues type has been updated for better flexibility and organization. User interactions are improved through updated form components and feedback mechanisms, promoting a more user-friendly experience. Additionally, the CATEGORY_GROUPS constant has been simplified by removing emoji icons, ensuring consistency across the application.
Changes
| Files | Change Summary |
|---|---|
apps/redi-connect/src/components/organisms/EditableMentoringTopics.tsx |
Updated MentoringFormValues structure to combine isMentor with categories, added getInitialValues for initial form values, modified submitForm to handle new data structure, changed rendering from checkboxes to FormSelect, and improved category selection logic with user feedback. |
libs/shared-config/src/lib/config.ts |
Removed emoji icons from CATEGORY_GROUPS values, simplifying category representation while maintaining structure. |
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| Improve UI for multiple mentoring topics selection for desktop, tablet, and mobile layout (#622) | ✅ |
Possibly related PRs
- #945: Changes in
EditableEducation.tsxandEditableProfessionalExperience.tsxinvolve modifications to component logic and state management, which may relate to the structural changes inEditableMentoringTopics.tsx. - #954: Updates to the
translation.jsonfile enhance clarity in mentorship guidance, aligning with improvements in user experience and context-awareness in theEditableMentoringTopics.tsxcomponent.
Suggested reviewers
- helloanil
- katamatata
- astkhikatredi
Poem
In fields of code where rabbits play,
New changes hop in bright array.
With form and function, all aligned,
Mentoring topics now refined.
So let us cheer, with joyful glee,
For a smoother path in coding spree! 🐇💻✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
:placard: Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Generate unit testing code for this file.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and generate unit testing code.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
Dear Rebeca, thanks a lot for an amazing job!!
Now, question to you, @helloanil and @katamatata and @rebecakipper
Regarding the error message - do you think we can try out another approaches for the situation when user selects 4 topics. e.g.:
1. Confirmation Pop-up with a message: “You’ve selected 4 topics. You can’t select more. Please deselect one if you wish to choose another.” Buttons: [OK] [Cancel] or 2. Summary counter near the selection area: - Before selecting any topics: Badge near the selection area: “0/4 topics selected”
- After selecting topics: Badge updates with each selection: “3/4 topics selected” After the fourth selection: Badge turns red or changes style: “4/4 topics selected - limit reached.”
If this is complicated - it could be an additional ticket. Any thoughts?
Thank you!
@astkhikatredi, what is your concern about the alert message Rebeca suggested?
I suggest to keep it with the following text:
You’ve selected the maximum number of topics. If you wish to choose another, please deselect one.
Additionally, I suggest hiding the phrase You can select between 1 and up to 4 topics once the user selects 4 topics.
I think it is unnecessary to display both like this:
dear @helloanil , kind reminder
@rebecakipper Great job with the PR. Not gonna lie, the code looks a bit complex and I'm sure it can be simplified a bit, but it's definitely very well written and in my opinion very readable too. So I would not really push for further improvements here.
@astkhikatredi To be honest, I'm on the same page with @katamatata here. I would also suggest to keep the current implementation as it is. (We can ofc change the text). Speaking about your suggested options, Number 1 is complex both in implementation and user experience. So I would definitely rule that out. Number 2 can be a good idea for helping the users but I would also keep it as simple as showing a (0/4 - 1/4 ... 4/4) next to the MENTORING TOPICS title. Then we can hide the You can select between 1 and up to 4 topics.
Hey everyone!
thanks for comments. dear @helloanil and @katamatata. Dear @rebecakipper, then let's keep error message you've suggested (btw, thanks a lot for suggesting solution), but taken into account comments from @katamatata.
Hi @ericbolikowski, thanks for the comments! I just pushed some changes addressing them. Let me know if there is anything else 😉
Dear @ericbolikowski and @helloanil, can we deploy this PR or there are open questions? Thank you!