Skip to content

STIT-478 simplify source data display#102

Open
jasonbrownrmi wants to merge 4 commits into
mainfrom
STIT-478-simplify-source-data-display
Open

STIT-478 simplify source data display#102
jasonbrownrmi wants to merge 4 commits into
mainfrom
STIT-478-simplify-source-data-display

Conversation

@jasonbrownrmi
Copy link
Copy Markdown
Contributor

@jasonbrownrmi jasonbrownrmi commented May 22, 2026

Summary

  • Replaces the separate "Source Details" and "Source data" sections on the resource detail
    page with a single "Sources" section, per STIT-478. Each source renders as a
    compact row showing source label, "Imported by {producer} · {observed date}", and a View
    action.
  • Clicking View reveals basic source fields formatted as record_id, run_id,
    and the raw payload JSON live behind a nested "Technical import record" disclosure so raw
    JSON is never visible by default.
  • Eager-fetches /oil-gas-field-sources/{id}/detail per row on mount (deduped by TanStack
    Query cache key) so producer + observed_at populate the row before any interaction. For
    null-id sources (LLM-persisted suggestions awaiting merge), the View button is disabled.

Acceptance criteria coverage

  • Only one source-related section ("Sources") appears on the resource detail page.
  • Raw JSON is not visible by default — it's two clicks away (View → Technical import
    record).
  • Each row shows source label, producer, and observed date (with fallback when
    missing).
  • Clicking View reveals details for that source only.

Test plan

  • npm run test:run — 157/157 passing locally, including 25 in
    ResourceDetailPage.test.jsx (new tests cover the row meta line, the View/Hide toggle
    aria, and the two-step raw-payload reveal).
  • Manual against mock data (VITE_USE_MOCK_DATA=true npm run dev): open a resource,
    verify single Sources section, rows show for producer/date (mock data omits
    source_record), View expands inline, Technical import record stays collapsed.
  • Manual against local backend: producer + formatted date populate after the parallel
    detail fetches resolve; raw payload only appears after opening the nested disclosure.
  • Keyboard / screen reader: Tab → View → Enter expands the row; aria-expanded
    toggles correctly on both the outer and nested buttons.

Notes

  • New row card uses bg-panel / border-line (matching the Identity/Production/AI
    Suggestion sections) rather than the previous bg-white / border-gray-dark/15 from
    SourceDetailCard.
  • Assumes ≤ ~4 sources per resource (one per known source key). If that grows
    significantly, we may want to revert to lazy-on-open per row.

Mitigations if too many sources becomes a problem:

  1. Backend change (cleanest): add producer and observed_at (or the whole source_record
    summary) to OGFieldSourceView. Then useResourceDetail already carries everything the compact
    row needs, zero extra fetches.
  2. Bulk endpoint: GET /oil-gas-field-sources/details?ids=... returning N records in one
    request. One round-trip instead of N.
  3. Lazy-on-open with stub row: revert to fetching only when View is clicked, and show the row
    with just label + name + "View" (no producer/date until clicked). Violates the spec literally
    but is fine if N is large.

- Replace the separate "Source Details" and "Source data" sections on the resource detail page with a single "Sources" section.
- Each source is a compact row showing source label, "Imported by {producer} · {observed_date}", and a View action.
- Clicking View reveals basic source fields, with record_id, run_id, and raw payload JSON tucked behind a nested "Technical import record" disclosure so raw JSON is never visible by  default.
- Eager-fetches per-source detail on mount (deduped by TanStack Query cache key) so producer and observed_at populate the row before any interaction.
@github-actions
Copy link
Copy Markdown

CD summary a849f8b

Frontend: https://witty-mushroom-017a3dc1e-102.westus2.1.azurestaticapps.net

Deployments (4)
service url fqdn
api open pr102-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io
entity-linkage open pr102-entity-linkage.purplegrass-c07d0a94.westus2.azurecontainerapps.io
frontend https://witty-mushroom-017a3dc1e-102.westus2.1.azurestaticapps.net
stitch-llm open pr102-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io
Database (1)
db_name postgres_host postgres_port postgres_db
pr_102 stitch-dev.postgres.database.azure.com 5432 pr_102
Jobs (2)
job image postgres_db api_url auth_mode
db-init ghcr.io/rmi/stitch-api:pr102@sha256:8b8ff5860b7ccf9729967a90b46a7694185470cfa1b986821ccc7dd68748fb56 pr_102
seed ghcr.io/rmi/stitch-seed:pr102@sha256:fa5446602e4711e1fbde87e6fb168ae152f6ab091dd5d83b8bb9f94251f5e110 https://pr102-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io/api/v1 dev placeholder bearer token
Images (4)
build_time commit_time git_sha image image_digest
2026-05-22T17:59:35Z 2026-05-22T17:59:19Z 9caed3b ghcr.io/rmi/stitch-api:pr102 ghcr.io/rmi/stitch-api:pr102@sha256:8b8ff5860b7ccf9729967a90b46a7694185470cfa1b986821ccc7dd68748fb56
2026-05-22T17:59:30Z 2026-05-22T17:59:19Z 9caed3b ghcr.io/rmi/stitch-entity-linkage:pr102 ghcr.io/rmi/stitch-entity-linkage:pr102@sha256:aac60f5a24c0921181786cc2d3cf41f6d35b6e61747ab3e7d572ca8e1a6f08e2
2026-05-22T17:59:30Z 2026-05-22T17:59:19Z 9caed3b ghcr.io/rmi/stitch-seed:pr102 ghcr.io/rmi/stitch-seed:pr102@sha256:fa5446602e4711e1fbde87e6fb168ae152f6ab091dd5d83b8bb9f94251f5e110
2026-05-22T17:59:30Z 2026-05-22T17:59:19Z 9caed3b ghcr.io/rmi/stitch-stitch-llm:pr102 ghcr.io/rmi/stitch-stitch-llm:pr102@sha256:0fc4cbac791573f129fd95b36fc9cf95d6ca216920040eac384ab53fc7194bf1

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