# congress/ — Maine's U.S. Senators and U.S. Representatives (v1.1, 2026-10-05)

Two public pages, modelled on the Governors page: **U.S. Senators** `https://mainepoliticaldata.com/us-senators/` and **U.S. Representatives** `https://mainepoliticaldata.com/us-representatives/` (Historical menu, above Governors). Each has a stats strip, a party timeline (one lane per Senate seat / per congressional district), the Election Results hub's explorer limited to that office, tiles in order of first service with notes, and a Sources note.

| File | What it is |
|---|---|
| `lib_senators.txt`, `lib_representatives.txt` | The Law Library's *U.S. Senators From Maine, 1820–* and *U.S. Representatives From Maine, 1821–* (rev. 11/18/2024), transcribed table-for-table (`Congress \| name (rs./f.v./d. date) \| district \| party as printed \| residence \| profession`). **These are the lists the pages follow**, as the Governors page follows the Library's governors list. |
| `senate_dates.txt` | The Senate Historical Office's Maine list (senate.gov/states/ME): exact dates of service and party sequence of every Senate tenure, by class. |
| `congress_legislators.json` | Maine terms from the public-domain unitedstates/congress-legislators dataset (bioguide ids, birth dates, exact modern House dates). |
| `build_data.py` | Builds the two tenure tables from the three sources: `us_senators.csv` (42 spells of continuous service, 37 people: seat/class, exact dates, party group and sequence, Library party label, residence, how the spell began, bioguide, birth, days) and `us_representatives.csv` (165 spells, 158 people: districts in order, first/last Congress, dates, party, residence, profession, began/ended, per-district `segments`). Party groups: DR Democratic-Republican (the Library's "Rep." before the 34th Congress), F Federalist, NR National Republican, W Whig, D Democratic, R Republican, GB Greenback, U Unenrolled (v1.1; was I Independent), UNK party not listed (none at present). |
| `build_congress.py` | Builds both pages from `congress_template.html`, the CSVs, `../site-design/brand/favicon_tags.html`, `../site-design/shared/hist_nav.py` and `../governors/build_gov_explorer.py` (U.S. Senate / U.S. House races from `../site-design/hubs/elections.json`). Tile notes are hand-entered in `NOTE_S` / `NOTE_H` (keyed by name and first year). Display spellings corrected in `DISPLAY` (Ezekiel Whitman, Isaac Reed); the CSVs keep the Library's spelling. |
| `portraits/` | `<slug>.jpg` per person (name as in the CSV, lower-cased, non-letters as hyphens, e.g. `margaret-chase-smith.jpg`, `ralph-o-brewster.jpg`, `angus-s-king-jr.jpg`). **Senators: all 37 since 2026-10-05** (Matt's `NewSenators.zip`; PNGs saved as JPEG). `build_congress.py` embeds a tile-sized copy, so keep the full-size file here. |
| `portraits_house/` | **House-era portraits (2026-10-21, Matt's `NewReps.zip`, 15 files: Garland, Tupper, Kyros, Emery, Snowe, McKernan, Brennan, Andrews, Longley Jr., Baldacci, Allen, Michaud, Pingree, Poliquin, Golden)**, same slugs as `portraits/`. Matt: these represent a member "here, and ONLY here" — the Representatives page prefers `portraits_house/`, then `portraits/` (so Hathaway and Cohen keep their Senate portraits there); the Senators and Governors pages never read it. A person's own /people/ page shows the portrait of the most recent office held (`site-design/people/portrait_pick.py`), so Snowe's page keeps her Senate portrait and Brennan's (House 1987–91, after his governorship) shows his House one. With these, every representative from Peter Garland (1961) to Jared Golden has a portrait; the 132 members before 1961 without a Senate portrait still show initials. |

**Rebuild:** `python3 build_data.py && python3 build_congress.py` (run `site-design/hubs/build_hubs_data.py` first when election results change). Dates: Senate tenures carry the Senate's exact dates; House terms are dated to the opening of each Congress (March 4 through 1933, January 3 from 1935) unless the Library gives a day, and from 1935 to the exact dates in the dataset. Two vacancies the Library's list does not mark are corrected in `build_data.py` (Clyde Smith d. 1940-04-08 / Margaret Chase Smith f.v. 1940-06-03; Frank Fellows d. 1951-08-07 / Clifford McIntire f.v. 1951-10-22). See FLAGS.md.

## What changed in v1.1 (2026-10-05)
* **Unenrolled, never Independent (Matt's ruling: Maine has no Independent party; such officeholders are officially unenrolled).** Sen. Angus S. King Jr.: `party` I → U in `us_senators.csv`; his tile reads "Unenrolled" and his note "Governor of Maine 1995–2003; unenrolled (no party); caucuses with the Democrats." `party_library` keeps the Library's "Ind." and `party_seq` keeps the Senate Historical Office's "I", as printed. The "party not listed" code is now UNK (it was U; no row uses it). `build_data.py`, `build_congress.py` and `congress_template.html` (legend, colours: Unenrolled keeps the old Independent colour) changed; both pages rebuilt.
* The rebuild also moves the sitting members' service end to the build date (days column; Collins, King, Pingree, Golden) — routine.
* Not changed: the results explorer on both pages comes from `site-design/hubs/elections/page.js` (shared with the Election Results page) and still labels IND candidates "Independent".

## 2026-10-21 — House portraits
* `portraits_house/` added (see the table). `build_congress.py`: Representatives tiles read `portraits_house/` first. The built `us_representatives.html` was patched in place (tile images and one Sources sentence) rather than rebuilt, because a full rebuild re-reads the Election Results explorer; the patch reproduces the builder's thumbnails byte-for-byte (checked on the 14 unchanged tiles), so the next rebuild gives the same page.
* Later the same day (Matt: "The priority is ANY picture, so if we have one, use it"): a tile with no portrait for its own office shows the person's /people/ portrait (`portrait_pick.fallback`, via `people_links.json`). Representatives page: 41 tiles with portraits (15 House-era, 26 from the Senate or Governor folders — e.g. Kavanagh, Dingley, Dunlap, Washburn, Perham). An office-specific file dropped in `portraits_house/` later replaces the fallback on that page only.
* Crop (Matt): tile pictures are aligned to the top of the frame (`.ph img{object-position:50% 0}` in `congress_template.html`), scaled to the frame's width, the bottom cut — no more cut-off heads.
