Skip to content

Page: who built what - #8

Merged
Fengzdadi merged 1 commit into
mainfrom
page/builders
Nov 3, 2026
Merged

Fengzdadi merged 1 commit into
mainfrom
page/builders

Conversation

@Fengzdadi

Copy link
Copy Markdown
Owner

What this changes

Every building now knows who built it, meaning whoever added its file. Hovering a building shows its builder. A new builder button on the timeline (or B) lists everyone who built the city, with how many buildings each put up. Picking one lights up their buildings and puts ?by=<name> in the address, so that link opens with them lit.

No issue: the maintainer asked for it directly.

Why

"Which of these buildings are mine?" is the most personal question someone can ask of their repo's city, and the most shareable answer ("I built 43 of flask's 125 buildings"). The scanner already walks every commit's file changes, so knowing who made each one costs almost nothing.

How

  • Scanner: git log reads %aN with each commit. That is the name .mailmap gives, so one person with two emails counts as one builder, and no emails are kept. A file's record takes its builder from the commit that added it. That record already follows moves, deletions and files added back, so the builder does too.
    • The city gets authors, sorted by buildings built (most first). Each file and deleted file gets b, an index into it.
    • A file that was already there before the commits read (--max-count truncation) has no builder. Its birth is looked up between sampled points, so who added it isn't known.
  • Page: hover adds a "built by" row.
    • The panel lists builders with buildings standing. Past eight builders it gets a search box and shows 60 rows at a time.
    • Picking a builder uses the existing focus mechanism with uFocus = N, which matches no building, so import arcs and traffic dim as they do around a focused building. Esc, or clicking a building, clears it.
    • The button is hidden for a city with one builder, or one scanned before this change.
  • Pixel style: the rest of the city recedes to 25% instead of 55% while a builder is lit, and their buildings warm a little. At 55% the difference was hard to read when the lit buildings are scattered across the city. Focusing one building looks as before. A share card drawn while a builder is lit comes out unlit.

Type of change

How I checked it

Repo Files City before → after Notes
this repo 37 unchanged one builder: button hidden, tooltip shows it
pallets/flask 125 Paris → Paris 25 builders, 16 with buildings standing; checked in the browser, pixel and neon
DefinitelyTyped 28,512 not compared 1,656 builders; +~150 KB on a 6.4 MB city (~2%); truncated, 18k of 35k buildings have a builder
the 11 pinned repos all unchanged snapshots move only by the new by field
  • test/history.mjs: two new cases. A file moved, edited by others, or deleted keeps its first author; .mailmap folds two emails into one name; a file from before the commits read has no builder.

  • In the browser (flask): the panel, search with Enter, the B key, ?by= on load, clearing with Esc and with a click, hover, the share card while a builder is lit, and the panel at 375 px wide (no horizontal scroll).

  • Ran at least one small repo (under 50 files) and one large one (over 1,000)

  • Played the timeline from the start: land, buildings, names and traffic appear in order

  • Compared --bench on a big repo (only if this touches rendering or the building merge): one more uniform in the pixel shader, nothing in the merge

  • The other styles still load (only if this touches shared code): pixel and neon

Checklist

  • No new runtime dependencies
  • File names, paths and author names from a repo are never inserted as HTML (textContent only)
  • Comments explain why, and the code matches its surroundings
  • README updated (the controls paragraph)

Not in this pull request

  • The share button's link still has no ?by=; only the address does.
  • "Which buildings did I edit", by commit count, is left for a second version.

🤖 Generated with Claude Code

The scanner now records who added each file, and the page can light up
one builder's buildings. A building's builder is whoever added its file:
it stays theirs when the file is moved, edited by others, or deleted and
added back.

- scan: the git log walk reads %aN with each commit (the name .mailmap
  gives, so one person's two emails are one builder; no emails are kept).
  The city gets `authors`, most buildings first, and each file and
  deleted file a `b` index into it. A file there before the commits read
  has none.
- Hover says who built a building.
- The builder button on the timeline (or B) lists the builders with how
  many buildings they put up, with a search box past eight. Picking one
  lights their buildings and recedes the rest, and puts ?by=<name> in the
  address, which lights them again on load. Esc or a click on a building
  clears it. Hidden for a city with one builder, or one scanned before.
- Pixel style: the rest recedes to 25% instead of 55% while a builder is
  lit (55% was hard to read for buildings scattered through the city),
  and theirs warm a little. A share card drawn meanwhile is unlit.
- Snapshots record each file's builder by name; nothing else moved.
  test/history.mjs: moves, deletions, .mailmap, a history read in part.

On DefinitelyTyped (28k files, 1,656 builders) it adds ~150 KB to a
6.4 MB city.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Fengzdadi
Fengzdadi merged commit beb7533 into main Nov 3, 2026
6 checks passed
Fengzdadi added a commit that referenced this pull request Nov 3, 2026
Brings in who built what (#8) and the scanner bump (#5) before the chip fixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant