Skip to content

Fix dock ordering and add --all flag to projects show#333

Merged
jeremy merged 2 commits intomainfrom
fix-dock-position-ordering
Mar 18, 2026
Merged

Fix dock ordering and add --all flag to projects show#333
jeremy merged 2 commits intomainfrom
fix-dock-position-ordering

Conversation

@robzolkos
Copy link
Copy Markdown
Collaborator

@robzolkos robzolkos commented Mar 16, 2026

Summary

  • Sort dock items by their position field so the output matches the order configured in the Basecamp web UI
  • Fixed formatDock to accept []map[string]any (produced by NormalizeData) and json.Number position values — previously the function silently returned empty and fell through to a generic unsorted renderer
  • Add --all flag to include disabled dock tools annotated with [disabled], consistent with how todos list handles completed items

The dock listing was rendered in API response order, which doesn't match
the order configured in the Basecamp web UI. The API returns a position
field on each dock item but formatDock wasn't using it.

Two fixes: accept []map[string]any (produced by NormalizeData) in
addition to []any, and handle json.Number position values from
UseNumber() decoding. Items without a position sort to the end.
@robzolkos robzolkos requested a review from a team as a code owner March 16, 2026 12:31
Copilot AI review requested due to automatic review settings March 16, 2026 12:31
@github-actions github-actions bot added tests Tests (unit and e2e) output Output formatting and presentation labels Mar 16, 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 2 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

Updates the projects show presentation logic so project dock tools render in the same order as configured in the Basecamp web UI, and fixes formatDock handling for normalized JSON data shapes.

Changes:

  • Sort dock items by their position field (stable) when rendering formatDock.
  • Extend formatDock to accept []map[string]any (as produced by NormalizeData) in addition to []any.
  • Add tests covering position sorting, missing positions, and json.Number position handling.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/presenter/format.go Accepts normalized dock slices and sorts enabled dock items by position.
internal/presenter/format_test.go Adds unit tests validating sorting behavior and accepted input types.

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

You can also share your feedback on Copilot code review. Take the survey.

By default only enabled dock tools are shown, matching the Basecamp web
UI. The new --all flag surfaces disabled tools annotated with [disabled]
for discoverability, consistent with how todos list handles completed
items.

Disabled items without a position sort after enabled items.
@robzolkos robzolkos changed the title Sort dock items by position in projects show Fix dock ordering and add --all flag to projects show Mar 16, 2026
@github-actions github-actions bot added commands CLI command implementations enhancement New feature or request labels Mar 16, 2026
@robzolkos robzolkos requested a review from jeremy March 16, 2026 12:58
@jeremy jeremy merged commit cb7956f into main Mar 18, 2026
26 checks passed
@jeremy jeremy deleted the fix-dock-position-ordering branch March 18, 2026 17:31
jeremy added a commit to brianevanmiller/basecamp-cli that referenced this pull request Mar 18, 2026
…evanmiller/feature-gap-analysis

* origin/main:
  Show full content in detail views instead of truncating at 40 chars (basecamp#338)
  Switch CODEOWNERS from sip to cli team (basecamp#346)
  Fix dock ordering and add --all flag to `projects show` (basecamp#333)
  Add file upload command to SKILL.md (basecamp#343)
  Replace "pending" with "incomplete" in todos output; omit from default view (basecamp#327)
  Add `--in` as global alias for `--project` (basecamp#334)
  Fix 3 post-QA issues on api command (basecamp#330)
  deps: bump the go-dependencies group with 2 updates (basecamp#331)
  Improve tool instance disambiguation format (basecamp#329)
  Fix emoji/CJK alignment in search results (basecamp#328)
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 output Output formatting and presentation tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants