Editing task description to remove it doesn't work (vibe-kanban) (#862)

* Perfect! The fix is implemented and compiles successfully.

**What I fixed:**
- Replaced the simple `.or()` fallback with proper empty string handling
- Empty strings (including whitespace-only) now clear the description field
- Non-empty strings update the description as before
- Omitted fields still preserve existing values

**How it works:**
- `{"description": "new text"}` → updates description to "new text"
- `{"description": ""}` → clears description (sets to NULL)
- `{"description": "   "}` → clears description (whitespace trimmed)
- `{}` (field omitted) → keeps existing description unchanged

The fix is simple, backwards-compatible, and handles the exact issue you described without requiring API changes or type modifications.

* Cleanup script changes for task attempt 42e1596a-5b1a-4061-b704-1a30d09f8192

* Perfect! The fix is complete and both frontend and backend checks pass.

**What I fixed:**
- **Frontend**: Changed `description || null` to `description` in all 3 places (edit, create, create-and-start)
- **Backend**: Already handles empty strings as clearing (from previous fix)

**How it works now:**
- When users clear a task description, frontend sends `""` (empty string)
- Backend detects `s.trim().is_empty()` and sets description to `None` (NULL in database)
- Description gets properly cleared after saving

The simple frontend change aligns both systems perfectly. Users can now clear task descriptions by editing them to be empty and saving.

* Cleanup script changes for task attempt 42e1596a-5b1a-4061-b704-1a30d09f8192
This commit is contained in:
Louis Knight-Webb
2025-09-26 11:56:46 +01:00
committed by GitHub
parent f11975ce33
commit f631c8d6cf
2 changed files with 8 additions and 4 deletions

View File

@@ -315,7 +315,7 @@ export const TaskFormDialog = NiceModal.create<TaskFormDialogProps>(
taskId: task.id,
data: {
title,
description: description || null,
description: description,
status,
parent_task_attempt: parentTaskAttemptId || null,
image_ids: imageIds || null,
@@ -332,7 +332,7 @@ export const TaskFormDialog = NiceModal.create<TaskFormDialogProps>(
{
project_id: projectId,
title,
description: description || null,
description: description,
parent_task_attempt: parentTaskAttemptId || null,
image_ids: imageIds || null,
},
@@ -386,7 +386,7 @@ export const TaskFormDialog = NiceModal.create<TaskFormDialogProps>(
task: {
project_id: projectId,
title,
description: description || null,
description: description,
parent_task_attempt: parentTaskAttemptId || null,
image_ids: imageIds || null,
},