Skip to content

Admin: Add arbitrary dataset-revision comparison and field-level diff views #336

Description

@gekichumai-admin

Phase / step: Phase 4 — Provenance / Step 3
Parent: #301
Depends on: #335, #330

Context and goal

Dataset publications form an immutable revision history. Administrators must be able to compare any two retained revisions for a chart—not only adjacent revisions—and understand the data/evidence changes that produced each field change.

Scope and implementation notes

  • Add a dataset-publication timeline for a chart with immutable revision identity, publication timestamp, completeness marker, and a concise change summary.
  • Let the user select arbitrary base and comparison revisions, swap them, and copy a URL that restores both selections.
  • Render field-level added, removed, and changed values using canonical paths. Include resolution-state, chosen-source, candidate, rule, and reason changes when those differ even if the final value is unchanged.
  • Provide summary counts and filters for value changes, evidence-only changes, provenance gaps, and manual overrides.
  • Use appropriate comparison presentation by value shape: concise inline diff for scalars and structured before/after views for arrays/objects. Do not reduce structured values to unreadable JSON blobs by default.
  • Link each changed side to its field provenance drawer and retained raw evidence.
  • Mark best-effort backfilled revisions and missing historical evidence explicitly. Never invent a source or silently treat missing history as unchanged.
  • Handle chart creation/removal between selected revisions and revisions where the chart identity cannot be resolved.

Acceptance criteria

  • Any two retained dataset-publication revisions can be selected and compared in either direction.
  • Revision selections and active diff filters survive reload through URL parameters.
  • Added, removed, value-changed, and evidence-only-changed fields are represented correctly.
  • Candidate, selection-rule, decision-reason, and source changes are visible even when the chosen value is equal.
  • Each diff row links to the corresponding provenance detail and raw evidence when available.
  • Incomplete historical data is labelled rather than inferred.
  • Creation, removal, and unresolved identity cases have dedicated states.
  • Large diffs remain navigable with filtering and incremental rendering/pagination as supported by the API.
  • Component tests cover scalar, nested, array, evidence-only, unknown, and historical-incomplete changes.

Out of scope

  • Restoring an old revision as the active dataset.
  • Comparing entire datasets across all charts in one browser view.
  • Editing revision metadata.
  • Data-publication controls.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    adminAdministrator dashboard, RBAC, moderation, provenance, and chart reportsenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions