feat: add profiler cards - #53
Merged
Merged
Conversation
Hovering (or focusing) a region in the map's legend now shows who its percentage is made of: the five most active contributors, their commit counts and how many of the seven projects each has touched. Ranked by commits, which is a rough measure and worth being honest about — a one-line addition counts the same as a feature, and reviewing or filing counts for nothing. `repos` sits beside every count for that reason: it separates one typo from work across projects. Both numbers come out of the commit pages tools/contributors.mjs already reads for the headcount, so the ranking costs no extra API requests. The panel and the percentage beside it are counted two different ways — the share from the places on the map, the panel from the people behind them — so the generator now cross-checks them per region and fails rather than shipping a card of four people next to a row reading 29%. CSS only. Every card is already in the HTML, so this is a selector rather than a listener and it works with JavaScript off. What that costs is repositioning: the card opens to a fixed side, left over the map, chosen because the legend sits at the container's right edge and nothing can measure the viewport at runtime to turn it around. Stacked, where the legend is full width, it drops out of the row instead. The rows carry `tabindex` so the same panel opens on a keyboard, and `:focus-within` is what a tap gets on a touchscreen. The "Others" note moves off the row's `title` and into its card — left where it was, a native tooltip would have opened on top of the card a moment later. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Hovering or focusing a city's dot now opens a card naming the city, counting its contributors and showing up to five of them by avatar and GitHub handle. Replaces the panel that opened from the legend's region rows: the map already draws cities, so the detail belongs where the eye is, and a region of "Asia — 10 contributors" told nobody who they were. The legend goes back to plain percentage rows. Nothing measures the viewport at runtime — this is CSS on :hover and :focus-within, so it works with JavaScript off. Which side a card opens on is decided in the template from the city's own longitude, and how wide it can grow comes from --map-room, set per mark in the generated stylesheet: the room between that dot and the edge it opens towards, read as container query units. Without that cap the cards ran up to 34px past the map's edge at 320px wide and one of them gave the page a horizontal scrollbar. The dots' hover targets are html on top of the svg, because a card cannot be html inside an svg. Both the dot and its target are placed from the new partials/worldmap-place.html, the one place the projection is computed — worst disagreement across the 23 marks is 0.06px at 1440. The coordinates ride in a generated stylesheet rather than style attributes, which the site's own style-src 'self' refuses. Two contributors list only "United States" and so appear on no card: their country mark was pruned once US cities existed. tools/contributors.mjs now reports them instead of dropping them quietly. Verified at 320, 390, 1024 and 1440: 23 targets over 23 dots, every card opens, 33 of 33 avatars load, no card crosses a viewport edge, all closed at rest. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Every handle in a city's card is now a link to github.com/<login>, avatar and
name together as one row-wide target. The url is built in the template from the
handle the data already carries, so data/contributors.json holds no second copy
of it.
Making the card clickable meant giving it the pointer, which it did not have:
- The card was `pointer-events: none`, so it could not be reached at all.
That is now `auto`, and the cost is stated where it is paid — a card lying
over a neighbouring dot shadows that dot while it is open.
- The 4px gap between a dot and its card was 4px of dead space that closed
the card halfway to a link. The card now starts flush against the target.
- The target was a circle, and hit testing honours border-radius, so the
walk from dot to card crossed transparent corners. It is a square now; the
visible ring is the pseudo-element and has not changed.
- Neighbouring targets stole the pointer mid-walk: Chengdu sits directly
between Shanghai's dot and Shanghai's card, and being later in the document
it won the hover. The mark being read now takes a z-index while hovered.
The cap on a card goes from five faces to ten. Five cut the largest city on the
map short by one, which is a cap earning nothing; ten clears every city today,
so all 34 placed contributors are now on a card. The overflow row is an ellipsis
in the avatar column with the count beside it — headroom, not something anyone
sees at present, since the largest city has six.
Verified at 1440: the pointer walk from dot into card holds the card open and
lands on the link; 34 of 34 avatars load; every one of the 23 marks opens from
the keyboard and every one of the 34 links holds its card open while focused.
No card crosses a viewport edge at 320, 390, 1024 or 1440.
Not fixed, and worth knowing: five marks — San Francisco, Guangzhou, Paris,
Cambridge, Los Angeles — cannot be opened by aiming at their own dot, because a
nearer, later-drawn city's target covers their centre. San Francisco and Palo
Alto are 1.2 units apart on a 1000-unit map, so no target size separates them.
The keyboard reaches all 23 regardless.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@kerthcet is attempting to deploy a commit to the InftyAI Team on Vercel. A member of the Team first needs to authorize it. |
Member
Author
|
/lgtm |
|
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.
No description provided.