Skip to content

Add --position flag to cards move#298

Merged
jeremy merged 3 commits intomainfrom
bc-9664129282
Mar 15, 2026
Merged

Add --position flag to cards move#298
jeremy merged 3 commits intomainfrom
bc-9664129282

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 15, 2026

Summary

  • Adds --position (alias --pos) flag to basecamp cards move for placing a card at a specific position within the target column (1-indexed)
  • Positioned moves use the CardColumns().Move endpoint (POST /card_tables/{id}/moves.json) with card-as-source, column-as-target; unpositioned moves use the existing Cards().Move path unchanged
  • When --position is used with a numeric --to column ID, the card table is auto-resolved (single table) or an ambiguous error guides the user to provide --card-table

Test plan

  • TestCardsMovePositionPayload — transport-backed test verifies CLI sends {source_id, target_id, position} to /card_tables/{id}/moves.json
  • TestCardsMoveWithoutPositionUsesCardsMove — transport-backed test verifies old path /card_tables/cards/{id}/moves.json with {column_id} when --position absent
  • TestCardsMovePositionRejectsNonPositive — validates --position -1
  • TestCardsMovePositionRejectsZero — validates --position 0
  • TestCardsMovePositionNumericToMultiTableAmbiguous — multi-table + no --card-table returns ambiguous error
  • Smoke e2e test: cards move with position moves card to position
  • bin/ci passes (all checks including skill drift)
  • Manual validation against live BC3 API that the moves endpoint accepts card-as-source, column-as-target (transport tests prove CLI contract, not API acceptance)

Summary by cubic

Adds a --position flag to basecamp cards move to place a card at a specific position in the target column. When omitted, existing move behavior is unchanged.

  • New Features
    • --position (alias --pos) sets 1-indexed position in the target column.
    • Positioned moves use CardColumns().Move (POST /card_tables/{id}/moves.json) with {source_id, target_id, position}; otherwise uses existing Cards().Move.
    • For positioned moves with numeric --to, auto-resolves the card table; errors if multiple tables and no --card-table.
    • Validates --position > 0 and includes position in JSON output and CLI summary.
    • Updated .surface, e2e smoke test, and skills/basecamp/SKILL.md.

Written for commit ea7857e. Summary will update on new commits.

@jeremy jeremy requested a review from a team as a code owner March 15, 2026 19:33
Copilot AI review requested due to automatic review settings March 15, 2026 19:33
@github-actions github-actions bot added commands CLI command implementations tests Tests (unit and e2e) skills Agent skills enhancement New feature or request labels Mar 15, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 6 files

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds optional positional placement for basecamp cards move so users can move a card into a specific index within the target column, while preserving the existing move behavior when no position is requested.

Changes:

  • Add --position / --pos to basecamp cards move and route positioned moves through the card table moves endpoint.
  • Extend unit tests with transport-backed coverage for positioned vs unpositioned move request contracts and for multi-table ambiguity.
  • Update skill docs, smoke tests, allowlist, and surface snapshot to reflect the new flags and example usage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
skills/basecamp/SKILL.md Documents cards move with optional --position and adds examples.
internal/commands/cards.go Implements --position/--pos and switches endpoint/payload when set.
internal/commands/cards_test.go Adds transport-backed tests for positioned payload, legacy path, validation, and ambiguity.
e2e/smoke/smoke_cards_write.bats Adds a smoke test covering cards move --position.
e2e/smoke/.qa-allowlist Allowlists the new smoke test as unverifiable in some environments.
.surface Updates CLI surface snapshot to include the new flags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jeremy added 3 commits March 15, 2026 12:41
Allow placing a card at a specific position within the target column.
Uses the card_tables moves endpoint (CardColumns().Move) with the card
as source_id and the column as target_id. When --position is absent,
the existing Cards().Move path is unchanged.

Includes transport-backed tests proving the CLI request contract,
validation tests for non-positive values, a multi-table ambiguity
test, and a smoke e2e test.
@jeremy jeremy merged commit 6a5de0f into main Mar 15, 2026
25 checks passed
@jeremy jeremy deleted the bc-9664129282 branch March 15, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands CLI command implementations enhancement New feature or request skills Agent skills tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants