Skip to content

Show market cap/P-E on Congressional buy rows - #13

Merged
wjleece merged 2 commits into
mainfrom
feat/congress-market-cap-pe
Sep 20, 2026
Merged

wjleece merged 2 commits into
mainfrom
feat/congress-market-cap-pe

Conversation

@wjleece

@wjleece wjleece commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Congressional buy rows now show the same market-cap/P-E context the corporate rows already show, using the new market_cap_musd/pe_ratio columns get_congress_alerts_web() now returns (insider-trading-app PR #30, already deployed and verified live).
  • marketCapDisplay is now shared between BuyAlertRow and CongressAlertRow (same field, same units, same point-in-time-at-detection semantics).
  • Added congressPeDisplay as a thin wrapper distinct from peDisplay — BuyAlertRow.min_pe is an aggregate across a ticker's clustered officer buys, CongressAlertRow.pe_ratio is a single per-transaction value, so they're genuinely different fields sharing one formatter internally.
  • The market-cap/P-E line is omitted entirely (not rendered as "—") when a ticker hasn't been enriched yet or has no Finnhub data, rather than showing a half-empty line.
  • Fixed a duplicate-marketCapDisplay-import bug caught by astro check while wiring this up (was imported from both @lib/insiderSignals and @lib/congressSignals, which both re-export the same function).

Test plan

  • vitest run — 27/27 passing (added tests for congressPeDisplay and marketCapDisplay on a CongressAlertRow shape)
  • astro check — same 4 pre-existing errors as on main (unrelated Button.astro/GoogleTagManager.astro prop typing), no new errors
  • Verified in the browser against live production data (npm run dev) — Congressional rows render $26.1B market cap · P/E 17.2 etc. next to the Senate badge, matching the corporate row styling

🤖 Generated with Claude Code

Bill Leece and others added 2 commits September 20, 2026 18:58
congress_buy_alerts_v1 now returns market_cap_musd/pe_ratio
(insider-trading-app PR #30), so Congressional rows can show the same
company context the corporate rows already do. marketCapDisplay is
now shared between BuyAlertRow and CongressAlertRow (same field,
same units); pe_ratio gets its own congressPeDisplay wrapper since
it's a single per-transaction value, not BuyAlertRow's min_pe
aggregate. The line is omitted entirely (not shown as "—") when a
ticker hasn't been enriched yet.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Lets future sessions preview this Astro site via the built-in
browser tooling (astro dev on port 4321) instead of driving it
through Bash.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@wjleece
wjleece merged commit cf459ad into main Sep 20, 2026
1 check passed
@wjleece
wjleece deleted the feat/congress-market-cap-pe branch September 20, 2026 23:59
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