Skip to content

test(aggregator): /aa chart zoom/pan behavior from #4154 has only string-presence tests — no executable coverage #9581

Closed

Description

@dezren39

Finding

PR #4154 added a non-trivial client-side behavior layer to the aggregator /aa page — viewBox zoom math with focal-point anchoring, pan clamping, per-chart zoom state that must survive (or deliberately drop across) redraws, deferred pointer capture so plain clicks still select points, and a 400 ms click-suppression window after a pan — but its tests never execute any of that behavior. The two tests the PR added (still the only coverage on current main) assert that the rendered HTML contains strings (function enhanceCharts(), data-zbound, setPointerCapture(drag.id), …) and that the emitted script parses. A regression that breaks the zoom math, the clamping, or the click suppression — while keeping those strings present — passes the suite unchanged.

Evidence

Why it matters

The /aa explorer is the AA comparison surface Drew reads; zoom/pan is now the primary way to inspect dense frontier charts. The zoom/pan state machine is exactly the kind of code that regresses silently (a redraw resetting applied, an aspect change on the scores chart, a clamp inversion when a view is taller than wide) — and the current tests would stay green through every one of those regressions, giving false confidence in the page's most interactive code.

Acceptance criteria

  • Executable tests drive the enhancer's pure behavior: at minimum zoomChart focal anchoring and the 16× floor, zoom-out-to-base clearing cur, panChart clamping at the base viewBox edges, and resetChart restoring the base viewBox — asserting the resulting viewBox values, not string presence.
  • The click-suppression contract is pinned by a test: a click within the suppression window after a moved drag is swallowed; an ordinary click without a drag still reaches point selection.
  • Tests run under the aggregator's existing bun test suite (a minimal DOM stub or extracting the pure viewBox helpers for direct import are both acceptable); the existing string-presence tests may stay but no longer count as the behavior coverage.

Filed by pr-diff-review-b (Lane B PR diff review, run 2026-11-13 09:18 CST) from review of PR #4154.

Activity

  1. added
    kind/testTest coverage, test infrastructure, or test-only fixes
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 13, 2026
  2. developing-today commented on Nov 13, 2026

    @developing-today
    Contributor
  3. added
    priority/lowNice to have; do when convenient
    effort/sSmall: expected under 2 hours of work
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    on Nov 13, 2026
  4. dezren39 commented on Nov 13, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    Agent: pr-diff-review-b
    State: filed
    Repo: developing-today/code
    Source PR: #4154 (#4154, merged fddd4ad)
    Finding: the /aa chart zoom/pan layer #4154 added (render.ts clampChartView :4479, zoomChart :4484, panChart :4499, click suppression :4587-4592 on main) has no executable tests — aa.test.ts:867's two tests only assert string presence in rendered HTML plus a script-parse check, so behavior regressions that keep the strings pass green.
    Verified against main: ef16105 (contents reads of render.ts and aa.test.ts; PR merge confirmed ancestor, compare behind=0)
    Evidence: hidden_files/pr-review-b-2026-11-13-0918/issue-chart-zoom-tests-body.md + diff-4154.patch

  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    and removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 13, 2026
  6. dezren39 commented on Nov 13, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    Agent: repo-worker-code-a (lane code-a, task 16124)
    State: picked up / triaged
    Repo: developing-today/code
    Issue: #9581
    Task: task 16124 (triage packet)

    Pickup: claimed task 16124, lane assignment direct (#8187) - this lane works it itself.
    Revalidated fresh: issue #9581 OPEN, no hard-stop labels (held / user/owned / do-not-merge / do-not-auto-edit absent); PR #4154 MERGED fddd4ad; no open competing PR found.

    Triage (inline, #8187):

    • Work kind: small-fix (task/small-fix) - add executable behavior tests; no behavior change intended.
    • Priority: priority/low - stands. No known behavior bug today; risk is silent regression in the /aa page most interactive code.
    • Effort: effort/s - stands. Pure viewBox helpers are small; tests are table-driven.
    • Kind: kind/test - already present, stands.
    • First concrete step: inspect render.ts zoom/pan section and aa.test.ts on current main; extract the pure viewBox helpers for direct import (or stub the DOM minimally) and add executable tests.
    • Acceptance check: executable tests assert resulting viewBox values for zoom focal anchoring, the 16x floor, zoom-out-to-base clearing state, pan clamping, and reset; click-suppression contract pinned (post-drag click swallowed, ordinary click selects); aggregator bun test suite passes.
      Fix proceeding in this same claim.
  7. added a commit that references this issue on Nov 13, 2026
  8. dezren39 commented on Nov 13, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    Agent: repo-worker-code-a (lane code-a, task 16124)
    State: done
    Repo: developing-today/code
    Issue: #9581
    Task: task 16124 (triage packet, triaged inline and fixed in the same claim)

    Outcome: fixed_merged. PR #9582 MERGED 100beb3; issue #9581 CLOSED by the PR.

    What landed: the /aa chart zoom/pan viewBox math moved from the explorer inline script into the shared tested module src/assets/aa-explorer-computations.js (parseChartViewBox, effectiveChartView, clampChartView, zoomChartView, panChartView, resetChartView, chartClickSuppressed, with .d.ts declarations), following the #7562 pattern; render.ts enhancer handlers delegate to it with no inline copies and no behavior change. Executable tests in test/aa-explorer-computations.test.ts assert resulting viewBox values for focal anchoring, the 16x floor, zoom-out-to-base clearing state, pan clamping (incl. non-zero base origin and no-op cases), and reset, and pin the click-suppression contract (post-drag click within 400 ms swallowed; ordinary click with no stamp never swallowed). test/aa.test.ts pins that the shipped page imports these functions and carries no inline definitions.

    Tests: bun test aa-explorer-computations 15/15 (also re-run 15/15 on merged main 100beb3); aa.test.ts 47/47 (with PM_AGG_FRESHNESS_PORT=4899 — default 4871 is held by the laptop production aggregator, pre-existing); render+a11y-1215+epic-graph 82/82; bunx tsc --noEmit error set identical to main (22 pre-existing, none in touched files).
    Codex: review failed to run on PR #9582 (usage limits, fleet-wide since 2026-11-13T13:51Z) — no findings exist; disposition recorded on PR #9582 (comment 6857961702).

  9. dezren39 commented on Nov 13, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    Agent: repo-worker-code-a (lane code-a, task 16125)
    State: done (already_done)
    Repo: developing-today/code
    Issue: #9581
    Task: task 16125 (small_fix follow-on packet for the triage of task 16124)

    This packet is the fix follow-on for the #9581 triage, but the fix already landed in the same claim as the triage (task 16124, this lane): PR #9582 MERGED 100beb3, issue #9581 CLOSED. Verified fresh at this claim: issue CLOSED, PR MERGED with that merge sha, and the extracted helpers (zoomChartView, panChartView, chartClickSuppressed) are present in src/assets/aa-explorer-computations.js on origin/main; the computations suite passed 15/15 on the merged main under task 16124. No duplicate work created.

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

    app/aggregatorPackage/app: aggregator (pm-stack in this repo)effort/sSmall: expected under 2 hours of workkind/testTest coverage, test infrastructure, or test-only fixespriority/lowNice to have; do when convenientsource/pr-diff-reviewFiled by the pr-diff-review jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions