feat(kanban): modal create-task dialog, editable board project directory, comment workflow hint (#66333)

Community feedback (@LSanapalli on X): the inline task-creation form is
cramped inside a ~280px column with no way to resize; board-level
workspace defaults can't be changed after board creation; and users
believe they must block a task, comment, then unblock just to talk to
a worker.

- Create-task dialog: replace the inline column form with a centered
  modal (reuses hermes-kanban-dialog chrome, 36rem wide) with labeled
  fields for title, assignee, priority, skills, workspace kind/path,
  goal mode, and parent task. Same request shape; Enter/Escape behavior
  preserved; submit disabled until a title is present.
- Board settings dialog: new Settings button in the board switcher opens
  a modal to edit display name, description, and the board-level default
  project directory (default_workdir). PATCH /boards/:slug now accepts
  default_workdir (validated absolute existing dir; empty string clears;
  omitted leaves unchanged) and returns the recomputed
  default_workspace_kind so task-creation defaults follow immediately.
- Comment workflow hint: the task drawer's comment box now explains that
  comments land on the thread immediately and reach the worker on its
  next run/kanban_show() — no block/unblock dance needed — with a fuller
  tooltip for when blocking IS the right tool.
- i18n: new keys optional in the kanban namespace with English fallbacks
  in the bundle (established pattern; avoids churning 17 locale files).
- Docs: dashboard section updated for the dialog + Settings button.
This commit is contained in:
Teknium 2026-07-17 07:23:54 -07:00 • committed by GitHub
parent 71252f0dcb
commit e4f87557b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 483 additions and 163 deletions

View file

@ -173,6 +173,67 @@ def test_create_board_rejects_invalid_project_directory(client, path):
assert "project directory" in response.json()["detail"].lower()
def test_patch_board_sets_project_directory(client, tmp_path):
"""Board-level default_workdir must be editable after creation."""
kb.create_board("late-config")
project_dir = tmp_path / "late-project"
project_dir.mkdir()
response = client.patch(
"/api/plugins/kanban/boards/late-config",
json={"default_workdir": str(project_dir)},
)
assert response.status_code == 200, response.text
board = response.json()["board"]
assert board["default_workdir"] == str(project_dir.resolve())
# The recommendation flips from scratch to a persistent kind so the
# create-task dialog's workspace default follows the board setting.
assert board["default_workspace_kind"] == "dir"
assert kb.read_board_metadata("late-config")["default_workdir"] == str(
project_dir.resolve()
)
def test_patch_board_clears_project_directory(client, tmp_path):
"""Empty string clears default_workdir; omitting it leaves it unchanged."""
project_dir = tmp_path / "was-configured"
project_dir.mkdir()
kb.create_board("clearable", default_workdir=str(project_dir))
# Omitted key → unchanged.
r = client.patch(
"/api/plugins/kanban/boards/clearable",
json={"name": "Renamed Only"},
)
assert r.status_code == 200
assert r.json()["board"]["default_workdir"] == str(project_dir.resolve())
# Empty string → cleared, recommendation falls back to scratch.
r = client.patch(
"/api/plugins/kanban/boards/clearable",
json={"default_workdir": ""},
)
assert r.status_code == 200
board = r.json()["board"]
assert not board.get("default_workdir")
assert board["default_workspace_kind"] == "scratch"
@pytest.mark.parametrize("path", ["relative/project", "~/missing-project"])
def test_patch_board_rejects_invalid_project_directory(client, path):
"""PATCH must validate default_workdir like board creation does."""
kb.create_board("strict")
response = client.patch(
"/api/plugins/kanban/boards/strict",
json={"default_workdir": path},
)
assert response.status_code == 400
assert "project directory" in response.json()["detail"].lower()
def test_new_board_dialog_collects_project_directory():
"""Board creation should expose the setting that controls safe task defaults."""
bundle = (