Skip to content

Todo Panel — Create items per category + WebSocket sync #47

Description

@harrryyd

Parent

#44

What to build

A per-category inline composer for creating new todo items, plus the WebSocket mutation API to persist them. Items render within their category section, sorted by creation time (newest last).

State machine: todoStore gains createItem(categoryId, title) — creates a new item with status todo, assigns an order, generates an ID, sets createdAt.

WebSocket: todo.mutate NativeApi method accepts a mutation and returns the updated state. Batched mutations so future slices (drag) can commit atomically.

UI: Each category header has a "+" icon button inline. Clicking it reveals a small text input. Pressing Enter creates the item with the entered title. Items appear below the category header in creation-time order.

Tests: todoStore — item creation, ordering. todoPersistence — items survive restart.

Acceptance criteria

  • todoStore.createItem(categoryId, title) creates item with correct defaults (status=todo, order, id, createdAt)
  • todo.mutate WebSocket method accepts mutation payload and returns updated state
  • Server persists mutations to ~/.t3code/todos.json via debounced atomic write
  • "+" icon button inline with each category header
  • Clicking "+" reveals a text input; Enter creates the item; Escape cancels
  • Items render sorted by createdAt within their category
  • Items render with title and status icon (static for now, no click-to-cycle yet)
  • Unit tests: createItem assigns correct defaults, ordering
  • bun fmt, bun lint, bun typecheck all pass

Blocked by

Activity

  1. harrryyd commented on Jun 8, 2026

    @harrryyd
    OwnerAuthor

    Implemented and merged to main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions