-
Notifications
You must be signed in to change notification settings - Fork 286
refactor(ui): require planned diff rows #1019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
benvinegar
merged 1 commit into
refactor/diff-row-inline-dispatch
from
refactor/diff-row-planned-input
Sep 7, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /** Adapts renderer-only diff rows to the canonical planned-row view. */ | ||
| import { memo } from "react"; | ||
| import type { DiffRow } from "./diffRows"; | ||
| import { DiffRowView, type DiffRowViewProps } from "./DiffRowView"; | ||
| import { legacyPlannedDiffRow } from "./codeRowLayout"; | ||
|
|
||
| /** Inputs for a raw row rendered outside the shared review plan. */ | ||
| export interface RawDiffRowViewProps extends Omit<DiffRowViewProps, "plannedRow"> { | ||
| row: DiffRow; | ||
| anchorId?: string; | ||
| noteGuideSide?: "old" | "new"; | ||
| } | ||
|
|
||
| /** Wrap a raw diff row in the planned envelope required by the mounted row view. */ | ||
| export const RawDiffRowView = memo(function RawDiffRowViewComponent({ | ||
| row, | ||
| anchorId, | ||
| noteGuideSide, | ||
| ...viewProps | ||
| }: RawDiffRowViewProps) { | ||
| return ( | ||
| <DiffRowView {...viewProps} plannedRow={legacyPlannedDiffRow(row, anchorId, noteGuideSide)} /> | ||
| ); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
RawDiffRowViewdependency is loaded withawait 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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s fair. The test module intentionally initializes the harness before dynamically importing the UI components, and
RawDiffRowViewfollows the same pattern asDiffRowViewand 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.