Skip to content

dashboard: scrollController test warns on unexpected scroll-to-top fails deterministically on clean tree (blocks CI dashboard-suite addition) #974

Closed

Description

@amrmelsayed

Symptom

The dashboard vitest suite has one deterministic failure on a clean main checkout, independent of any in-flight PR:

FAIL  packages/dashboard/__tests__/scrollController.test.ts
  ScrollController > onScroll handler
    × warns on unexpected scroll-to-top but does not auto-correct (Issue #630)
      AssertionError: expected "warn" to be called at least once
      Number of calls: 0

The rest of the dashboard suite passes (316 / 318 with 1 skipped — this is the sole failure). Verified on two separate builder worktrees (pir-961, pir-875) running against clean main HEADs minutes apart — failure is reproducible, not flaky.

Distinct from #630

#630 is closed and was about the runtime bug — xterm parsing errors + WebGL context loss causing terminals to scroll to the top unexpectedly. That runtime bug's mitigation ships in ScrollController.handleScroll + the term.write callback and the user-facing terminal behavior works (no terminals scrolling to top on contact).

This issue is about the test added alongside that mitigation — the assertion expects warnSpy to have been called at least once is no longer satisfied. So either:

  1. The mitigation's warn path has been removed or refactored without updating the test
  2. The test fixture no longer reproduces the scroll-to-top trigger that's supposed to fire the warning
  3. The warnSpy is hooked to the wrong target after some refactor

The user-facing behavior #630 was filed to fix appears unaffected; this is a test-suite hygiene problem, not a regression of the original bug.

Why it matters now

#967 tracks adding the vscode + dashboard vitest suites to CI (today neither runs). Promoting the dashboard suite to a required check requires this test to be green on clean main, OR the test to be deleted / quarantined / its assertion corrected. #967 explicitly cites this failure as the blocker for the dashboard side.

Suggested investigation order

  1. Read the failing test: packages/dashboard/__tests__/scrollController.test.ts — the onScroll handler > warns on unexpected scroll-to-top describe block. Check what trigger the test stages and what warnSpy is hooked to.
  2. Read ScrollController in the dashboard source — verify whether the warn it expects to be called still exists, and whether the trigger conditions still apply.
  3. Run git log -p on both files since the last green run to see what changed.
  4. Decide on shape: if the warn path is gone by design, the test should be updated or deleted; if the warn path regressed silently, fix the code; if the test fixture is stale, fix the fixture.

Acceptance

  • The test warns on unexpected scroll-to-top but does not auto-correct (Issue #630) either passes on a clean main checkout, or is replaced / deleted with a clear-headed reason recorded
  • Whatever the resolution shape, the user-facing scroll-to-top mitigation #630 shipped is preserved (no regression to the runtime behavior)
  • pnpm --filter @cluesmith/codev-dashboard test exits 0 on clean main (full suite green, no skipped tests added beyond the existing 1)
  • No new flakiness introduced (test failure was deterministic; fix should preserve determinism in either direction)

Out of scope

  • Adding the dashboard suite to CI — that's #967's job. This issue is the prerequisite that unblocks it.
  • Any change to the runtime ScrollController.handleScroll or term.write callback unless the test failure root-causes there (in which case it's not really out of scope)

Why BUGFIX

Isolated test or small mitigation-code adjustment — likely <50 LOC net diff. No design surface (the answer is "make the assertion match reality" or "make the code match the assertion"; one of them is wrong, the investigation reveals which). No new module or pattern.

Related

  • #630 — original runtime bug (closed); this test was added to pin its mitigation
  • #967 — CI-gap follow-up that's blocked on this test being green

Activity

  1. added
    area/dashboardArea: Tower web dashboard package (@cluesmith/codev-dashboard, React app served by Tower)
    on Jun 3, 2026
  2. self-assigned this
    on Jun 3, 2026
  3. amrmelsayed commented on Jun 3, 2026

    @amrmelsayed
    CollaboratorAuthor

    On it! Working on a fix now.

  4. added 2 commits that reference this issue on Jun 3, 2026
  5. added a commit that references this issue on Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/dashboardArea: Tower web dashboard package (@cluesmith/codev-dashboard, React app served by Tower)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions