Skip to content

Data viewer: support multiple source references per row (bbox/page as lists) #5

Description

@lowlorenz

Summary

It would be great if the data viewer could hold multiple source references per row, by structuring the bbox and page provenance attributes as lists rather than single values.

Motivation

A single extracted data row often draws on more than one place in the source material — a value that's split across two pages, a fact corroborated by a marginal note, or a figure assembled from several regions of the same page. Today the viewer can only cite one of those, so the rest of the provenance is lost.

Current behavior

Each row carries at most one provenance reference. In chronos-vscode/webview/components/data-viewer.ts the reserved keys are scalar:

  • chronos_page → a single page id
  • chronos_bbox → a single [x,y,w,h] / {x,y,w,h} region
  • chronos_source → a single source path

These coerce into one Provenance per row ({ pageId, bbox, sourcePath }), and the UI offers a single "Show full page" / zoom-to-region handoff to the page viewer.

Proposed behavior

Allow each row's provenance attributes to be lists, so a row can reference multiple (source, page, bbox) locations. For example:

  • chronos_page: [12, 13]
  • chronos_bbox: [[x,y,w,h], [x,y,w,h]]
  • chronos_source: ["sources/foo", "sources/foo"]

The viewer would then surface each reference (e.g. multiple citation chips per row), each independently linking/zooming to its cited page + region.

Notes / things to consider

  • Keep backward compatibility: a scalar value should still be accepted and treated as a single-element list.
  • Decide how the lists align — parallel arrays vs. a list of {page, bbox, source} objects (the latter is less error-prone to keep in sync).
  • UI: render one citation affordance per reference rather than the current single handoff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions