Skip to content

Amendment urls - #1482

Draft
tillprochaska wants to merge 4 commits into
mainfrom
amendment-urls
Draft

Amendment urls#1482
tillprochaska wants to merge 4 commits into
mainfrom
amendment-urls

Conversation

@tillprochaska

Copy link
Copy Markdown
Collaborator

Merge #1472 first.

@tillprochaska
tillprochaska force-pushed the odp-document-scraper branch from 16647c9 to d808446 Compare July 6, 2026 10:45
Base automatically changed from odp-document-scraper to main July 6, 2026 10:55
@tillprochaska
tillprochaska requested a review from Copilot July 7, 2026 12:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for storing, exporting, serving, and displaying an “amendment PDF URL” for amendment-related votes (sourced from the EP ODP plenary-documents endpoint), including a new UI affordance to let users open the amendment text.

Changes:

  • Backend: add amendment_url to the vote model + migration, export output, and related-votes API serialization.
  • Scraper: extend ODPDocumentScraper to derive an amendment PDF URL from ODP “amendment list” ranges.
  • Frontend: add an action slot to Card and render an external-link action in AmendmentVoteCard (including a new SVG symbol).

Reviewed changes

Copilot reviewed 12 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/src/images/icons.svg Adds an external-link SVG symbol used by the UI action link.
frontend/src/components/Card.tsx Adds an action slot to cards (note: currently missing className passthrough).
frontend/src/components/Card.css Switches card layout to CSS grid and introduces .card__action area.
frontend/src/components/AmendmentVoteCard.tsx Displays a “View text” external link when amendment_url is present.
frontend/src/api/generated/types.gen.ts Extends RelatedVote with amendment_url.
backend/howtheyvote/scrapers/votes.py Derives amendment_url in ODPDocumentScraper and includes it in fragments.
backend/howtheyvote/models/vote.py Adds amendment_url column mapping to the Vote model.
backend/howtheyvote/export/init.py Includes amendment_url in the votes export row + CSV output.
backend/howtheyvote/api/votes_api.py Includes amendment_url in the related-votes API payload.
backend/howtheyvote/api/serializers.py Adds amendment_url to RelatedVoteDict schema typing.
backend/howtheyvote/alembic/versions/81451d6f5456_add_amendment_url_column_to_votes_table.py Migration to add/drop the amendment_url column.
backend/tests/scrapers/test_votes.py Updates scraper tests and adds coverage for amendment URL derivation.
backend/tests/export/test_init.py Updates export tests for the new CSV column.
backend/tests/api/test_votes_api.py Updates API tests to expect amendment_url.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/components/Card.tsx Outdated
The amendment full-text is part of an amendment list that contains multiple amendments by the same authors. This retrieves all amendment lists for a document, then finds the list that contains the vote’s amendment number.

This requires the `amendment_number` to be present, i.e. it will work only after the VOT lists have been scraped.
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.

2 participants