Skip to content

Dedup loadScopedActivityEvents; cover shared feedback card parts - #837

Merged
selfcontained merged 1 commit into
mainfrom
agt_6dcb50d2e60e/job-test-enforcer-36e4a15b
Jul 27, 2026
Merged

Dedup loadScopedActivityEvents; cover shared feedback card parts#837
selfcontained merged 1 commit into
mainfrom
agt_6dcb50d2e60e/job-test-enforcer-36e4a15b

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Recurring test-enforcer run (2026-07-26). Local suite was green on first pass (8th consecutive run: check ok; server 2327 pass / 8 skip, web 415, ext 60, scripts 4; E2E 170 pass / 12 skip), flakes list empty, CI scan clean — so this run closed the queued next_focus refactor and added coverage for the newest untested extraction.

Refactor

  • loadScopedActivityEvents (apps/server/src/server/activity-query.ts) gains an optional includeProjectDir mode (LEFT JOIN agents, COALESCE(ae.project_dir, a.cwd) AS project_dir, ae.-aliased columns).
  • handleWorkingTimeByProject (apps/server/src/routes/activity/metrics-routes.ts) now uses it instead of its hand-inlined copy of the in-range + DISTINCT ON boundary carry-in queries, so the two implementations can no longer drift.
  • No-opts callers generate byte-identical SQL to before. Existing real-DB boundary tests for /activity/stats, /activity/daily-status (Add boundary carry-in tests for /activity/stats and /activity/daily-status #797), and /activity/working-time-by-project (Add boundary-merge tests for working-time-by-project #787) cover all three consumers and pass unchanged (96 activity tests green).

Coverage

  • New feedback-card-parts.test.tsx (16 tests) for the FeedbackReplyForm + FeedbackResolutionFooter shared components extracted in Extract shared FeedbackReplyForm + FeedbackResolutionFooter #836 — their interactive behavior was previously untested at both call sites (diff-annotations inline variant, reviews-sidebar variant):
    • reply trigger toggle, typed-input forwarding, whitespace-only Send gating
    • Cmd/Ctrl+Enter submit, plain-Enter no-op, Escape + Cancel-button cancel
    • pending state disables textarea/Cancel/Send with spinner
    • inline vs sidebar action-row layout (the entire observable variant contract)
    • Dismiss/Mark fixed/Reopen resolution routing incl. per-action spinner placement
    • resolution banner fixed/dismissed/none states with note rendering
  • Verified non-vacuous with a 10-mutation battery — 10/10 mutants caught (incl. a first-draft gap: the Mark-fixed spinner gate loosened to bare isPending survived until the complementary pending-dismissal case was added).
  • Explicit cleanup() in afterEach per the repo's no-auto-cleanup vitest convention.

Validation

pnpm run check, full unit suite (server 2327/8 skip, web 431, ext 60), pnpm run finalize:web, lint:web, prettier --check, and pnpm run test:e2e (170 pass / 12 skip) all green after the changes. One general review agent inspected the diff: no must-fix/should-fix findings; one nit applied (split a two-scenario spinner test into two it blocks).

🤖 Generated with Claude Code

- Extend loadScopedActivityEvents with an optional includeProjectDir mode
(LEFT JOIN agents, COALESCE(ae.project_dir, a.cwd)) and switch
handleWorkingTimeByProject to it, removing the hand-inlined copy of the
in-range + DISTINCT ON boundary carry-in queries so the two can't drift.
Existing real-DB boundary tests for /activity/stats, /activity/daily-status,
and /activity/working-time-by-project cover all three consumers.
- Add feedback-card-parts.test.tsx (16 tests) for the FeedbackReplyForm and
FeedbackResolutionFooter shared components extracted in #836: reply trigger
toggle, Cmd/Ctrl+Enter submit, Escape/Cancel, whitespace Send gating,
pending disable + spinner placement, inline vs sidebar action-row layout,
Dismiss/Mark fixed/Reopen resolution routing, and resolution banner states.
Verified non-vacuous with a 10-mutation battery (10/10 caught).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@selfcontained
selfcontained merged commit e975c7c into mainJul 27, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_6dcb50d2e60e/job-test-enforcer-36e4a15b branch July 27, 2026 02:22
Sign up for freeto 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.

1 participant

@selfcontained