Skip to content

Sparkline silently renders nothing for a single-point series, leaving an empty gap in StatCard's layout #207

Closed

Description

@chonilius

src/components/ui/Sparkline.tsx starts with:

if (data.length < 2) return null;

This is reasonable in isolation (you can't draw a line through one point), but its only
consumer, StatCard.tsx, doesn't account for it:

{sparkline && (
  <div className="text-indigo-500 dark:text-indigo-400">
    <Sparkline data={sparkline} />
  </div>
)}

sparkline && only checks truthiness/presence of the array, not its length. A
one-element array ([42]) is truthy, so the wrapping <div> still renders — with
Sparkline returning null inside it — leaving an empty, unexplained gap in the
StatCard's flex row (mt-2 flex items-end justify-between gap-2) where a chart was
visually expected to be. There's no fallback rendering (a dash, a "not enough data yet"
label, or simply omitting the wrapper).

This is currently latent because every sparkline passed in today
(contributorEarningsHistory, bountiesCompletedSparkline, etc.) has 8 data points, but
any future StatCard usage with a shorter history (e.g. a brand-new contributor's first
week) would trigger it.

Suggested fix: have StatCard check sparkline.length >= 2 before rendering the
wrapper, or have Sparkline render a simple flat-line/placeholder for 0-1 points instead
of null, so the layout doesn't silently leave a gap.

Activity

  1. added
    bug
    very hard
    help wanted
    enhancement
    on Aug 21, 2026
  2. added
    Stellar Wave
    on Aug 24, 2026
  3. Halimatyemisi commented on Aug 24, 2026

    @Halimatyemisi

    @Halimatyemisi has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hello, I would really appreciate the opportunity to contribute to this issue. I am interested in working on it and would be grateful if it could be assigned to me. I look forward to contributing meaningfully. Thank you.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Halimatyemisi to this issue.

  4. timiturn3r commented on Aug 24, 2026

    @timiturn3r

    @Oluwasuyi-Oluwatimilehin-Daniel has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hello @maintainer, I’d like to work on this issue. I have experience handling similar tasks and can start immediately. And I will deliver at the shortest possible time.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Oluwasuyi-Oluwatimilehin-Daniel to this issue.

  5. habnark commented on Aug 24, 2026

    @habnark

    @habnark has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hello can i work on this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @habnark to this issue.

  6. ariyo-2 commented on Aug 24, 2026

    @ariyo-2

    @ariyo-2 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    I'd be glad to handle this issue. I'll keep the implementation concise, maintainable, and well-documented.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @ariyo-2 to this issue.

  7. Gentle842 commented on Aug 24, 2026

    @Gentle842

    @Gentle842 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    I can handle this issue very well

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Gentle842 to this issue.

  8. Michealshodipo56 commented on Aug 24, 2026

    @Michealshodipo56

    @Michealshodipo56 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    I would like to work on this kindly assign me

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Michealshodipo56 to this issue.

  9. larryjay007 commented on Aug 24, 2026

    @larryjay007

    @larryjay007 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hi, I can solve this issue as soon as possible and achieve the result you want. Please assign to me.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @larryjay007 to this issue.

  10. bashir347 commented on Aug 24, 2026

    @bashir347

    @bashir347 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Good evening maintainer, pleas assign this issue to me

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @bashir347 to this issue.

  11. posimideveloper commented on Aug 24, 2026

    @posimideveloper
    Contributor

    @posimideveloper has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    I'm ready to tackle this immediately.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @posimideveloper to this issue.

  12. charliechinedu19-netizen commented on Aug 24, 2026

    @charliechinedu19-netizen

    @charliechinedu19-netizen has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    hey gm, i'd love to take on this task real quick

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @charliechinedu19-netizen to this issue.

  13. Just-Bamford commented on Aug 24, 2026

    @Just-Bamford

    @Just-Bamford has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hi maintainer, I would like to work on this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Just-Bamford to this issue.

  14. drips-wave commented on Aug 24, 2026

    @drips-wave

    Congratulations, @posimideveloper! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.

    🧑‍💻 @posimideveloper: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  15. added a commit that references this issue on Aug 25, 2026
    26a72e8
  16. drips-wave commented on Aug 25, 2026

    @drips-wave

    This issue has been completed by @posimideveloper as part of the Stellar Wave Program's 8th Wave 🥳

    😎 @posimideveloper: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

  17. removed
    Stellar Wave
    on Oct 15, 2026
  18. added
    Stellar Wave
    on Oct 15, 2026
  19. removed
    Stellar Wave
    on Oct 15, 2026
  20. added
    Stellar Wave
    on Oct 15, 2026
  21. removed
    Stellar Wave
    on Oct 15, 2026
  22. added
    Stellar Wave
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar Wavebugenhancementhelp wantedvery hard

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions