Skip to content

feat: update new learner display and logic for improved visibility#27

Closed
naincy128 wants to merge 3 commits intorelease-ulmofrom
Cosmo2-735
Closed

feat: update new learner display and logic for improved visibility#27
naincy128 wants to merge 3 commits intorelease-ulmofrom
Cosmo2-735

Conversation

@naincy128
Copy link

Description

This update introduces a new feature that displays a "New Learner" message beneath usernames in discussion posts and comments for users identified as new learners. The feature helps learners and staff quickly recognize new participants, improving clarity and community interaction.

The implementation integrates backend API fields for learner status, with fallback logic to support legacy and edge cases. Core discussion components were updated to pass learner status data through the component tree, along with new hooks and test coverage to ensure consistent and reliable functionality.

Features

  • Added a visible “👋 Hi, I am a new learner” message below usernames in discussion posts and comments for new learners, using backend API fields and fallback heuristics.

  • Added a regular learner message for users who no longer qualify as new learners.

  • Created new hooks:

    • useLearnerStatus – encapsulates learner status logic and consumes API data.

    • useIsNewLearner – determines whether a user qualifies as a new learner.

  • Updated core components including AuthorLabel, CommentHeader, Reply, and Post to receive and propagate a new postData prop containing learner status.

  • Updated prop types and default props across affected components to support the new prop.

  • Added internationalization (i18n) support for the new learner and learner messages in messages.js.

  • Added comprehensive test coverage to verify correct rendering behavior for different user roles (staff, moderators, anonymous, retired, regular, and new learners).

Linked PRs

Screenshot

Screenshot 2025-10-27 105154 Screenshot 2025-10-27 105236

Jira Ticket

COSMO2-735

@naincy128 naincy128 closed this Nov 5, 2025
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.

1 participant