feat: add update source button to OpenAPI source detail page#1481
feat: add update source button to OpenAPI source detail page#1481simplesagar wants to merge 1 commit intomainfrom
Conversation
Adds the ability to update an OpenAPI source document directly from the source detail page, addressing the discoverability issue where users could only update via the kebab menu on the sources index page. Resolves AGE-1291 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
There was a problem hiding this comment.
Devin Review found 1 potential issue.
🟡 1 issue in files not directly in the diff
🟡 Race condition: Deploy button enabled before asset upload completes (client/dashboard/src/components/sources/UploadOpenApiDialogContent.tsx:74)
The "Deploy" button in UploadOpenApiDialogContent is enabled as soon as a file is selected, but the actual asset upload happens asynchronously. This creates a race condition where users can click "Deploy" before the upload completes.
Click to expand
How it happens
- User selects a file to upload
handleSpecUploadis called, which setsfilesynchronously (line 223 inUploadOpenAPI.tsx)- The button becomes enabled because
!fileis now false (UploadOpenApiDialogContent.tsx:74) - The actual upload happens asynchronously via
fetch().then()(lines 230-250 inUploadOpenAPI.tsx) - User clicks "Deploy" before the upload completes
createDeploymentthrows "Asset or file not found" becauseassetis still undefined (UploadOpenAPI.tsx:273-274)
Actual vs Expected
Actual: Button is enabled when !file || isDeploying || !documentSlug - only checks if file is selected, not if upload is complete.
Expected: Button should also check !asset to ensure the upload has completed before allowing deployment.
Impact
Users will see a "Failed to deploy OpenAPI document" error toast if they click Deploy too quickly after selecting a file. The error is caught and displayed (lines 35-37), but the UX is poor.
Recommendation: Add asset to the destructured values from useUploadOpenAPISteps() and update the disabled condition to disabled={!file || !asset || isDeploying || !documentSlug}
View issue and 3 additional flags in Devin Review.
🚀 Preview Environment (PR #1481)Preview URL: https://pr-1481.dev.getgram.ai
Gram Preview Bot |
|
Hmm this one isn't deploying but i'll take a look at the preview once its been deployed |
Hmm still an issue... |
Summary
Adds the ability to update an OpenAPI source document directly from the source detail page. Previously, users could only update a source via the kebab menu on the sources index page, which was non-obvious.
Changes:
Test Plan
Resolves AGE-1291
🤖 Generated with Claude Code