Skip to content

[EPAC-965]: Bill page amendments panel#804

Merged
riddim-developer-bot[bot] merged 2 commits into
mainfrom
symphony/epac-965-bill-page-amendments-tracker
Jun 14, 2026
Merged

[EPAC-965]: Bill page amendments panel#804
riddim-developer-bot[bot] merged 2 commits into
mainfrom
symphony/epac-965-bill-page-amendments-tracker

Conversation

@riddim-developer-bot

Copy link
Copy Markdown
Contributor

Summary

Adds an Amendments panel to the iOS bill page showing amendments tabled against a bill (number, mover, stage, status, optional clause descriptor), with a tap-to-expand row revealing the verbatim amendment text and the parl.ca source link.

Linear: EPAC-965
Project: Bills, Votes & Committees — depth across the legislative cycle

The ticket scope is iOS only — the backend already ships amendments via the bill-depth endpoint.

Architecture

Clean Architecture split:

Layer Artifact
Entity ios/epac/Domain/Entities/BillAmendment.swiftBillAmendment + BillAmendmentStatus (passed/defeated/withdrawn/unknown).
Port ios/epac/Domain/Ports/BillAmendmentsRepository.swift — returns [BillAmendment]?: nil ⇒ hide panel, [] ⇒ empty state, non-empty ⇒ list.
Use case ios/epac/Application/LoadBillAmendments.swiftLoadBillAmendments.execute(billID:).
Adapter ios/epac/Data/Repositories/BackendBillAmendmentsRepository.swift — calls GET /api/v1/bills/{id}, decodes the bill-depth JSON, extracts the amendments array.
View ios/epac/Views/Bills/BillAmendmentsPanel.swiftBillAmendmentsPanel (Section with rows and an optional empty-state row) + collapsed/expanded BillAmendmentRow (DisclosureGroup).
Wiring ios/epac/Views/Bills/BillDetailView.swift — autoloads the panel below the existing committee-stage panel.

The use case never imports LEGISinfo or parl.ca wire formats — the backend JSON contract is the boundary. Catalog updated for the new use case and port.

Backend contract (consumed, not added)

Endpoint: GET /api/v1/bills/{id} (existing getBillDepth operation). Status 204/404 ⇒ no record. Status 200 ⇒ bill JSON; the iOS adapter pulls bill.amendments and maps each item to the domain entity.

The adapter only reads these fields per amendment (others are tolerated/ignored): id, number, title, status, stage, sponsor_name, proposed_on, text, source_url.

Deviations from the literal ticket text

The ticket described a dedicated GET /bills/<legisinfo_id>/amendments endpoint with a richer schema (mover_member_id, clause_reference). The deployed backend exposes amendments through the existing bill-depth endpoint with a simpler schema: sponsor_name (string, not a member ID) and no separate clause_reference. Implications:

  • Mover ➜ MP profile link — not implemented. The backend records the mover's name as a string; there is no member ID to navigate to. A follow-up backend change can add mover_member_id and an iOS update can then link the name. Out of scope for this iOS-only ticket.
  • Short clause reference — there is no dedicated clause_reference field. The view shows amendment.title when present (e.g. "Clause 5 — replace subsection (2)"), which is what the backend example payloads carry today.
  • Empty state — implemented as a single in-panel row with an inbox icon and the string "No amendments tabled yet."

The boundary rule — verbatim amendment text, no paraphrasing — is preserved end-to-end: the entity carries the raw text field, the use case does not transform it, and the view renders it via Text(amendment.text).textSelection(.enabled) inside the expanded row.

Localization

EN and FR strings added under the billAmendments.* namespace in ios/epac/{en,fr}.lproj/Localizable.strings.

Tests

Unit tests (9 tests, all passing locally):

  • epacTests/Application/LoadBillAmendmentsTests — use case delegates to repository, surfaces nil / empty / populated / error.
  • epacTests/BillAmendmentsRepositoryTests — JSON decoding, 200 with multiple statuses, 200 with no amendments, 204, 404, 5xx (uses URLProtocol mock; no real network).

Snapshot tests (5 panel states × 3 modes — light, dark, accessibility-large — 15 PNGs):

  • testBillAmendmentsPanel_passed
  • testBillAmendmentsPanel_defeated
  • testBillAmendmentsPanel_withdrawn
  • testBillAmendmentsPanel_multipleBySameMP
  • testBillAmendmentsPanel_empty

Test plan

  • CI pr-build passes (unit + snapshot tests on iOS Simulator).
  • Verify the panel appears between In committee and Pre-vote lobbying context on the bill page.
  • Verify a bill with no backend amendments record shows neither the panel nor an error.
  • Verify a bill with an empty amendments array shows the empty-state row.
  • Verify tapping a row expands to reveal the verbatim amendment text with text selection enabled.

Release-Note: Bill page now shows an Amendments panel with each tabled amendment's number, mover, stage, status (Passed / Defeated / Withdrawn), and tap-to-expand verbatim text.

riddim-developer-bot added 2 commits June 14, 2026 04:30
Adds an "Amendments" panel to the iOS bill page showing amendments tabled
against a bill, with mover name, stage, status badge (passed/defeated/
withdrawn), and a tap-to-expand row revealing the verbatim amendment text.

Backend integration uses the existing GET /api/v1/bills/{id} bill-depth
endpoint, which already carries the embedded amendments array. The iOS layer
decodes only the typed JSON shape — LEGISinfo and committee-minute parsing
remain backend responsibilities.

Hides the panel when the backend has no amendments record for a bill, and
renders an empty-state row when the bill is tracked but no amendments have
been tabled yet.

Includes Clean Architecture port + use case + adapter split, EN/FR
localization, unit tests for the use case and repository, and snapshot tests
for passed / defeated / withdrawn / multiple-by-same-MP / empty states.
Updates the use-case catalog with the new LoadBillAmendments entry and the
new BillAmendmentsRepository port.
Records reference PNGs for the five new BillAmendmentsPanel snapshot tests
(passed, defeated, withdrawn, multipleBySameMP, empty) in light, dark, and
accessibility-large variants.
@riddim-developer-bot
riddim-developer-bot Bot enabled auto-merge (squash) June 14, 2026 08:51
@riddim-developer-bot
riddim-developer-bot Bot merged commit b7872c1 into main Jun 14, 2026
35 of 36 checks passed
@riddim-developer-bot
riddim-developer-bot Bot deleted the symphony/epac-965-bill-page-amendments-tracker branch June 14, 2026 08:54
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.

0 participants