🧩 Background
lib/svg/layout.ts inline-computes shouldShowGhostCity via a totalVisibleContributions === 0 check spread across a forEach loop. The intent is clear but the implementation is implicit.
🎯 Objective
Extract into function isGhostCity(weeks: ContributionWeek[]): boolean and call it from computeTowers.
📁 Files to touch
🛠️ Implementation steps
- Write the pure predicate function.
- Replace the inline computation.
- Export it and add a small unit test covering 0-contribution and >0-contribution calendars.
✅ Definition of done
🧩 Background
lib/svg/layout.tsinline-computesshouldShowGhostCityvia atotalVisibleContributions === 0check spread across aforEachloop. The intent is clear but the implementation is implicit.🎯 Objective
Extract into
function isGhostCity(weeks: ContributionWeek[]): booleanand call it fromcomputeTowers.📁 Files to touch
lib/svg/layout.ts🛠️ Implementation steps
✅ Definition of done
isGhostCityis a named, exported, tested function.computeTowersreads clearly.