You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(components/MaintainersMap): drop 'paint' bounds that always match the host - #1626
Since #1572 made the globe surface an absolute inset-0 child of a host with no padding or border, MaintainersMap's paintWidth, paintHeight and paintTop always equal width, height and 0. This drops those fields and uses the host bounds directly. It also removes the ResizeObserver on the surface, which only duplicated the host observer, and the data-globe-surface attribute, whose CSS selector was removed in #1572.
Rendering and interaction are unchanged. The old code read the same box twice with integer clientWidth, which could differ by up to 1px from subpixel snapping; it now uses the host measurement only.
Verification
Measured the homepage globe locally on main and on this branch with the same steps (pause, reset, zoom to max and min, open a profile):
1280px
500px
Drawing area
1190 × 1190
500 × 625
Sphere bbox
[26, 26, 1137, 1137]
[-35, 28, 570, 570]
Visible profiles
63
65
Zoom in / out clicks to limit
1 / 2
0 / 2
Profile popover
opens
—
Both branches produced identical values. Resizing across the 640px breakpoint redraws the globe at the new size, and there are no console errors.
Summary by CodeRabbit
Bug Fixes
Improved the globe map’s sizing when its display area changes, including on mobile.
Map pins are now clipped and positioned within the visible map area.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
No actionable comments were generated in the recent review.
Walkthrough
MaintainersMap now sizes its projection and drawing surface from the host element. Mobile pin clipping uses host bounds, and the resize observer watches the host rather than the surface.
Changes: Maintainers map sizing
Layer / File(s)
Summary
Host bounds and resize observation src/components/MaintainersMap.tsx
GlobeBounds no longer stores painted-surface dimensions or offset. Bounds updates use host dimensions, and the resize observer watches the host.
Pin clipping and globe drawing src/components/MaintainersMap.tsx
Mobile pin clipping uses host bounds. Drawing and scale adjustment use host dimensions, and the surface no longer has the data-globe-surface attribute.
This refactor makes the maintainers map use the host element's measured size directly. Rendering and interaction are intended to stay the same, and no concrete risk was found, so it looks safe to merge.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the refactor of MaintainersMap and the removal of paint bounds that match the host. The raw summary confirms the change: sizing now uses host bounds, paint dimensions and the vertical …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the refactor of MaintainersMap and the removal of paint bounds that match the host. The raw summary confirms the change: sizing now uses host bounds, paint dimensions and the vertical offset are removed, and updateBounds observes the host. The title is specific and accurate, and it is concise. The title does not mention the removal of the surface ResizeObserver or the data-globe-surface attribute, but the title does not need to cover every detail.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 7631600e-3a03-4325-a195-44579df93052
Commits
Reviewing files that changed from the base of the PR and between 77e721b and 47f277a.
Files selected for processing: 1
src/components/MaintainersMap.tsx
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.
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
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.
Summary
Since #1572 made the globe surface an
absolute inset-0child of a host with no padding or border,MaintainersMap'spaintWidth,paintHeightandpaintTopalways equalwidth,heightand0. This drops those fields and uses the host bounds directly. It also removes theResizeObserveron the surface, which only duplicated the host observer, and thedata-globe-surfaceattribute, whose CSS selector was removed in #1572.Rendering and interaction are unchanged. The old code read the same box twice with integer
clientWidth, which could differ by up to 1px from subpixel snapping; it now uses the host measurement only.Verification
Measured the homepage globe locally on main and on this branch with the same steps (pause, reset, zoom to max and min, open a profile):
Both branches produced identical values. Resizing across the 640px breakpoint redraws the globe at the new size, and there are no console errors.
Summary by CodeRabbit