Skip to content

Deploy to Prod 8/31 - #2230

Merged
Mephistic merged 31 commits into
prodfrom
main
Aug 31, 2026
Merged

Mephistic merged 31 commits into
prodfrom
main

Conversation

@Mephistic

Copy link
Copy Markdown
Collaborator

Changelog

  • Fix Follow Button logic
  • Frontend for Lobbying Explorer (hidden behind flag on PROD)

Getting this out now so we're working from a clean slate for the search PR deploy this afternoon

slarson and others added 30 commits March 24, 2026 20:24
When a logged-out user clicks the Follow button on the Testimony Detail
page, the action silently fails because uid is undefined and Firestore
rejects the operation with "Missing or insufficient permissions." This
adds an auth guard that redirects to /login?redirect=currentPath, matching
the existing auth redirect pattern used elsewhere in the app.

Closes #2059

Co-authored-with: Claude Code
- Extend LobbyingFiling type with registrantId; add LobbyingStats,
  LobbyingClientSummary, LobbyingPositionCounts aggregate types using
  Dictionary for string-keyed maps (runtypes v5 compat)
- Add lobbyingMeta/stats singleton collection constants; add CLIENTS_COLLECTION
- Add Firestore composite indexes for registrantId+year and clientNameNorm+year
  (DESCENDING) on lobbyingFilings to support firm and client detail queries
- Add data hooks (useLobbyingFilingsForBill, useLobbyingRegistrant, etc.)
  in components/db/lobbying.ts following existing useAsync pattern
- Add lobbying.json locale namespace; add navigation.lobbying to common.json
- Add NavbarLinkLobbying component; wire into Navbar behind lobbyingTable flag
- Add LobbyingPositionChip (support/oppose/neutral/none pill),
  LobbyingFilingsTable (configurable columns), LobbyingBillCard (sidebar card
  with position stacked bar, truncated table, explorer link)
- Replace dummy LobbyingTable in BillDetails with LobbyingBillCard
- Enable lobbyingTable feature flag in development env
- Install recharts (v3); update chartTheme.tsx for v3 TooltipContentProps API

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add /lobbying/bills browse page: session dropdown, position filter,
  bill ID search, table with per-bill filing counts and mini position bar
- Add stub pages for /lobbying, /lobbying/clients, /lobbying/firms
  and dynamic routes for client/firm detail
- Add useLobbyingFilingsForCourt hook for court-level data loading
- Fix LobbyingBillCard: surface errors in dev, handle not-requested state,
  inline collection constants to avoid pulling firebase-admin into browser
  bundle (was causing net module build error on bill detail page)
- Add lobbying namespace to bill detail page getServerSideProps so
  LobbyingBillCard translations load correctly
- Add titles.lobbying key to common.json for page title

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements four new routes for the lobbying explorer:
- /lobbying/firms — browse all registrant firms, filter by type/name
- /lobbying/firms/[registrantId] — firm detail with filings table, client list, disclosure links
- /lobbying/clients — browse unique clients derived from registrant docs
- /lobbying/clients/[clientSlug] — client detail with filings table, linked firms, position summary

Firm and client slugs use URL-encoded entityNameNorm/clientNameNorm.
Both detail pages use getStaticPaths with fallback:blocking.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Skips clientNameNorm values that are empty or equal to _total_salary_,
which is used for pre-2013 legacy filings where compensation is reported
as a single total rather than per client.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Build out /lobbying overview: stat cards (bills, clients, sessions, spend),
  dual-axis spend+filings chart, entry cards linking to browse pages
- Extract LobbyingAttribution component with correct SoS link
- Fix broken attribution on bills page (was passing Trans interpolation syntax
  to t() which rendered literal <0> tags)
- Stats and chart degrade gracefully when the pipeline stats doc is absent

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add LobbyingAttribution to firms browse/detail and clients browse/detail
- Add seedLobbyingStats admin script: reads all filings and registrants,
  computes totals and per-year breakdowns, writes to lobbyingMeta/stats
  (run with: yarn firebase-admin run-script seedLobbyingStats --env dev)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add allow read: if true for lobbyingMeta collection so the stats doc
  is readable by the frontend (was silently returning undefined)
- Move Lobbying nav item after Testimony in both mobile and desktop nav

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…il to lobbying explorer

- Add LobbyingSubnav (Overview / Bills / Clients / Lobbying Firms) to all lobbying pages
- Add usePagination hook and LobbyingPaginationBar component (50/page on all browse indexes)
- Add sortable column headers (SortTh) to bills, clients, and firms index pages
- Move bills.tsx → bills/index.tsx; add bills/[court]/[billId].tsx paginated filings detail
- Filter _total_salary_ sentinel by both clientName and clientNameNorm in clients browse
- Fix duplicate "View all lobbying activity" link in LobbyingBillCard
- Fix undefined–undefined year range on firm detail when registrant query fails
- Add composite Firestore indexes for entityNameNorm+year and clientNameNorm+year queries
- Add showActivity prop to LobbyingFilingsTable

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…onsive column hiding

- Wire t() through all lobbying components: LobbyingSubnav, LobbyingPaginationBar,
  LobbyingFilingsTable, and all browse/detail pages
- Add missing translation keys: subnav, pagination, misc, registrantType, and
  new fields (bill, positions, activity, sessions, type, firms, total)
- Add lobbying.module.css with media query to hide table columns on mobile
- Bills index: hide Session and position count columns on mobile (<768px), leaving
  Bill | Filings | Positions mini-bar
- Bill detail: hide Activity column on mobile to reduce table width
- Client and firm detail pages: paginate filings table at 25/page (year desc)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…duleNotFoundError at runtime

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
On timeout/resume, the backfill was re-fetching every Summary.aspx page
for completed years (~5 hours of HTTP requests just to re-verify nothing
was new). Now writes completedYears[] to the cursor doc on year finish;
subsequent runs skip those years entirely with zero network requests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix seedLobbyingStats to sum compensation from registrant client
  records instead of per-bill filing amounts; fixes spendByYear being
  wildly understated
- Add compute_stats() to writer.py and wire it into scrape.py so stats
  are recomputed automatically after any run that writes new data
- Add chart legend and per-axis labels (Compensation / Filings) with
  correct tooltip formatting (filings shown as count, not currency)
- Add data notes below chart explaining portal discontinuities in 2010,
  2014, and 2019 with citations to MGL Chapter 3 and Acts of 2009 Ch.28

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Show bill description (activityTitle) once in the header instead of
  repeating it verbatim in every table row
- Show General Court session (e.g. "194th General Court") below bill ID
- Remove redundant Activity column from the filings table

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…bility

- Align position colors to MAPLE bill palette: support=green, neutral=blue,
  oppose=orange (was red/gray); update chip, bar, legend, and inline styles
- Sticky subnav now measures main navbar height dynamically to avoid hiding
  under it on scroll
- Add usePrefersReducedMotion hook; disable Bar/Line animations and suppress
  recharts tooltip transition for prefers-reduced-motion users
- Make bills and clients hero stat cards clickable links to their list pages
- Bill detail page: remove compensation column (usually $0); fix dead import
- Firm detail page: show total compensation in header
- Client list: filter out "total salaries received" pseudo-client rows
- LobbyingFilingsTable: bill links now point to lobbying explorer detail page;
  show "Showing X of Y" when truncated via maxRows

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e restructure

- Add sortable Filings column to firms and clients list pages; backed by
  new lobbyingMeta/entityFilingCounts and clientFilingCounts Firestore docs
  written by compute_stats() and seedLobbyingStats
- Hide "View bill on MAPLE" link for sessions before the 192nd General
  Court (earliest session in the MAPLE bill database)
- Replace overview entry-card row with a Firms hero stat card; sessions
  count moved into the data-notes paragraph below the chart
- Add one-sentence explainer text to all four hero stat cards and to the
  top of each listing page (bills, clients, firms)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Keep NavbarLinkLobbying alongside upstream's new NavbarLinkAiTools
- Keep lobbying i18n key alongside upstream's new learn_hub / testimony keys
- Accept upstream deletion of tracked .pyc files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… summaries

The bills index page was loading every filing document for the selected
session (~30K Firestore reads) just to group them by bill ID client-side.

compute_stats() and seedLobbyingStats now build lobbyingMeta/billSummaries_{court}
docs (one per General Court) in the same filings pass, storing a
billId→{total,support,oppose,neutral,none} map (~200KB per court).

The frontend replaces useLobbyingFilingsForCourt with useLobbyingBillSummaries,
reducing the bills page load from ~30K document reads to a single doc fetch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nts/firms cols, pct-sort, orange scheme

- Bills index: session selector is now a multiselect dropdown with year
  annotations (e.g. "Session 194 · 2025–26") and an "All sessions" toggle;
  Session column appears only when multiple courts are selected
- Add Title column (sourced from activityTitle on first filing per bill)
  included in search alongside bill ID
- Add Clients and Firms (lobbyist) columns with sortable unique-entity counts
- Positions column header cycles through % Support → % Oppose → % Neutral
  on repeated clicks
- Fix position color scheme: all three count columns and mini-bar now use
  POSITION_COLORS (green/orange/blue) — oppose was previously rendering as
  red (#c71e32 / dark brownish #7a3800) in two separate code paths
- Remove LobbyingSubnav sticky positioning (it leaked above the viewport
  when the main navbar scrolled away); subnav now scrolls with content
- Seed script and writer.py: bill summaries now include title, clients,
  and lobbyists counts; stored as JSON blob to avoid Firestore index limit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Combine votes modal

* Create vote dropdown
Fix Follow button silent failure for logged-out users
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
maple-dev Ready Ready Preview Aug 31, 2026 11:29am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
maple-prod Ignored Ignored Aug 31, 2026 11:29am

Request Review

@Mephistic
Mephistic merged commit bb79c33 into prod Aug 31, 2026
13 checks passed
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.

5 participants