feat: add reusable ConfirmationDialog component to replace window.confirm()#619
Open
rishab11250 wants to merge 1 commit into
Open
feat: add reusable ConfirmationDialog component to replace window.confirm()#619rishab11250 wants to merge 1 commit into
rishab11250 wants to merge 1 commit into
Conversation
…firm() Closes param20h#610 - Create ConfirmationDialog component with configurable title, message, confirm/cancel labels, variant (default/danger/warning), and loading state - Replace window.confirm() in DocumentSidebar.tsx with styled dialog for document deletion confirmation - Replace window.confirm() in ApiKeyManager.tsx with styled dialog for API key revocation confirmation - Built on existing @base-ui/react/dialog primitives
7a7e793 to
41b3e6e
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🔗 Related Issue
Closes #610
📝 What does this PR do?
Creates a reusable
ConfirmationDialogcomponent and replaces allwindow.confirm()calls in the codebase.New component (
frontend/src/components/ui/confirm-dialog.tsx):variantprop:'danger'(red destructive),'warning'(amber),'default'(primary)@base-ui/react/dialogprimitives — no new dependenciesReplacements:
DocumentSidebar.tsx: Document deletion now opens a styleddangerconfirmation dialogApiKeyManager.tsx: API key revocation now opens a styleddangerconfirmation dialog🗂️ Type of Change
🧪 How was this tested?
uvicorn app.main:app --reload)npm run devinsidefrontend/)📸 Screenshots (if UI change)
N/A — component renders identically to existing dialog patterns; screenshots can be provided on a running instance.
@base-ui/react/dialogalready in the projectasChildwhenmessageis a ReactNode for custom content support✅ Self-Review Checklist
dev, notmainmainbranch or any HuggingFace deployment config