Custom task fields per workspace, with Priority, Size and Waiting on #134

Merged
CrowderSoup merged 2 commits from claude/custom-fields into main 2026-11-20 14:30:25 +00:00
Owner

Why

The usage review showed tags doing the work of fields: priority-* (50 tasks), size-* (56), type-*, plus needs-azure with long "WAITING ON AZURE" comments. Decisions so far:

  • Fields are customizable per workspace.
  • The defaults are Priority (Critical / Normal / Low), Size (S / M / L) and Waiting on.
  • Waiting on asks why.
  • Type is a preset, not a default.
  • Sprints become cycles later, not a field.

What

  • Model: TaskField (per workspace: name, kind, options, ask_reason, order). Tasks get field_values and field_reasons (JSON, keyed f<id> so renames never touch tasks, and so JSON lookups don't read the key as an array index). Migration 0021 gives every existing workspace the three defaults, and new workspaces get them too.
  • Rules live in one place, apps/tasks/fields.py, used by the web, API and MCP:
    • Values are parsed from labels, names, numbers, dates and yes/no.
    • A field that asks why needs a reason for every new value. The reason is posted as a comment.
    • A reason sent while clearing the field is posted as the answer.
    • Each change gets a history row.
  • Web:
    • Settings → Workspace → Fields lets owners add, rename, edit options, reorder, delete, and add presets (Planning, Household, Reading list).
    • Task create and edit forms have inputs for every field. Waiting on has a reason box that the browser makes required when you pick someone; the server checks again and redisplays the form with what you typed.
    • Cards, list rows and the panel show the values.
    • The filter bar can filter by choice, person and yes/no fields, and saved views keep those filters. The list can sort and group by fields.
  • API:
    • custom_fields and field_reasons on tasks, by field name.
    • ?field=Priority=Critical filters.
    • GET /api/v1/fields/.
    • field_label on history rows.
    • Android ignores the new keys (ignoreUnknownKeys).
  • MCP: list_fields, and custom_fields / field_reasons on create_task, update_task and list_tasks. The docstrings tell agents to use fields instead of tags.
  • Moving and recurrence: values move with a task to a workspace that has a field of the same name. Recurring copies keep values but not Waiting on.
  • Android:
    • Syncs each workspace's fields and each task's values (Room version 8, migration 7→8).
    • List rows show field chips: Critical with its color dot, and "Waiting on Azure" in the warm tone. Tapping a chip filters the list.
    • The task page lists each field, with the reason under Waiting on.
    • The editor has a Fields card: choices as chips, people from a menu, yes/no, number, date and text. Picking someone for Waiting on asks what's needed, and the app checks this before saving. Clearing it takes an optional answer.
    • Edits send only the fields that changed. The server's field errors are shown as messages.
    • The fields API lists who a person field can name, so the phone can offer them.
  • manage.py tags_to_fields converts priority-* (polish → Low), size-* and type-* tags. It's a dry run unless you pass --apply, and --remove-tags takes the converted tags off. Not run against production.

Testing

  • apps/tasks/tests/test_fields.py (25 tests), mcp_server/tests/test_fields.py, and android/.../FieldsTest.kt (payload diffing, reason rules, ordering, filtering).
  • Full suite: 886 passed, including the browser tests. makemigrations --check is clean.
  • Checked by hand on a local server: board, panel, edit form, list filter and the settings card.

Not in this PR

  • A built-in "Waiting on me" filter on Android. For now, tap the "Waiting on Azure" chip.
  • Cycles, to replace sprint-N tags.
  • Target dates on projects.

Merge note

This conflicts with #133 (agent act-as) in mcp_server/server.py signatures and apps/api/views.py / urls.py. Whichever lands second needs act_as added to the new list_fields tool and a small rebase.

🤖 Generated with Claude Code

## Why The usage review showed tags doing the work of fields: `priority-*` (50 tasks), `size-*` (56), `type-*`, plus `needs-azure` with long "WAITING ON AZURE" comments. Decisions so far: - Fields are customizable per workspace. - The defaults are Priority (Critical / Normal / Low), Size (S / M / L) and Waiting on. - Waiting on asks why. - Type is a preset, not a default. - Sprints become cycles later, not a field. ## What - **Model:** `TaskField` (per workspace: name, kind, options, ask_reason, order). Tasks get `field_values` and `field_reasons` (JSON, keyed `f<id>` so renames never touch tasks, and so JSON lookups don't read the key as an array index). Migration 0021 gives every existing workspace the three defaults, and new workspaces get them too. - **Rules** live in one place, `apps/tasks/fields.py`, used by the web, API and MCP: - Values are parsed from labels, names, numbers, dates and yes/no. - A field that asks why needs a reason for every new value. The reason is posted as a comment. - A reason sent while clearing the field is posted as the answer. - Each change gets a history row. - **Web:** - Settings → Workspace → Fields lets owners add, rename, edit options, reorder, delete, and add presets (Planning, Household, Reading list). - Task create and edit forms have inputs for every field. Waiting on has a reason box that the browser makes required when you pick someone; the server checks again and redisplays the form with what you typed. - Cards, list rows and the panel show the values. - The filter bar can filter by choice, person and yes/no fields, and saved views keep those filters. The list can sort and group by fields. - **API:** - `custom_fields` and `field_reasons` on tasks, by field name. - `?field=Priority=Critical` filters. - `GET /api/v1/fields/`. - `field_label` on history rows. - Android ignores the new keys (`ignoreUnknownKeys`). - **MCP:** `list_fields`, and `custom_fields` / `field_reasons` on `create_task`, `update_task` and `list_tasks`. The docstrings tell agents to use fields instead of tags. - **Moving and recurrence:** values move with a task to a workspace that has a field of the same name. Recurring copies keep values but not Waiting on. - **Android:** - Syncs each workspace's fields and each task's values (Room version 8, migration 7→8). - List rows show field chips: Critical with its color dot, and "Waiting on Azure" in the warm tone. Tapping a chip filters the list. - The task page lists each field, with the reason under Waiting on. - The editor has a Fields card: choices as chips, people from a menu, yes/no, number, date and text. Picking someone for Waiting on asks what's needed, and the app checks this before saving. Clearing it takes an optional answer. - Edits send only the fields that changed. The server's field errors are shown as messages. - The fields API lists who a person field can name, so the phone can offer them. - `manage.py tags_to_fields` converts `priority-*` (polish → Low), `size-*` and `type-*` tags. It's a dry run unless you pass `--apply`, and `--remove-tags` takes the converted tags off. **Not run against production.** ## Testing - `apps/tasks/tests/test_fields.py` (25 tests), `mcp_server/tests/test_fields.py`, and `android/.../FieldsTest.kt` (payload diffing, reason rules, ordering, filtering). - Full suite: 886 passed, including the browser tests. `makemigrations --check` is clean. - Checked by hand on a local server: board, panel, edit form, list filter and the settings card. ## Not in this PR - A built-in "Waiting on me" filter on Android. For now, tap the "Waiting on Azure" chip. - Cycles, to replace `sprint-N` tags. - Target dates on projects. ## Merge note This conflicts with #133 (agent act-as) in `mcp_server/server.py` signatures and `apps/api/views.py` / `urls.py`. Whichever lands second needs `act_as` added to the new `list_fields` tool and a small rebase. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Custom task fields per workspace, with Priority, Size and Waiting on
All checks were successful
tests / pytest (push) Successful in 1m14s
68cb3a0676
Tags were standing in for fields (priority-*, size-*, needs-azure). Each
workspace now defines its own fields: choice, person, number, text, date
and yes/no.

- Defaults for every workspace (data migration for existing ones):
  Priority (Critical / Normal / Low), Size (S / M / L), and Waiting on, a
  person field that asks why. Presets add Planning (adds Type and Firm
  deadline), Household (Where) and Reading list (Author, Format, Rating).
- A field that asks why needs a reason whenever it gets a new value, in
  the web form, the API and MCP. The reason shows on the task and is
  posted as a comment. Clearing it posts an optional answer.
- Owners manage fields in Settings → Workspace: add, rename, edit options
  (an option renamed in place keeps its tasks), reorder, delete, presets.
- Cards, list rows and the task panel show values. The board and list
  filter by choice, person and yes/no fields (saved views keep them), and
  the list sorts and groups by fields.
- API: custom_fields and field_reasons on tasks, read and write by name;
  ?field=Name=Value filters; GET /api/v1/fields/. MCP: list_fields, and
  custom_fields / field_reasons on create_task, update_task, list_tasks.
- Values move with a task to another workspace when it has a field of the
  same name. Recurring tasks copy values, except the ones that ask why.
- manage.py tags_to_fields converts priority-*, size-*, type-* tags (dry
  run unless --apply; --remove-tags drops them).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Android: show, edit and filter custom fields
All checks were successful
tests / pytest (push) Successful in 1m12s
android / apk (push) Successful in 9m19s
ec124d94d8
- Sync each workspace's fields (GET /api/v1/fields/; none from an older
  server) into a new Room table, and each task's custom_fields and
  field_reasons into new task columns (database version 8, migration 7→8).
- Tasks show field chips in the list (Critical with its color, "Waiting on
  Azure" in the warm tone); tap one to filter the list to tasks that share
  it. The task page lists each field, with why for Waiting on.
- The editor has a Fields card: choices as chips, people from a menu,
  yes/no, number, date and text. Picking someone for a field that asks why
  asks what's needed (checked before saving, and by the server); clearing
  it takes an optional answer. Edits send only the fields that changed.
- The API lists who a person field can name as its options, for the
  phone's picker. A 400's field message (e.g. the missing reason) is shown
  instead of "The server returned 400."

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No description provided.