- render comment rows and line selection state in the native diff view - wire long-press/tap gestures to start and complete review comments - tighten shared diff utilities and add coverage
Showing the changes to apps/mobile/src/features/debug/native-review-diff/nativeReviewDiffModule.ts (1 of 15 files). Show all
Unified · Split
| @@ -11,7 +11,7 @@ interface ExpoGlobalWithViewConfig { · 10 unmodified lines | ||
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | export interface NativeReviewDiffRow { |
| 14 | − readonly kind: "file" | "hunk" | "line" | "notice"; | |
| 14 | + readonly kind: "file" | "hunk" | "line" | "notice" | "comment"; | |
| 15 | 15 | readonly id: string; |
| 16 | 16 | readonly fileId?: string; |
| 17 | 17 | readonly filePath?: string; |
| @@ -31,6 +31,9 @@ export interface NativeReviewDiffRow { · 13 unmodified lines | ||
| 31 | 31 | readonly oldLineNumber?: number | null; |
| 32 | 32 | readonly newLineNumber?: number | null; |
| 33 | 33 | readonly wordDiffRanges?: ReadonlyArray<NativeReviewDiffWordDiffRange>; |
| 34 | + readonly commentText?: string; | |
| 35 | + readonly commentRangeLabel?: string; | |
| 36 | + readonly commentSectionTitle?: string; | |
| 34 | 37 | } |
| 35 | 38 | |
| 36 | 39 | export interface NativeReviewDiffWordDiffRange { |
| @@ -100,6 +103,8 @@ export interface NativeReviewDiffViewProps extends ViewProps { · 63 unmodified lines | ||
| 100 | 103 | readonly tokensResetKey?: string; |
| 101 | 104 | readonly collapsedFileIdsJson?: string; |
| 102 | 105 | readonly viewedFileIdsJson?: string; |
| 106 | + readonly selectedRowIdsJson?: string; | |
| 107 | + readonly collapsedCommentIdsJson?: string; | |
| 103 | 108 | readonly appearanceScheme: "light" | "dark"; |
| 104 | 109 | readonly themeJson: string; |
| 105 | 110 | readonly styleJson?: string; |
| @@ -108,6 +113,17 @@ export interface NativeReviewDiffViewProps extends ViewProps { · 2 unmodified lines | ||
| 108 | 113 | readonly onDebug?: (event: NativeSyntheticEvent<Record<string, unknown>>) => void; |
| 109 | 114 | readonly onToggleFile?: (event: NativeSyntheticEvent<{ readonly fileId?: string }>) => void; |
| 110 | 115 | readonly onToggleViewedFile?: (event: NativeSyntheticEvent<{ readonly fileId?: string }>) => void; |
| 116 | + readonly onPressLine?: ( | |
| 117 | + event: NativeSyntheticEvent<{ | |
| 118 | + readonly rowId?: string; | |
| 119 | + readonly fileId?: string; | |
| 120 | + readonly gesture?: "tap" | "longPress"; | |
| 121 | + readonly oldLineNumber?: number; | |
| 122 | + readonly newLineNumber?: number; | |
| 123 | + readonly change?: "context" | "add" | "delete"; | |
| 124 | + }>, | |
| 125 | + ) => void; | |
| 126 | + readonly onToggleComment?: (event: NativeSyntheticEvent<{ readonly commentId?: string }>) => void; | |
| 111 | 127 | } |
| 112 | 128 | |
| 113 | 129 | let cachedNativeReviewDiffView: ComponentType<NativeReviewDiffViewProps> | undefined; |