Skip to content

test(ui): fix broken plannedReviewRows test on main#334

Closed
benvinegar wants to merge 1 commit into
mainfrom
fix-planned-review-rows-test
Closed

test(ui): fix broken plannedReviewRows test on main#334
benvinegar wants to merge 1 commit into
mainfrom
fix-planned-review-rows-test

Conversation

@benvinegar
Copy link
Copy Markdown
Member

Summary

main currently fails tsc (and therefore the Typecheck + Test + Smoke CI job) independently of any open PR.

PR #317 (feat: unify inline notes and expand behavior coverage) unified inline notes into the diff-row stream:

  • inline-note rows now require a note: VisibleAgentNote field
  • the standalone note-guide-cap row kind was removed (a guide cap is now a diff-row carrying noteGuideSide)

But its colocated src/ui/diff/plannedReviewRows.test.ts still constructed the old shapes, so tsc fails on main:

plannedReviewRows.test.ts(81,3): error TS2322: Property 'note' is missing ... PlannedReviewRow
plannedReviewRows.test.ts(102,5): error TS2322: Type '"note-guide-cap"' is not assignable to type '"diff-row" | "inline-note"'

Changes

Test-only. Update the two stale helpers to the current PlannedReviewRow model:

  • inlineNote() now includes the required note field
  • guideCap() now returns a diff-row with noteGuideSide: "new" (the unified representation)

No assertions changed — a guide cap is still a 1-height row that contributes to hunk bounds, so all three geometry tests pass with their original expected values.

Testing

  • bun run typecheck — clean
  • bun run lint — clean
  • bun test src/ui/diff/plannedReviewRows.test.ts — 3 pass

No CHANGELOG entry: test-only, no user-visible behavior change.

🤖 Generated with Claude Code

#317 unified inline notes into the diff-row stream and made note the
required field on inline-note rows while removing the standalone
note-guide-cap row kind, but its colocated test still built the old
shapes, breaking tsc on main. Update the test helpers to the current
PlannedReviewRow type without changing any assertions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 19, 2026

Greptile Summary

This PR fixes two stale test helper functions in plannedReviewRows.test.ts that were left behind after PR #317 unified inline notes into the diff-row stream, breaking tsc on main.

  • inlineNote() adds the now-required note: VisibleAgentNote field to satisfy the updated PlannedReviewRow union type.
  • guideCap() is rewritten from the removed "note-guide-cap" kind to a "diff-row" carrying noteGuideSide: "new", matching the current type definition. No test assertions were changed.

Confidence Score: 5/5

Safe to merge — test-only change that restores a green tsc on main with no production code touched.

Both helpers are updated to match the current type definitions exactly, all three geometry assertions remain unchanged and still exercise the same behaviors, and plannedReviewRowHeight for diff-row correctly returns 1 for the new guideCap shape.

No files require special attention.

Important Files Changed

Filename Overview
src/ui/diff/plannedReviewRows.test.ts Test-only update: inlineNote() adds the required note field and guideCap() is migrated from the removed "note-guide-cap" kind to a "diff-row" with noteGuideSide; all three geometry assertions remain unchanged.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["PlannedReviewRow union"] --> B["kind: diff-row"]
    A --> C["kind: inline-note"]
    B --> D["row: DiffRow\nanchorId?: string\nnoteGuideSide?: 'old' | 'new'"]
    C --> E["annotation: AgentAnnotation\nnote: VisibleAgentNote\nanchorSide?: 'old' | 'new'"]

    style A fill:#4a90d9,color:#fff
    style B fill:#5cb85c,color:#fff
    style C fill:#5cb85c,color:#fff

    subgraph "Before PR #317"
        X["kind: note-guide-cap\nside: 'new'"]
    end

    subgraph "After PR #317 (this fix)"
        Y["kind: diff-row\nnoteGuideSide: 'new'\nrow: split-line"]
    end

    X -. "removed" .-> Y
Loading

Reviews (1): Last reviewed commit: "test(ui): align plannedReviewRows test w..." | Re-trigger Greptile

@benvinegar
Copy link
Copy Markdown
Member Author

Superseded — #332 already fixed plannedReviewRows.test.ts on main as part of its changes, so this is no longer needed. Verified bun run typecheck is clean on current main.

@benvinegar benvinegar closed this May 19, 2026
@benvinegar benvinegar deleted the fix-planned-review-rows-test branch May 19, 2026 14:56
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.

1 participant