fix(ui): navigate comments by stream position#315
Conversation
Greptile SummaryAdds a PTY regression fixture and integration test to verify that navigating between agent-context notes using
Confidence Score: 4/5Safe to merge — only test infrastructure is touched and the fixture logic is straightforward. Both changed files are test-only. The fixture correctly mirrors existing harness patterns and the CLI flag it uses ( No production files are changed; Important Files Changed
Sequence DiagramsequenceDiagram
participant Test as PTY Test
participant Session as Hunk PTY Session
participant UI as Hunk UI (split mode)
Test->>Session: launchHunk(--agent-notes, --agent-context)
Session->>UI: start with notes visible
UI-->>Test: waitForText(menu bar) → initial snapshot
Test->>Session: "press("}")"
Session->>UI: navigate to next agent note
UI-->>Test: waitForSnapshot("Alpha note for navigation.")
Note over Test: assert no crash string
Test->>Session: "press("}")"
Session->>UI: skip beta.ts (no annotation), navigate to gamma
UI-->>Test: waitForSnapshot("Gamma note for navigation.")
Note over Test: assert text present + no crash string
Test->>Session: close()
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
test/pty/ui-integration.test.ts:116
The `alphaNote` snapshot is validated only by the crash-guard assertion, while `gammaNote` gets both a positive content assertion and the crash guard. Since `waitForSnapshot` guarantees the predicate holds before returning, the positive assertion would be redundant *functionally*, but the inconsistency makes the intent less obvious to future readers and could hide a scenario where the predicate logic is accidentally loosened.
```suggestion
expect(alphaNote).toContain("Alpha note for navigation.");
expect(alphaNote).not.toContain("Maximum update depth exceeded");
```
Reviews (1): Last reviewed commit: "test(pty): cover agent comment navigatio..." | Re-trigger Greptile |
| (text) => text.includes("Alpha note for navigation."), | ||
| 5_000, | ||
| ); | ||
| expect(alphaNote).not.toContain("Maximum update depth exceeded"); |
There was a problem hiding this comment.
The
alphaNote snapshot is validated only by the crash-guard assertion, while gammaNote gets both a positive content assertion and the crash guard. Since waitForSnapshot guarantees the predicate holds before returning, the positive assertion would be redundant functionally, but the inconsistency makes the intent less obvious to future readers and could hide a scenario where the predicate logic is accidentally loosened.
| expect(alphaNote).not.toContain("Maximum update depth exceeded"); | |
| expect(alphaNote).toContain("Alpha note for navigation."); | |
| expect(alphaNote).not.toContain("Maximum update depth exceeded"); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: test/pty/ui-integration.test.ts
Line: 116
Comment:
The `alphaNote` snapshot is validated only by the crash-guard assertion, while `gammaNote` gets both a positive content assertion and the crash guard. Since `waitForSnapshot` guarantees the predicate holds before returning, the positive assertion would be redundant *functionally*, but the inconsistency makes the intent less obvious to future readers and could hide a scenario where the predicate logic is accidentally loosened.
```suggestion
expect(alphaNote).toContain("Alpha note for navigation.");
expect(alphaNote).not.toContain("Maximum update depth exceeded");
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Good call — added the explicit positive assertion for the alpha snapshot so it matches the gamma assertion pattern.
Responded by Pi using OpenAI GPT-5.
789cd0b to
298254f
Compare
Summary
}navigation from an unannotated hunkTesting
This PR description was generated by Pi using OpenAI GPT-5