Make it possible to create draft PRs (vibe-kanban) (#1460)
* All checks pass. Let me summarize what was implemented: ## Summary I've successfully implemented the draft PR feature. Here's what was changed: ### Backend Changes 1. **`crates/server/src/routes/task_attempts.rs`** (lines 70-76, 724-731): - Added `draft: Option<bool>` field to `CreateGitHubPrRequest` struct - Pass the draft field to the `CreatePrRequest` when creating PRs 2. **`crates/services/src/services/github.rs`** (lines 146-153): - Added `draft: Option<bool>` field to `CreatePrRequest` struct 3. **`crates/services/src/services/github/cli.rs`** (lines 158-160): - Added logic to pass `--draft` flag to `gh pr create` when draft is true ### Frontend Changes 4. **`frontend/src/components/dialogs/tasks/CreatePRDialog.tsx`**: - Added `Checkbox` import - Added `isDraft` state (default: false) - Added checkbox UI with label from translations - Pass `draft: isDraft` in the API call - Reset `isDraft` on success and cancel ### Type Generation 5. **`shared/types.ts`** (auto-generated): - `CreateGitHubPrRequest` now includes `draft: boolean | null` ### Translations 6. Added `"draftLabel"` translation key to all locale files: - `frontend/src/i18n/locales/en/tasks.json`: "Create as draft" - `frontend/src/i18n/locales/es/tasks.json`: "Crear como borrador" - `frontend/src/i18n/locales/ja/tasks.json`: "下書きとして作成" - `frontend/src/i18n/locales/ko/tasks.json`: "초안으로 만들기" - `frontend/src/i18n/locales/zh-Hans/tasks.json`: "创建为草稿" * Done. I've updated the checkbox to use `h-5 w-5` (20px) and added `text-sm` to the label for consistent sizing.
This commit is contained in:
committed by
GitHub
parent
047695e554
commit
9c70858b21
@@ -112,6 +112,7 @@
|
||||
"baseBranchLabel": "Rama Base",
|
||||
"loadingBranches": "Cargando ramas...",
|
||||
"selectBaseBranch": "Seleccionar rama base",
|
||||
"draftLabel": "Crear como borrador",
|
||||
"creating": "Creando...",
|
||||
"createButton": "Crear PR",
|
||||
"errors": {
|
||||
|
||||
Reference in New Issue
Block a user