Repository navigation
Add subtasks to quick add and discard the draft on hide - #234
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)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: holdssubtasksin 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).draftFromStateemits trimmed, non-emptysubtasks.openFieldnow tracks which slot opened the picker (chiporicon). 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.QuickAddCardHandle.reset()clears the draft and closes any open picker.Desktop popup (
packages/desktop)QuickAddAppcallsreset()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.API (
packages/api)QuickAddDraft.subtasks?: string[]andQuickAddDeps.createSubtask(taskId, data)(wired to the current task backend by default).toQuickAddDraftacceptssubtasksfrom the relay payload, keeping only non-empty strings, trimmed, in list order.createFromQuickAddDraftcreates the subtasks sequentially after the task, in checklist order.Wiring and docs
MagicPlusInboxpassesuseCreateSubtaskthroughQuickAddDeps; the test mock supplies it..scratch/quick-add-v2and.scratch/quick-add-androidspecs 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.