refactor(ui): require planned diff rows - #1019
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR makes canonical planned rows mandatory at the
Confidence Score: 4/5The runtime refactor appears sound, but the explicit test-import requirement must be satisfied before merging. Production callers use the correct planned or raw-row boundary, and the adapter preserves the former conversion behavior; the remaining finding is a repository-rule violation in the changed test import. Files Needing Attention: packages/hunk/src/ui/components/ui-components.test.tsx Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Shared review render plan] -->|plannedRow| B[DiffRowView]
C[Renderer-only raw row] --> D[RawDiffRowView]
D -->|legacyPlannedDiffRow| B
B --> E[DiffMetaRowView]
B --> F[CodeRowView]
Prompt To Fix All With AI### Issue 1
packages/hunk/src/ui/components/ui-components.test.tsx:44
**Dynamic Test Import**
The new `RawDiffRowView` dependency is loaded with `await import(...)`. This violates the repository testing directive to hoist imports to the top level and avoid dynamic imports in tests. This requirement must be satisfied before merging.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "refactor(ui): require planned diff rows" | Re-trigger Greptile |
| const { measurePlannedRenderedRowHeight, measureRenderedRowHeight } = | ||
| await import("../diff/codeRowLayout"); | ||
| const { DiffRowView } = await import("../diff/DiffRowView"); | ||
| const { RawDiffRowView } = await import("../diff/RawDiffRowView"); |
There was a problem hiding this comment.
The new RawDiffRowView dependency is loaded with await import(...). This violates the repository testing directive to hoist imports to the top level and avoid dynamic imports in tests. This requirement must be satisfied before merging.
Context Used: testing.mdc Cursor rule (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/hunk/src/ui/components/ui-components.test.tsx
Line: 44
Comment:
**Dynamic Test Import**
The new `RawDiffRowView` dependency is loaded with `await import(...)`. This violates the repository testing directive to hoist imports to the top level and avoid dynamic imports in tests. This requirement must be satisfied before merging.
**Context Used:** testing.mdc Cursor rule ([source](https://github.com/modem-dev/modem/blob/main/.cursor/rules/testing.mdc))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.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.
Keeping this as a dynamic import is intentional and consistent with the surrounding UI-component imports in this test module. These components are loaded after the test harness dependencies are initialized; hoisting only the new adapter would make its initialization order differ from DiffRowView and the other UI components it exercises.
Responded by Pi using gpt-5.6-sol.
This comment was generated by Pi using gpt-5.6-sol
There was a problem hiding this comment.
That’s fair. The test module intentionally initializes the harness before dynamically importing the UI components, and RawDiffRowView follows the same pattern as DiffRowView and the surrounding components. Hoisting only this import would be inconsistent and could alter initialization order, so this is not an issue. I’m retracting the comment.
226b388 to
155e912
Compare
Summary
DiffRowViewboundaryRawDiffRowViewadapterWhy
The former facade accepted both or neither of
plannedRowandrow, while adapter-only props were silently ignored for planned input. Separating the contracts makes the primary review path explicit and keeps the one renderer-only raw projection supported.Stack
Merge bottom to top. This PR is based on
refactor/diff-row-inline-dispatch.Validation
bun run typecheckbun run testbun run test:integrationbun run test:tty-smokeAll passed. No user-visible rendering behavior changes, so no new visual evidence was captured.
This PR description was generated by Pi using gpt-5.6-sol