Skip to content

Improve streak display logic: show strongest streak (current vs longest) #11

@ayushraistudio

Description

@ayushraistudio

📈 Improve Streak Logic to Show Strongest Contribution Streak

Problem

Currently, the API only displays the Current Streak.
This creates a poor user experience when a user breaks their streak (e.g. misses one day).

In such cases, the trophy may show 0 or 1, even though the user may have achieved a strong Longest Streak in the past (e.g. 100 days).

🎯 Goal

Ensure the trophy always represents the user's strongest contribution consistency.

💡 Proposed Behavior

  • If Current Streak > Longest Streak → show Current Streak
  • If Longest Streak > Current Streak → show Longest Streak
  • Display only one streak value
  • Reuse the existing streak UI (no new sections)

In short:
The streak shown should always be the best streak the user has achieved so far.

⚙️ Implementation Notes

  • This is a logic-only change
  • No UI or SVG changes required
  • The API response must remain backward compatible
  • The existing current_streak field should continue to be used

⚠️ Constraints

  • Do NOT change the API response structure
  • Do NOT add new UI sections
  • Do NOT break existing behavior
  • The change should feel intuitive by default

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions