Skip to content

fix: hide duration badge and 0-plays label for zero-count items in TopLists#49

Open
Death-Watcher wants to merge 5 commits into
Xndr2:mainfrom
Death-Watcher:pr/toplists-display
Open

fix: hide duration badge and 0-plays label for zero-count items in TopLists#49
Death-Watcher wants to merge 5 commits into
Xndr2:mainfrom
Death-Watcher:pr/toplists-display

Conversation

@Death-Watcher

@Death-Watcher Death-Watcher commented May 19, 2026

Copy link
Copy Markdown
Contributor

Description

Clean up the TopLists display when tracks, artists, or albums have 0 plays or 0 duration:

  • Tracks — Duration badge is hidden when count === 0 (no point showing "<1 min" for an unplayed track).
  • Artists — The "0 plays" label is hidden when count === 0; genre tag remains clickable.
  • Albums — The "· 0 plays" suffix is hidden when count === 0; artist name remains visible.

The rows themselves stay visible so the user doesn't lose context — only the unhelpful numbers are suppressed.

Type of Change

  • Bug fix

How to Test

  • npm install && npm run build
  • Deploy to Spicetify
  • Open Listening Stats with a provider that returns zero-count items
  • Verify tracks with count === 0 show no duration badge
  • Verify artists with count === 0 show no "0 plays" text
  • Verify albums with count === 0 show no "· 0 plays" text
  • Verify all rows with normal data still display correctly

Checklist

  • Tested locally with npm run build (no errors)
  • All 1188 tests pass (npx vitest run)
  • TypeScript strict (npx tsc --noEmit)
  • No sensitive data included

Files Changed

  • src/app/components/TopLists.tsx — conditional rendering of duration badge and play-count labels

…pLists

When a track/artist/album has 0 plays, the duration badge and
play-count label are now hidden instead of showing unhelpful
"<1 min" or "0 plays" text.
@Death-Watcher Death-Watcher force-pushed the pr/toplists-display branch 2 times, most recently from 109ae32 to 2d0acb2 Compare May 19, 2026 19:38
@Xndr2 Xndr2 self-requested a review May 19, 2026 19:54

@Xndr2 Xndr2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please bring the code up to date with main
This has merge conflicts

@Death-Watcher

Copy link
Copy Markdown
Contributor Author

Please bring the code up to date with main This has merge conflicts

Hope it is fixed now... im sorry for your extra work

@Xndr2 Xndr2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Death-Watcher This pr contains the dragging and dropping code from a previous pr.
Please delete this code, or make a separate pr for this. But I've said before I wont implement the "in dashboard reordening". Looking from a UX perspective it just doesnt work. Nice implementation tho

@Xndr2

Xndr2 commented May 22, 2026

Copy link
Copy Markdown
Owner

I just saw #51
Just remove the dragging code from here, use #51 as your reference or something 😄
Afterwards ill recheck this pr

@Death-Watcher Death-Watcher force-pushed the pr/toplists-display branch from e013d55 to a18b063 Compare May 22, 2026 19:44
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.

2 participants