Skip to content

Claude/dashboard activity month labels gaowx6#63

Open
frankies2727 wants to merge 17 commits into
chihacknight:mainfrom
frankies2727:claude/dashboard-activity-month-labels-gaowx6
Open

Claude/dashboard activity month labels gaowx6#63
frankies2727 wants to merge 17 commits into
chihacknight:mainfrom
frankies2727:claude/dashboard-activity-month-labels-gaowx6

Conversation

@frankies2727

Copy link
Copy Markdown
Collaborator

No description provided.

frankies2727 and others added 17 commits July 5, 2026 13:49
- docs/src/dashboard/index.html: self-contained static dashboard (no
  external deps) with filters for jurisdiction, session, chamber, topic
  tags, and free-text search; stat tiles, bills-by-jurisdiction and
  bills-by-topic bar charts (click to filter), activity-by-month chart,
  and a sortable bills table with source links
- scripts/build_dashboard_data.py: aggregates metadata.json from cloned
  govbot repos into docs/src/dashboard/data.json, joining topics from
  govbot tag output (tags/*.tag.json) with a keyword fallback
- scripts/dashboard_tags.json: demo keyword tag definitions (govbot.yml
  tags: shape) used to build the committed sample data from the mocks
- docs/src/dashboard-guide.md + SUMMARY.md: docs chapter linking the
  dashboard and describing how to regenerate data.json

Deployed automatically by the existing deploy-docs.yml workflow, since
mdBook copies non-markdown files in docs/src verbatim into the book.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Ank9k5ifCqmNpNKP1rYkZ
…-filter-yqpxgx

Add legislation dashboard with filterable bill data visualization
…on deploy

- deploy-docs.yml: before mdbook build, shallow-clone every
  *-legislation repo from the govbot-openstates-scrapers org and
  regenerate docs/src/dashboard/data.json so the published dashboard
  covers all jurisdictions; falls back to the committed sample data
  with a warning if fetching or aggregation fails
- add a daily 8am UTC schedule (after the 6am scrapes) so Pages data
  stays fresh without manual redeploys
- build_dashboard_data.py: add --source-label for a readable footer
  source; regenerate sample data.json with it
- dashboard-guide.md: document the CI data flow

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Ank9k5ifCqmNpNKP1rYkZ
…-filter-yqpxgx

feat: build dashboard data from all govbot-openstates-scrapers repos …
The Pages deploy cloned all 56 govbot-openstates-scrapers repos but
found no bills because the aggregator assumed the mocks' exact
directory layout (**/bills/*/metadata.json at a fixed depth).

- build_dashboard_data.py: discover metadata.json at any depth in each
  repo, identify bills by content (identifier + title + jurisdiction),
  take the session from the bill's own legislative_session field with
  a path fallback, and find govbot tag output by walking ancestors for
  a tags/ directory instead of assuming it sits beside bills/
- deploy-docs.yml: when aggregation still finds nothing, print a
  layout sample of the cloned repos in the job log for debugging
- log per-repo bill counts for CI visibility

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Ank9k5ifCqmNpNKP1rYkZ
…-filter-yqpxgx

fix: make dashboard data aggregation layout-agnostic
The govbot-openstates-scrapers repos hold raw scraper output
(_data/<locale>/bill_<uuid>.json per schemas/openstates.bill.schema.json),
not the OCD-files metadata.json layout, so the deploy-time aggregation
found zero bills and fell back to sample data.

- build_dashboard_data.py: also discover bill_*.json files; accept
  jurisdiction as either the OCD-files dict or a raw OCD ID string;
  map jurisdiction codes to display names (raw output has no name);
  dedupe repeated scrapes of the same bill keeping the latest action;
  sort output for deterministic files
- index.html: make the jurisdiction/topic bar lists scroll past ~20
  rows so 50+ jurisdictions don't stretch the page
- rename the workflow to 'Deploy docs & dashboard to GitHub Pages'
  so it's recognizable in the Actions tab

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Ank9k5ifCqmNpNKP1rYkZ
…-filter-yqpxgx

feat: read raw OpenStates scraper output for dashboard data
The first full-data deploy produced a 90MB data.json (10MB gzipped),
close to the 100MB GitHub Pages per-file limit and slow to parse.

- build_dashboard_data.py: emit only fields the page reads (drop
  state_name/classification/first_action), truncate titles and action
  descriptions to display length, cap sponsors at 3, and serialize
  with compact separators — 90MB -> ~60MB raw, ~7.7MB gzipped
- index.html: loading indicator while the dataset downloads, debounced
  search (each render scans the full dataset), cap the activity chart
  at the last 24 months so one stale action date can't stretch the
  axis across decades, widen the y-axis gutter that clipped 4-digit
  tick labels

Verified with Playwright against the real 141,969-bill dataset:
3.1s load, <500ms filter interactions, no page errors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Ank9k5ifCqmNpNKP1rYkZ
…-filter-yqpxgx

perf: slim dashboard data payload for 140k+ bills
Surfaces data.json's generated_at (the daily snapshot build time) as a
visible badge under the header, formatted as 'Data as of July 5, 2026,
21:02 UTC'. formatAsOf handles ISO timestamps, bare dates, and bad
values gracefully. Footer reworded to 'Snapshot built …'.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Ank9k5ifCqmNpNKP1rYkZ
Some org repos (IL, AR, AZ, NH, NM, VA) clone but publish zero bills
because their upstream OpenStates scrapers aren't producing output. The
dashboard silently omitted them, which read as 'missing' rather than
'pending'.

- build_dashboard_data.py: emit empty_jurisdictions (repos that cloned
  but yielded no bills) in data.json
- index.html: show a note under the jurisdiction chart listing pending
  jurisdictions; they appear automatically once data lands
- dashboard-guide.md: document the badge and pending note

Verified with the real 50-jurisdiction dataset plus the six known
empty repos.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Ank9k5ifCqmNpNKP1rYkZ
…-filter-yqpxgx

Claude/GitHub pages dashboard filter yqpxgx
Places the freshness badge on the same row as the H1 (wrapping below
it on narrow viewports) instead of under the description line.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Ank9k5ifCqmNpNKP1rYkZ
…-filter-yqpxgx

style: move 'Data as of' badge up beside the dashboard title
The monthly column chart only rendered a value label on the single
peak bar, leaving every other column unlabeled. Show the count atop
each bar, keeping the peak visually emphasized. Value labels fall back
to the peak-only behavior if columns ever get too narrow to fit numbers
without collision.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012p35CoQrAgJkaxbiRvRJmo
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.

3 participants