Files
kandev/apps
João Salavisa f149bd1292 fix(office): disable create button until project + title set (#1243)
* fix(office): disable create button until project + title set

Office "New Task" dialog let user submit without picking a project, which
hit the backend isOfficeRequest() heuristic and failed validation with
"workflow_id is required for non-ephemeral tasks". Disable the button
until both title and project are set and surface the missing requirement
in a tooltip instead of a backend error toast.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(office): guard handleCreate on projectId + cover with tests

PR review feedback (claude, cubic): the handleCreate path only checked
title and workspace, so a keyboard shortcut or future programmatic
caller could still produce a request with no project and reproduce the
backend 'workflow_id is required' error. Guard it there too, and add
unit tests that pin the disabled-state + reason behavior of the
extracted CreateTaskButton. aria-label on the trigger wrapper surfaces
the reason to assistive tech even when the tooltip is closed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* test(office): cover submitting state for CreateTaskButton

PR review feedback (claude): the disabled check had three branches
(missing title / missing project / submitting); only two were
tested. Add the submitting case so a regression that drops it from the
disabled expression is caught.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Kandev Agent <agent@kandev.dev>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-02 13:37:39 +01:00
..