You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0f5e414
Browse filesBrowse the repository at this point in the historyBrowse files
Add todolists position to reorder to-do lists (#484) (#562)
* Add `todolists position` to reorder to-do lists (#484)
Adds `basecamp todolists position <id|url>...` to reorder a to-do list
within its todoset — the one repositioning gap in the to-do family
(`todos` and `todolistgroups` already had it).
Single-list mode sets one explicit position (`--to N`, 1-based). Bulk
mode accepts several incomplete lists from the same todoset and sets
their visible order top-to-bottom; it is restricted to position 1
because reverse-iterating onto any other slot cannot reconstruct the
typed order once loose to-dos or hidden completed lists shift the base.
Bulk preflight enforces a shared todoset/bucket and rejects completed
lists before issuing any PUT, and application stops at the first failure
(a half-applied reorder is a wrong order), reporting applied-vs-attempted.
Uses the dedicated `PUT /todosets/todolists/{id}/position.json` route,
not the generic `/recordings/{id}/position.json` the issue's workaround
used — the generic one skips the to-do-list position math and mis-places
lists when loose to-dos or hidden completed lists exist.
Naming follows the to-do family (`position`, aliases `move`/`reorder`,
`--to` leading with `--position` accepted); a to-do list has no
destination container, so `--to N` is unambiguously an index.
SDK bumped to 93ace8d5 (basecamp-sdk#398), which also absorbs #396
(Templates.CreateProject envelope fix, signature unchanged) and #392
(SDK tests only).
Closes#484
* Preserve error classification on partial reposition failure
The bulk-apply failure path reclassified every non-*output.Error (raw
transport/runtime failures, context cancellation) as code=usage via
ErrUsageHint, overwrote the SDK's structured hint with the rerun hint,
and claimed the todoset was left in an intermediate order even when the
failing PUT was the first/only one and nothing had been mutated.
Now: when zero PUTs have landed (always true in single-list mode, and
when a bulk run's first PUT fails), surface the underlying error
unchanged — its code, HTTP status, and hint intact, no false
intermediate-order claim. Only once a partial reorder has actually
landed does it add the applied-count accounting and rerun hint, and even
then it preserves the underlying error's classification (appending the
rerun text to the original hint rather than replacing it) and wraps raw
errors with %w instead of reclassifying them as usage.
Adds regression coverage for Code/HTTPStatus preservation, original-hint
preservation, and the zero-applied single-list and bulk-first-PUT paths.
* Reject wrong-type URL args to todolists position
A pasted Basecamp URL for a different recording type (a todo, a card, or
a todolists *collection* URL) still yields a trailing numeric ID via
ExtractIDs, which — because this command mutates — would silently
reposition an unrelated todolist that happens to share that ID.
Validate any URL argument up front: it must be a non-collection
`todolists` URL, mirroring the guard todos position already applies to
its --list destination URL. Bare numeric IDs are unaffected.
* Warn of partial reorder when a transport failure interrupts a bulk run
The raw-error branch of the partial-failure path wrapped the cause with
%w and the applied-count prefix, but dropped the recovery hint entirely.
After one successful PUT followed by a transport failure (a dropped
connection, a canceled context), the operator saw the count but was
never told the todoset was left partially reordered and needs a rerun.
Return a non-usage structured error that carries the applied-count
message, the rerun/intermediate-order hint, and the raw cause (via
Cause, so errors.Is/As still unwrap). Code is api_error, never usage.
Adds a regression test that drops the connection on the second applied
PUT and asserts the non-usage code, the accounting message, the rerun
hint, the preserved cause, and that the third list is never touched.
* Reconcile SDK pin references and surface after rebase onto e2c1abea
Rebasing onto main (#554) advanced the SDK pin to e2c1abea, five commits
past the 93ace8d5 this branch first pinned. Refresh the API-COVERAGE SDK
line to the merged pin (which additionally carries create-time
visible_to_clients support) and regenerate the CLI surface so it reflects
both todolists position and main's todolists create --visible-to-clients.
Copy file name to clipboardExpand all lines: API-COVERAGE.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,17 @@ Coverage of Basecamp 3 API endpoints. Source: [bc3-api/sections](https://github.
6
6
7
7
| Status | Sections | Endpoints |
8
8
|--------|----------|-----------|
9
-
| ✅ Implemented | 43 |162|
9
+
| ✅ Implemented | 43 |163|
10
10
| ⏭️ Out of scope | 4 | 12 |
11
-
|**Total (docs)**|**47**|**174**|
11
+
|**Total (docs)**|**47**|**175**|
12
12
13
-
**100% coverage of in-scope API** (162/162 endpoints)
13
+
**100% coverage of in-scope API** (163/163 endpoints)
14
14
15
15
Out-of-scope sections are excluded from parity totals and scripts: chatbots (different auth), legacy Clientside (deprecated)
16
16
17
17
> Note: the per-row `Endpoints` column in the Coverage by Section table sums higher than the Summary totals above. The discrepancy predates the BC5 baseline; the row count (47 sections) is authoritative for the `Since` column. Reconciling endpoint counts is pre-existing maintenance, tracked separately.
18
18
19
-
**SDK version:** v0.8.0 — adds `Campfires.UpdateLine` (`PUT /chats/{c}/lines/{l}`, basecamp/basecamp-sdk#295), consumed by `chat update`; also carries the BC5 `Tools.Create` create-by-type reshape. API date advanced to 2026-07-22.
19
+
**SDK version:** v0.8.1-0.20260724184307-e2c1abea4aea — adds `Todolists.Reposition` (`PUT /todosets/todolists/{id}/position.json`, basecamp/basecamp-sdk#398), consumed by `todolists position`; also carries the create-time `visible_to_clients` support behind `todolists create --visible-to-clients`, `Campfires.UpdateLine` (`PUT /chats/{c}/lines/{l}`, basecamp/basecamp-sdk#295), consumed by `chat update`, and the BC5 `Tools.Create` create-by-type reshape. API date 2026-07-24.
20
20
21
21
## Coverage by Section
22
22
@@ -27,7 +27,7 @@ The **Since** column tags each row with the Basecamp version that introduced its
0 commit comments