Fix dock ordering and add --all flag to projects show#333
Merged
Conversation
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.
There was a problem hiding this comment.
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
positionfield (stable) when renderingformatDock. - Extend
formatDockto accept[]map[string]any(as produced byNormalizeData) in addition to[]any. - Add tests covering position sorting, missing positions, and
json.Numberposition 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.
projects showprojects show
jeremy
approved these changes
Mar 18, 2026
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
positionfield so the output matches the order configured in the Basecamp web UIformatDockto accept[]map[string]any(produced byNormalizeData) andjson.Numberposition values — previously the function silently returned empty and fell through to a generic unsorted renderer--allflag to include disabled dock tools annotated with[disabled], consistent with howtodos listhandles completed items