Add --list flag to todos position for cross-list moves#372
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for moving a todo to a different todolist (within the same project) via basecamp todos position by introducing a --list/-l destination flag and wiring it through to the API payload (parent_id), plus a small docs update.
Changes:
- Extend
todos positionto accept--list/-l(todolist ID or URL) for cross-list moves within a project. - Detect cross-project todolist URLs and return a usage error.
- Update
skills/basecamp/SKILL.mdwith an example for cross-list moves.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
internal/commands/todos.go |
Adds --list/-l handling to todos position, parses IDs/URLs with project-aware extraction, and passes parentID into the SDK reposition call. |
skills/basecamp/SKILL.md |
Documents the new todos position --list usage example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9bb514d5a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d867324106
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d867324 to
0b7360d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b7360d542
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Review carefully before merging. Consider a major version bump. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b36141509
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d6a2cae to
6ea302a
Compare
628f8e8 to
bc04986
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 27 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Support moving a todo to a different todolist within the same project via the reposition endpoint's parent_id field. Detects and rejects cross-project moves with guidance. Blocked on SDK exposing parentID on Reposition — will compile after rebasing onto main with the new SDK release. Closes #337
- Resolve --list via resolveTodolistInTodoset so names like "Sprint 1" work, not just numeric IDs and URLs - Use project context from todo URL, --in flag, and config for both name resolution and cross-project validation - Use ErrUsageHint for the cross-project error to show actionable guidance - Update help text and SKILL.md placeholder to reflect name support
Project context from --in may be a name like "myproject" while the list URL yields a numeric project ID. Resolve the name to an ID before comparing, so --in myproject --list <same-project-url> doesn't falsely reject. Also consolidates project resolution: the resolved ID is reused for both cross-project validation and todolist name resolution.
Cover the new cross-list move path: - Cross-project URL rejection - Same-project URL passes validation - List name without project context requires --in - Cross-project via config project ID
…id in response - Only fire the cross-project check when the todo's project comes from its URL, not from config/flags. Config project is a default context that may not match where a bare-ID todo actually lives. - Include todolist_id in JSON response when --list is used so automation can confirm the cross-list move.
ResolveProject was called unconditionally when --list was provided and the project context was non-numeric, even when the list was already a numeric ID and no resolution was needed. This made otherwise valid moves fail if the configured project name was stale. Now only resolves when cross-project URL validation or todolist name resolution actually requires the numeric project ID.
The read breadcrumb from 'notifications list --page 2' said 'basecamp notifications read <id>' without --page, leading users into a "not found" error because read defaults to page 0. Now carries the page context forward.
7292d67 to
635e6ac
Compare
extractWithProject can return an empty recording ID for URLs that parse but have no recording segment (e.g. project URLs). Fail fast with a targeted error instead of falling through to a confusing "Invalid todolist ID".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
A todo URL or project URL passed as --list would silently extract the wrong ID and use it as a todolist ID. Now validates via urlarg.Parse that the URL is actually a todolists URL (correct type, not a collection, has a recording ID).
Summary
--list(-l) flag totodos positioncommand for cross-list moves within the same project via the API'sparent_idfieldnotifications listbreadcrumb to include--pagewhen not on first pageCloses #337
Test plan
bin/cipasses (only pre-existingcheck-smoke-coveragegap from new SDK commands)todos positionwith--listmoves todo to different list (unit test:TestTodosPositionAcceptsSameProjectListURL)todos positionwithout--liststill works (unit test:TestTodosPositionRequiresPosition)--listerrors clearly (unit test:TestTodosPositionRejectsCrossProjectListURL).surfacesnapshot (includes--listfor position/move/reorder)