Skip to content

feat: add section reorder command#349

Merged
rmartins90 merged 3 commits into
mainfrom
rmartins90/section-reorder
May 19, 2026
Merged

feat: add section reorder command#349
rmartins90 merged 3 commits into
mainfrom
rmartins90/section-reorder

Conversation

@rmartins90
Copy link
Copy Markdown
Contributor

Overview

Adds td section reorder so sections can be reordered within a project from the CLI. It supports positional moves, plus relative moves before or after another section.

Changes

  • Added td section reorder with --project, --section, --before, --after, --position, --json, and --dry-run.
  • Added a Sync API helper for Todoist's section_reorder command.
  • Updated section tests, shared fixtures, SKILL_CONTENT, and the generated Todoist CLI skill file.

Test plan

  1. Create or pick a test project with at least three sections.
  2. Run node dist/index.js section reorder "Review" --project "<project>" --before "Done" --dry-run and check the preview shows the expected order.
  3. Run node dist/index.js section reorder "Review" --project "<project>" --position 0 --json and confirm the JSON output lists Review first.
  4. List/open the project sections and confirm Todoist reflects the new order.

@doistbot doistbot requested a review from frankieyan May 18, 2026 22:25
Copy link
Copy Markdown
Member

@doistbot doistbot left a comment

Choose a reason for hiding this comment

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

This PR introduces the td section reorder command, offering robust functionality to rearrange sections within a project using positional or relative moves. It is a great addition that significantly expands the CLI's project management capabilities. A few adjustments are noted regarding the reuse of existing entity resolution and validation helpers, optimizing pagination logic to reduce memory overhead, polishing output formatting for consistency, and strengthening the test suite with more robust SDK boundary mocks and coverage for edge cases.

Share FeedbackReview Logs

Comment thread src/commands/section/reorder.ts
Comment thread src/commands/section/reorder.ts Outdated
Comment thread src/commands/section/index.ts Outdated
Comment thread src/commands/section/reorder.ts Outdated
Comment thread src/commands/section/reorder.ts Outdated
Comment thread src/commands/section/section.test.ts Outdated
Comment thread src/commands/section/section.test.ts Outdated
Comment thread src/commands/section/section.test.ts
- Reuse shared ref resolution for section reorder

- Extract shared reorder placement validation

- Assert section reorder sync payloads in tests
Comment thread src/commands/section/reorder.ts Outdated
Comment thread src/commands/section/section.test.ts Outdated
- Print section order after successful reorders

- Share reorder command args in section tests
@rmartins90 rmartins90 merged commit fc87e70 into main May 19, 2026
5 checks passed
@rmartins90 rmartins90 deleted the rmartins90/section-reorder branch May 19, 2026 11:03
doist-release-bot Bot added a commit that referenced this pull request May 19, 2026
## [1.66.0](v1.65.0...v1.66.0) (2026-05-19)

### Features

* add section reorder command ([#349](#349)) ([fc87e70](fc87e70))
@doist-release-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.66.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants