Skip to content

Task assignee becomes a typed person relationship, replacing the free-text field #2112

Closed

Description

@malibio

Change

Task assignment becomes a typed relationship to a person node, replacing the free-text assignee field.

Today assignee is a text field on task (packages/core/src/models/core_schemas.rs), and its own description says what it is:

"Person responsible for the task, as a free-text name or identifier — not a relationship to a person node. Absent means unassigned."

That was always a placeholder. Two more signals confirm it:

  • TaskNode::assignee_id() / set_assignee_id() (packages/core/src/models/task_node.rs:580-586) exist but merely alias the free-text assignee: Option<String> field
  • The module doc example (task_node.rs:28) advertises "assigneeId": null — a field the struct does not actually have

With person gaining a task relationship (#2111), keeping the string field too would let a task be assigned to the string "Michael" while simultaneously edged to a different person node, with nothing reconciling them and every query forced to check both. The edge supersedes the field.

Pre-release: no migration, no compat shim — reset the database.

Scope

Remove the assignee field from task's schema; assignment is expressed solely as the person↔task edge declared from person's side (see #2111). Person's relationship can then use reverse_name: "assignee" — there is no longer a field to collide with, and task gets a properly typed assignee edge under the name the accessors were already reaching for.

Nothing functional is lost: the form's assignee combobox is a dead placeholder (assigneeOptions: [] with // TODO: Populate from UserService), so no working feature depends on the free-text value.

Call sites

Rust (10 files reference assignee; task_node.rs alone has 43 occurrences):

  • models/task_node.rs — assignee: Option<String> field (:354), extraction (:422-424), serialization (:450-451, :507-508), the two alias accessors (:580-586), the stale doc example (:28), and the SQL comment at :274
  • models/core_schemas.rs — the field definition itself
  • models/node.rs, behaviors/mod.rs, db/sqlite_store/nodes.rs, services/node_service/{schema.rs,mod.rs}, services/migration_registry.rs
  • packages/nodespace-types/src/convert.rs:116-148 — proto conversion
  • db/migrations/v003_property_indexes.rs:27 — a dedicated index:
    CREATE INDEX IF NOT EXISTS idx_task_assignee
      ON node (json_extract(properties, '$.task.assignee')) WHERE node_type = 'task';
    This index becomes dead once the field is gone. Decide whether to drop it in a new migration or edit v003 in place (pre-release, so editing in place is viable and cleaner).

Frontend (9 files):

  • types/task-node.ts — the typed field
  • services/shared-node-store.svelte.ts — updateTaskNode's TaskNodeUpdate mapping and narrow response merge both name assignee explicitly
  • services/node-normalize.ts — OPTIMISTIC_TYPED_FIELDS promotion table
  • services/adapter-core.ts, design/components/schema-field-update.ts, plugins/core-plugins.ts
  • components/property-forms/task-schema-form.svelte — the dead combobox (~66 lines)
  • components/property-forms/schema-property-form.svelte — a duplicate of the same dead combobox (this file is itself dead code slated for deletion in Add typed property forms for packaged schemas person and project, following the task form pattern #2102)
  • components/viewers/task-node-viewer.svelte

Backend typed update path: update_task_node carries assignee through TaskNodeUpdate (packages/core/src/models/task_node.rs, services/node_service/schema.rs). Removing the field means removing it from that update model, the gRPC message, and the Tauri command surface.

Design questions to settle

Cardinality. One assignee per task, or many? Person's side is Out/Many (a person has many tasks). Task's reverse should be One for single-assignee semantics, or Many if co-assignment is wanted. The current free-text field is effectively single-valued — recommend One unless co-assignment is a requirement.

Querying and filtering. assignee is indexed: true today and filterable as a property. As an edge it moves to the relationship table, so any query/filter path that treats assignee as a scalar property needs to route through relationship traversal instead. Verify the query builder and Kanban group-by (which reads enum/scalar fields) handle — or explicitly exclude — a relationship-valued assignee.

UI affordance. The replacement is a person picker backed by real person nodes, not a free-text input. RelationshipViewerModal is the only existing relationship-editing pattern; an inline picker in the task form is new work. Coordinate with #2102, which rebuilds the typed forms.

Acceptance criteria

  • assignee removed from task's schema; assignment expressed only as the person↔task edge
  • Person's task relationship uses reverse_name: "assignee"
  • TaskNode.assignee, assignee_id(), set_assignee_id() removed; stale "assigneeId" doc example corrected
  • assignee removed from TaskNodeUpdate, the gRPC message, the Tauri command, and the frontend typed-update path
  • idx_task_assignee (v003_property_indexes.rs:27) removed or migrated
  • Dead assignee comboboxes removed from task-schema-form.svelte and schema-property-form.svelte
  • Cardinality decided and documented
  • Assigning a task to a person, and clearing an assignment, both work end to end
  • Query/filter paths that referenced assignee as a property either traverse the edge or explicitly exclude it
  • Task's empty-relationships assertion (core_schemas.rs:1426-1443) updated

Related

Activity

  1. malibio commented on Sep 8, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 238 test files passed, 4925 tests passed (85.63s).

  2. self-assigned this
    on Sep 8, 2026
  3. added a commit that references this issue on Sep 8, 2026
    b57c374
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions