Alex/refactor create pr (#746)

* Remvoe duplicate github url regex

* Better error prop

* Fix leaky auth

* Fix branch status not working or remote base branches

Make PR creation fire and forget

Fix url regex; fix error msg parsing

fmt, clippy

Revert "Make PR creation fire and forget"

This reverts commit 1a99ceb06b5534cc22fcb88c484b068292e90edb.

* Re-add open from backend

* Add creating indicator

* Remove duplication

* Add remote tests

* Fmt, clippy

* Fix https conversion edge case, fix PushRejected detection

* Add push rejected test

* Refactor githubservice

* add local fetch/push tests, ignore network test

* stop retry on reponotfound, add comment for url regex
This commit is contained in:
Alex Netsch
2025-09-18 16:05:34 +02:00
committed by GitHub
parent 9c0743e9e8
commit c60c1a8f77
9 changed files with 609 additions and 227 deletions

View File

@@ -21,6 +21,7 @@ import {
TaskWithAttemptStatus,
} from 'shared/types';
import { projectsApi } from '@/lib/api.ts';
import { Loader2 } from 'lucide-react';
import NiceModal, { useModal } from '@ebay/nice-modal-react';
const CreatePrDialog = NiceModal.create(() => {
const modal = useModal();
@@ -79,7 +80,6 @@ const CreatePrDialog = NiceModal.create(() => {
if (result.success) {
setError(null); // Clear any previous errors on success
window.open(result.data, '_blank');
// Reset form and close dialog
setPrTitle('');
setPrBody('');
@@ -181,7 +181,14 @@ const CreatePrDialog = NiceModal.create(() => {
disabled={creatingPR || !prTitle.trim()}
className="bg-blue-600 hover:bg-blue-700"
>
{creatingPR ? 'Creating...' : 'Create PR'}
{creatingPR ? (
<>
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
Creating...
</>
) : (
'Create PR'
)}
</Button>
</DialogFooter>
</DialogContent>