Fix rent label rev count to match pin badge total#2
Open
dupenodi wants to merge 2 commits into
Open
Conversation
- 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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
N revcount 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.REPORT_BADGE_LAYER):reportsHere=reps.length(total reviews)buildPreviewHtml):reportsHere(total reviews)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
formatMapPinRentLineto usereps.length(total reviews) instead ofrents.length(reviews with rent data) for theN revdisplay. The median rent calculation still correctly uses only valid rent values — only the displayed count changes.Changes
lib/place-rent-label.ts— usereps.lengthfor rev countlib/place-rent-label.test.ts— add test for mixed rent/no-rent reviewsTesting
npm test)