Skip to content

Commit 64b35e2

Browse files
committed
fix: Repair TypeScript errors in revert components
- Add missing RevertPreview interface definition - Fix implicit any types in map functions - Resolve TypeScript compilation errors for webview components This fixes the pre-push hook failures and allows successful deployment.
1 parent d65d58a commit 64b35e2

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

webview-ui/src/components/history/revert-components.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ export const RevertButton: React.FC<RevertButtonProps> = ({
7777
)
7878
}
7979

80+
export interface RevertPreview {
81+
messageId: string
82+
affectedFiles: Array<{
83+
filePath: string
84+
currentContent: string
85+
revertedContent: string
86+
hasConflicts: boolean
87+
conflictType?: string
88+
}>
89+
estimatedImpact: 'low' | 'medium' | 'high'
90+
}
91+
8092
export interface RevertPreviewModalProps {
8193
messageId: string
8294
onClose: () => void
@@ -193,7 +205,7 @@ export const RevertPreviewModal: React.FC<RevertPreviewModalProps> = ({ messageI
193205
</div>
194206

195207
<div className="files-list">
196-
{preview.affectedFiles.map((file, index) => (
208+
{preview.affectedFiles.map((file: any, index: number) => (
197209
<div key={index} className="file-preview-item">
198210
<div className="file-header">
199211
<span className="codicon codicon-file"></span>
@@ -225,10 +237,10 @@ export const RevertPreviewModal: React.FC<RevertPreviewModalProps> = ({ messageI
225237
<VSCodeButton
226238
appearance="primary"
227239
onClick={handleConfirm}
228-
disabled={preview.affectedFiles.some((f) => f.hasConflicts)}>
240+
disabled={preview.affectedFiles.some((f: any) => f.hasConflicts)}>
229241
Confirm Revert
230242
</VSCodeButton>
231-
{preview.affectedFiles.some((f) => f.hasConflicts) && (
243+
{preview.affectedFiles.some((f: any) => f.hasConflicts) && (
232244
<div className="conflict-warning">
233245
Cannot revert due to conflicts. Please resolve conflicts first.
234246
</div>

0 commit comments

Comments
 (0)