Skip to content

Ballot question follow-up fixes#49

Merged
LexaMichaelides merged 4 commits intofeat/ballot-questionsfrom
bq-final-fixes
Apr 10, 2026
Merged

Ballot question follow-up fixes#49
LexaMichaelides merged 4 commits intofeat/ballot-questionsfrom
bq-final-fixes

Conversation

@tripledoublev
Copy link
Copy Markdown
Member

@tripledoublev tripledoublev commented Apr 9, 2026

Summary

This PR includes changes for the ballot-question demo follow-up fixes and includes the additional cleanup needed to make the BQ perspective/testimony-count behavior and BQ testimony display consistent with existing bill patterns.

Changes

  • Remove all BQ perspectives from the Browse Testimony page

    • Excludes testimony with a ballotQuestionId from the Typesense testimony index.
    • Updates search index versioning so filter/indexer logic changes force a new collection version and alias rollout instead of silently reusing the old index.
    • Important operational note: existing indexed BQ testimony/perspectives will only disappear from Browse Testimony after the Typesense/admin reindex path runs.
  • Fix the way ballot questions display on Followed Content so that it shows the question number and title

    • Updates the followed ballot-question card to show the ballot-question label and title/description instead of the weaker fallback display.
  • Perspective count does not automatically increase after submitting

    • Replaces the page-refresh workaround with persisted ballot-question testimony counters.
    • Adds testimonyCount, endorseCount, neutralCount, and opposeCount to ballot-question documents.
    • Reuses the testimony count update path on publish/delete so ballot questions now update on write, the same way bills do.
    • Updates the ballot-question detail and browse pages to read stored counters, with a safe fallback for legacy docs that have not been backfilled yet.
    • Adds an admin backfill script for existing ballot questions and updates ballot-question YAML sync so live counters are preserved during future syncs.
  • Remove duplicated copy “share your perspective” on the button and in the component text in the Your Perspective component

    • Makes the compact panel title optional for the ballot-question CTA path so the duplicate heading is removed.
    • Restores the expected Complete button styling.
  • Committee hearing should open in new tab, and link format should reflect that (diagonal arrow)

    • Opens committee-hearing links in a new tab and updates the UI to show the external-link arrow.
  • On BQ Perspectives tab, retain the small text saying “review testimony on the related bill” and remove the larger callout that says “submit”

    • Keeps the small explanatory copy and removes the redundant larger submit callout.
  • Viewing “BQ testimony” on its own page shows the title of the bill but the side panel shows ballot question detail; it should show the title of the BQ

    • Loads ballot-question data into the testimony detail page state when the testimony belongs to a ballot question.
    • Updates the testimony header and side-panel policy actions to show the ballot-question title instead of the bill title for BQ testimony.
  • Include Ballot Questions in the Newsfeed updates

    • Adds ballot questions to the Newsfeed filter set.
    • Wires ballot-question fields through the Newsfeed card components.
    • Adds the ballot-question-specific card title/following-match path so the follow context renders correctly.

Tests

  • nvm use 20.19.0 && corepack yarn check-types
  • nvm use 20.19.0 && corepack yarn jest components/NewsfeedCard/NewsfeedCard.test.tsx components/testimony/TestimonyDetailPage/BillTitle.test.tsx components/testimony/TestimonyDetailPage/PolicyActions.test.tsx components/ballotquestions/BallotQuestionDetails.test.tsx --runInBand
  • nvm use 20.19.0 && cd functions && corepack yarn jest src/testimony/updateTestimonyCounts.test.ts src/notifications/populateBallotQuestionNotificationEvents.test.ts src/notifications/deliverNotifications.test.ts --runInBand

@tripledoublev tripledoublev changed the title Finalize ballot question follow-up fixes Ballot question follow-up fixes Apr 9, 2026
@tripledoublev tripledoublev force-pushed the feat/ballot-questions branch from 7c6ba47 to 47f13cb Compare April 10, 2026 15:13
@LexaMichaelides LexaMichaelides merged commit f515dcd into feat/ballot-questions Apr 10, 2026
8 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.

2 participants