Skip to content

Add a topic-centric view comparing MKs and parties on one issue #4

Description

@yav02

The UI only offers a per-MK and per-party grid (ui/src/App.tsx, PartyBoard, MKCard). There is no way to pick an issue and see where everyone stands on it — neither individual MKs side by side, nor parties as a whole. That is the other half of the product idea, and it is the view most readers actually want going into an election.

What to build

A view switcher in ui/src/components/ControlsHeader.tsx toggling between:

  • תצוגת חברי כנסת / מפלגות — the current grid
  • תצוגת נושאים / מטריצת עמדות — the new topic-centric view

A per-issue matrix. With an issue selected, group MKs into stance tiers — תמיכה / ודאות גבוהה, כיסוי חלקי / ודאות בינונית, ניטרלי, אין התייחסות — and show stated positions against actual voting records for that issue across parties.

A party-level aggregate. Alongside the individual members, show where each party stands as a whole on the selected issue, so the view answers "where does this party stand" and not only "where does this MK stand".

A backend endpoint. Something like /api/issues/{issue_key}/mks or /api/issues/matrix in src/mk_tracking/ui_app/api.py and repositories/bigquery_repository.py, so the view can be built from one request rather than assembled client-side.

A prototype already exists

The feature/per-party-stats branch carries a working prototype of the party-aggregate half: ui/src/components/PartyScoreAxis.tsx plots each party's members along a 1–5 rating axis for the selected issue, with the backend exposing a new ratings field per MK. It builds and runs, but the layout is unfinished and it has no test coverage. It is a starting point, not a finished feature.

Questions to settle before finishing it

  • How to aggregate a party. A mean hides disagreement, which is often the interesting part. A distribution or range may represent a party more honestly than a single number.
  • How to handle MKs with no evidence. They must not be folded into an average as though they were neutral. See the evidence rules in ui/CONTRIBUTING.md: a missing opinion is none, never neutral, and absence of evidence is not evidence of a moderate position.
  • Minimum coverage. A party where two of thirty members have any evidence should probably show no aggregate at all.

Files likely involved

  • ui/src/App.tsx
  • ui/src/components/ControlsHeader.tsx
  • a new ui/src/components/IssueBoard.tsx
  • ui/src/components/PartyScoreAxis.tsx (on the prototype branch)
  • src/mk_tracking/ui_app/api.py
  • src/mk_tracking/ui_app/repositories/bigquery_repository.py

Note that the voting-record half depends on bills and votes reaching the summaries at all — see the issue on using bill votes and sponsorship in MK summaries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions