Skip to content

feat: add profiler cards - #53

Merged
InftyAI-Agent merged 3 commits into
InftyAI:mainfrom
kerthcet:feat/map-hover-cards
Sep 6, 2026
Merged

feat: add profiler cards#53
InftyAI-Agent merged 3 commits into
InftyAI:mainfrom
kerthcet:feat/map-hover-cards

Conversation

@kerthcet

@kerthcet kerthcet commented Sep 6, 2026

Copy link
Copy Markdown
Member

No description provided.

kerthcet and others added 3 commits September 6, 2026 09:45
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>
@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

@kerthcet is attempting to deploy a commit to the InftyAI Team on Vercel.

A member of the Team first needs to authorize it.

@kerthcet

kerthcet commented Sep 6, 2026

Copy link
Copy Markdown
Member Author

/lgtm
/kind feature

@InftyAI-Agent InftyAI-Agent added needs-triage Indicates an issue or PR lacks a label and requires one. needs-priority Indicates a PR lacks a label and requires one. do-not-merge/needs-kind Indicates a PR lacks a label and requires one. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 6, 2026
@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
website Ready Ready Preview Sep 6, 2026 10:05am UTC

@InftyAI-Agent InftyAI-Agent added lgtm Looks good to me, indicates that a PR is ready to be merged. feature Categorizes issue or PR as related to a new feature. and removed do-not-merge/needs-kind Indicates a PR lacks a label and requires one. labels Sep 6, 2026
@InftyAI-Agent
InftyAI-Agent merged commit e06e8b5 into InftyAI:main Sep 6, 2026
37 of 40 checks passed
@kerthcet
kerthcet deleted the feat/map-hover-cards branch September 6, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. feature Categorizes issue or PR as related to a new feature. lgtm Looks good to me, indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a label and requires one. needs-triage Indicates an issue or PR lacks a label and requires one.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants