Skip to content

feat(status): add --pause-activity to status set and show it - #92

Open
lmjabreu wants to merge 2 commits into
mainfrom
lmjabreu/nifty-napier-1caea6
Open

lmjabreu wants to merge 2 commits into
mainfrom
lmjabreu/nifty-napier-1caea6

Conversation

@lmjabreu

@lmjabreu lmjabreu commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Adds tdc status set --pause-activity, which pauses your Todoist Karma and streaks while the status is active. It is independent of --pause-notifications: neither flag implies the other, and they can be combined. tdc status, tdc status set and the tdc user status line now show activity paused. Comms only carries the effect; it does not act on it. The --json output is unchanged for statuses without it.

Checked against production on 23 Oct with Doist/comms-backend#1092 live: tdc status set "tdc live check" --pause-activity --for 10m returned effects.pauseActivity, and tdc status, tdc user, tdc status --json and td status all showed it as activity paused. After tdc status clear, tdc and td both reported no status.

Reference

  • Backend: Doist/comms-backend#1092 (was dropping pause_activity on write), Doist/comms-backend#1081
  • SDK: pauseActivity is in @doist/comms-sdk 3.5.0 and up; this repo is on 3.8.1
  • Spec: Activity effect and Vacation Mode replacement

Test plan

Needs tdc auth login --full-access.

  1. Run tdc status set "Holiday" --pause-activity --for 10m.
    • It prints the message with the expiry and activity paused.
  2. Run tdc status and tdc user.
    • Both show activity paused. td status shows it too.
  3. Run tdc status set "Focus" --pause-notifications --pause-activity --for 10m, then tdc status --json.
    • effects has both pauseNotifications and pauseActivity.
  4. Run tdc status set "Focus" --pause-notifications --for 10m.
    • It shows notifications paused only.
  5. Run tdc status set "x" --pause-activity --dry-run.
    • It prints Pause activity: yes and sends nothing.
  6. Run tdc status clear.
    • It prints Status cleared.

🤖 Generated with Claude Code

@lmjabreu
lmjabreu marked this pull request as ready for review October 23, 2026 13:44
@lmjabreu
lmjabreu requested review from a team and nats12 and removed request for a team October 23, 2026 13:44

@doistbot doistbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds --pause-activity to tdc status set, wiring the new effect through the SDK payload, dry-run preview, and the shared formatStatus helper so status, status set, and user output all show activity paused, while keeping it independent of --pause-notifications and preserving the existing --json shape when the effect is absent. No inline issues were flagged. The implementation follows the established --pause-notifications pattern closely (conditional-spread arg building, MutationOptions, printDryRun), the display label lives once in the shared formatter so all status surfaces pick it up without duplication, and SKILL_CONTENT and SKILL.md stay in sync as required. Tests cover the combined-effects case, dry-run output, text rendering, and the unchanged JSON path; the security surface is limited to a boolean flag adding a constant effect object and fixed display labels, with no changes to auth, parsing, or trust boundaries. Nothing blocking — the backend dependency is live in production and verified against it per the test plan.

I also included a few optional follow-up notes in the details below.

Optional follow-up notes (3)
  • P3 src/commands/status/status.test.ts:428: This test's name promises to verify the help text does not claim Comms acts on --pause-activity, but the assertions only check for --pause-activity, Karma, streaks, and independent. It would still pass if the help text also said something like "pauses activity in Comms." Either add a scoped negative assertion against the --pause-activity description or drop the "without claiming Comms acts on it" part from the test name.
  • P3 src/commands/status/status.test.ts:98: The new JSON test only mocks pauseNotifications, so it never proves pauseActivity survives the --json passthrough — yet machine consumers reading --json rely on seeing that effect. Add pauseActivity: {} to the mocked status (and the expected object) so this test also pins the new field's wire contract.
  • P3 src/commands/status/status.test.ts:178: This test re-covers what 'prints the expiry and the pause in the text output' already establishes: the set path prints formatStatus(user.status), and the show tests above already cover activity paused rendering both alone and combined. Deleting it loses no failure mode; if you want one set-path check per effect, fold the assertion into the existing pause-notifications test instead.

Share Feedback • Review Logs

@lmjabreu

Copy link
Copy Markdown
Contributor Author

status.test.ts:428: This test's name promises to verify the help text does not claim Comms acts on --pause-activity, but the assertions only check for --pause-activity, Karma, streaks, and independent.

Fixed in 467cf8b. Dropped that claim from the existing test's name and added a separate test that checks the --pause-activity option description has Karma and no mention of Comms.

status.test.ts:98: The new JSON test only mocks pauseNotifications, so it never proves pauseActivity survives the --json passthrough.

Done in 467cf8b. Added a --json test for a status carrying pauseActivity. Kept the existing one as the check that a status without the effect keeps its shape.

status.test.ts:178: This test re-covers what 'prints the expiry and the pause in the text output' already establishes.

Keeping as-is. It is the only test that status set prints activity paused, and that existing test only covers notifications paused. Happy to fold it in if you'd rather have one set-path test.

@lmjabreu

Copy link
Copy Markdown
Contributor Author

@doistbot /review

@doistbot doistbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR updates feat(status): add --pause-activity to status set and show it. No issues were flagged in the reviewed diff.

Share Feedback • Review Logs

lmjabreu and others added 2 commits October 23, 2026 21:59
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@lmjabreu
lmjabreu force-pushed the lmjabreu/nifty-napier-1caea6 branch from 467cf8b to 47e5e39 Compare October 23, 2026 20:59
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.

2 participants