mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
* feat(frontend): mobile-friendly config editor with find bar and unsaved-changes guard * refactor: remove retry-clone flow and share destructive-confirm dialog Backend drops POST /:id/retry-clone and the supporting retryCloneRepo service and claimRepoForRetry query; failed clones now delete the repo row rather than lingering in error state. Frontend extracts ConfirmDestructiveDialog shared by Delete/Discard/UnsavedChanges dialogs, memoizes CodeEditor rows, fixes scroll jump while typing away from the active match, and aligns the responsive breakpoint to 768px.
32 lines
812 B
TypeScript
32 lines
812 B
TypeScript
import { ConfirmDestructiveDialog } from '@/components/ui/confirm-destructive-dialog'
|
|
|
|
interface UnsavedChangesDialogProps {
|
|
open: boolean
|
|
onOpenChange: (open: boolean) => void
|
|
onDiscard: () => void
|
|
onKeepEditing: () => void
|
|
itemName?: string
|
|
}
|
|
|
|
export function UnsavedChangesDialog({
|
|
open,
|
|
onOpenChange,
|
|
onDiscard,
|
|
onKeepEditing,
|
|
itemName,
|
|
}: UnsavedChangesDialogProps) {
|
|
return (
|
|
<ConfirmDestructiveDialog
|
|
open={open}
|
|
onOpenChange={onOpenChange}
|
|
onConfirm={onDiscard}
|
|
onCancel={onKeepEditing}
|
|
title="Unsaved Changes"
|
|
description={itemName ? `You have unsaved edits to ${itemName}.` : 'You have unsaved edits.'}
|
|
warning="Discarding will permanently lose these edits."
|
|
confirmLabel="Discard"
|
|
cancelLabel="Keep Editing"
|
|
/>
|
|
)
|
|
}
|