Skip to content

explorer: expand Playwright URL round-trip coverage beyond camera+mode #209

@rdhyee

Description

@rdhyee

Codex retrospective on #203 + #205 noted the URL round-trip harness (tests/playwright/url_roundtrip_investigation.js) only covers camera + mode. The URL state contract is larger.

Untested cases

From Codex's review:

  • pid deep-link + active filters: boot/hashchange PID hydration does not appear to apply sourceFilterSQL() or facet filters, so ?sources=...#...&pid=... can hydrate a sample that the active filters exclude. Need a round-trip test.
  • h3 deep-link round-trip: open #h3=... in a fresh tab; cluster card hydrates; URL persists across pan/zoom.
  • search + search_scope: ?search=pottery&search_scope=area should restore the search input, scope toggle, and re-run.
  • sources, material, context, object_type facet filters: each should round-trip via ?sources=, etc.
  • view=table: table mode should restore.
  • Search-result flight: clicking a search result flies the camera; URL captures the new camera and either reflects or clears prior selection. Confirm round-trip.
  • Sub-threshold pan settles via moveEnd (regression for explorer: add camera.moveEnd URL-write backstop (closes #204) #205): a small pan with no zoom should update the URL within ~1s of mouseup.
  • Cold-cache point-mode deep-link: with ?cache=disabled or a wiped browser cache, the deep-link should still round-trip — measure time-to-stable, assert eventual consistency.

Harness vs spec

The existing url_roundtrip_investigation.js is a Node script useful for manual investigation but doesn't run in CI. Plan:

  1. Keep the investigation harness as a manual diagnostic (it does cold-cache live-site work that's too slow / network-sensitive for CI).
  2. Extract CI-safe Playwright specs into tests/playwright/url_roundtrip.spec.js covering the items above, hitting localhost:5860 like the other specs.
  3. Each spec asserts: open URL in fresh context, wait for settle, snapshot relevant state, compare against an expectation built from the source URL.

Acceptance

  • New tests/playwright/url_roundtrip.spec.js (or split into focused spec files) running in CI.
  • All items above pass against localhost:5860 (Quarto preview of current main).
  • Either the existing investigation harness is updated to share helpers with the specs, or it's left as-is with a comment pointing to the specs.

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions