Skip to content

Add subtasks to quick add and discard the draft on hide - #234

Merged
MaplumeX merged 1 commit into
mainfrom
fix/quick-add-state-pickers-subtasks
Oct 15, 2026
Merged

MaplumeX merged 1 commit into
mainfrom
fix/quick-add-state-pickers-subtasks

Conversation

@MaplumeX

Copy link
Copy Markdown
Owner

Summary

Quick Add cards can now capture a small subtask checklist along with the title, and closing the card now abandons the draft instead of restoring it on the next open. The card is shared by the desktop popup and the Android overlay (ADR-0020), so both get the behavior.

Changes

Quick Add card (packages/ui)

  • New QuickAddSubtaskList: a local, pre-creation checklist inside the card with keyboard behavior matching the expanded task row — Enter inserts below (Enter on an empty row ends input), Backspace on an empty row removes it, ↑/↓ move between rows, and pasted multi-line text splits into rows. Empty titles are dropped.
  • QuickAddCard: holds subtasks in the draft state, renders the list under the note, and exposes an "Add subtask" icon button in the footer that opens the first row (it disappears once the list exists). draftFromState emits trimmed, non-empty subtasks.
  • openField now tracks which slot opened the picker (chip or icon). When a previously unset icon button gets a value, the entry becomes a chip and the picker closes with the old entry — same as the expanded task row.
  • New QuickAddCardHandle.reset() clears the draft and closes any open picker.

Desktop popup (packages/desktop)

  • QuickAddApp calls reset() after the window hides, so blur, Esc, transparent-area clicks and submit all mean "close and discard"; the next summon is a blank card. Errors/notices are cleared along with it, and the reset happens after the exit animation so the card does not visibly blank out mid-transition.
  • Comments updated to describe the new window/draft semantics.

API (packages/api)

  • QuickAddDraft.subtasks?: string[] and QuickAddDeps.createSubtask(taskId, data) (wired to the current task backend by default).
  • toQuickAddDraft accepts subtasks from the relay payload, keeping only non-empty strings, trimmed, in list order.
  • createFromQuickAddDraft creates the subtasks sequentially after the task, in checklist order.

Wiring and docs

  • MagicPlusInbox passes useCreateSubtask through QuickAddDeps; the test mock supplies it.
  • .scratch/quick-add-v2 and .scratch/quick-add-android specs updated: subtasks are in scope, Repeat Rule stays out (deferred via "continue in app"), and the close-means-discard plus icon-to-chip picker behavior is documented.

Tests

  • draft.test.ts: subtask parsing (non-strings/blank dropped, order kept) and sequential subtask creation.
  • QuickAddCard.test.tsx: draft projection of subtasks, add/Enter/Backspace interactions, reset(), and picker auto-close after setting a value from an icon button.
  • MagicPlusInbox.test.tsx: mock updated for the new dependency.

Run: pnpm test, pnpm lint, pnpm typecheck.

@MaplumeX
MaplumeX merged commit 08abe70 into main Oct 15, 2026
4 checks passed
@MaplumeX
MaplumeX deleted the fix/quick-add-state-pickers-subtasks branch October 15, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant