Add task-level drop/undrop support - #44
Open
Packetslave wants to merge 2 commits into
Open
Conversation
Tasks could already be filtered by dropped status, but there was no way to actually drop one — only projects supported it, via the status enum. OmniFocus's JXA API exposes this as task.drop(allOccurrences, dateDropped), distinct from the completed/markComplete pattern. - task update --drop / --undrop (CLI), dropped param (MCP update_task) - Undrop restores via task.active = true (dropDate is read-only, so drop() has no direct inverse — this is OmniFocus's own documented pattern for restoring a dropped task) - Fixed serializeTask's dropped field, which read task.dropped — a property that is always undefined via this JXA bridge regardless of actual state (confirmed via direct osascript probe). It now derives dropped status from dropDate !== null, which is reliably populated. Verified end-to-end against live OmniFocus: drop sets dropDate and flips effectiveActive/active to false; undrop clears both.
An adversarial review flagged that task.active = true isn't specific to "dropped" — calling it on a completed task could silently un-complete it, an untested edge case in the original patch. Undrop is now a no-op on a completed task (verified live: completed stays true after --undrop). Also tightened the MCP dropped field's description to match the house style of sibling completed/flagged fields.
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
Projects could already be dropped (
status: "dropped"), but individual tasks had noway to be dropped at all —
update_task/task updateonly ever supportedcompleted. OmniFocus's own JXA API exposes dropping as a task method,task.drop(allOccurrences, dateDropped), distinct from thecompleted/markComplete pattern, so it needed its own option rather than reusing
completed.Changes
task update --drop/--undrop(CLI),droppedboolean param on the MCPupdate_tasktooltask.active = true—dropDateis read-only, sodrop()has no direct inverse; this is OmniFocus's own documented pattern for
restoring a dropped task. Guarded so
--undropis a no-op on a completedtask rather than risking a silent un-complete (
activeisn't drop-specific).serializeTask'sdroppedfield: it readtask.dropped, which is alwaysundefinedvia this JXA bridge regardless ofactual state (confirmed via a direct
osascriptprobe). Now derives it fromdropDate !== null, which is reliably populated. Bundled here because the newflag would otherwise be unobservable in JSON output — flagging explicitly
since it changes existing serialization behavior, not just adds new behavior.
droppedreflects a task's own drop state, not inheritance from adropped parent project (mirrors how
completedalready works) — a task in adropped project reports
dropped: falsebuteffectivelyActive: false.Testing
bun run typecheck,bun run test(24/24),bun run lintall passdropDateset,effectiveActive/active→ false; undrop → both cleared/restored;undrop-on-a-completed-task → confirmed no-op (
completedstaystrue)