Skip to content

Fix rent label rev count to match pin badge total#2

Open
dupenodi wants to merge 2 commits into
mainfrom
cursor/fix-pin-review-count-consistency-9764
Open

Fix rent label rev count to match pin badge total#2
dupenodi wants to merge 2 commits into
mainfrom
cursor/fix-pin-review-count-consistency-9764

Conversation

@dupenodi

Copy link
Copy Markdown
Owner

Problem

The N rev count shown in the map pin rent label (beneath the pin) could disagree with the badge number shown on the pin and the count in the hover popup.

  • Pin badge (REPORT_BADGE_LAYER): reportsHere = reps.length (total reviews)
  • Hover popup (buildPreviewHtml): reportsHere (total reviews)
  • Rent label (formatMapPinRentLine): rents.length (only reviews with valid positive rent)

If a place had 5 reviews but only 3 had valid rent data, the badge showed "5", hover said "5 reviews", but the label said "3 rev".

Fix

Changed formatMapPinRentLine to use reps.length (total reviews) instead of rents.length (reviews with rent data) for the N rev display. The median rent calculation still correctly uses only valid rent values — only the displayed count changes.

Changes

  • lib/place-rent-label.ts — use reps.length for rev count
  • lib/place-rent-label.test.ts — add test for mixed rent/no-rent reviews

Testing

  • All 54 unit tests pass (npm test)
  • ESLint clean on changed files
Open in Web Open in Cursor 

cursoragent and others added 2 commits April 14, 2026 13:54
- Document services overview, required secrets, and dev commands
- Note gotchas: npm lockfile, --webpack flag, middleware deprecation warning
- Reference pre-existing lint errors to avoid false regression reports

Co-authored-by: Sarath Donepudi <dupenodi@users.noreply.github.com>
The 'N rev' text in the map pin rent label used rents.length
(only reviews with valid positive rent) instead of reps.length
(total reviews at this place). This caused a mismatch with the
badge and hover popup which both show total review count.

Now all three surfaces — badge, hover, and rent label — show
the same total review count.

Co-authored-by: Sarath Donepudi <dupenodi@users.noreply.github.com>
@vercel

vercel Bot commented Apr 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pgtruth Ready Ready Preview, Comment Apr 14, 2026 3:00pm

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