Skip to content

Commit 51ce8e6

Browse files
committed
Address PR review feedback on SDK commands
- Drop the duplicate webhook row in skills/fizzy/SKILL.md so the resource quick-reference table has a single consolidated entry (including the new deliveries command). - activity list "Next page" breadcrumb now preserves --board and --creator so following the suggestion keeps the user on the same filtered query instead of jumping to the unfiltered list. Added a unit test asserting the breadcrumb command shape.
1 parent cdd2ae0 commit 51ce8e6

3 files changed

Lines changed: 42 additions & 2 deletions

File tree

internal/commands/activity.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,15 @@ var activityListCmd = &cobra.Command{
8888
if activityListPage == 0 {
8989
nextPage = 2
9090
}
91-
breadcrumbs = append(breadcrumbs, breadcrumb("next", fmt.Sprintf("fizzy activity list --page %d", nextPage), "Next page"))
91+
nextCmd := []string{"fizzy", "activity", "list"}
92+
if activityListBoard != "" {
93+
nextCmd = append(nextCmd, "--board", activityListBoard)
94+
}
95+
if activityListCreator != "" {
96+
nextCmd = append(nextCmd, "--creator", activityListCreator)
97+
}
98+
nextCmd = append(nextCmd, "--page", strconv.Itoa(nextPage))
99+
breadcrumbs = append(breadcrumbs, breadcrumb("next", strings.Join(nextCmd, " "), "Next page"))
92100
}
93101

94102
printListPaginated(items, activityColumns, hasNext, linkNext, activityListAll, summary, breadcrumbs)

internal/commands/activity_test.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,39 @@ func TestActivityList(t *testing.T) {
127127
}
128128
})
129129

130+
t.Run("next-page breadcrumb preserves active filters", func(t *testing.T) {
131+
mock := NewMockClient()
132+
mock.GetWithPaginationResponse = &client.APIResponse{
133+
StatusCode: 200,
134+
Data: []any{map[string]any{"id": "1"}},
135+
LinkNext: "/activities.json?board_ids[]=board-123&creator_ids[]=user-123&page=2",
136+
}
137+
138+
result := SetTestModeWithSDK(mock)
139+
SetTestConfig("token", "account", "https://api.example.com")
140+
defer resetTest()
141+
142+
activityListBoard = "board-123"
143+
activityListCreator = "user-123"
144+
err := activityListCmd.RunE(activityListCmd, []string{})
145+
activityListBoard = ""
146+
activityListCreator = ""
147+
148+
assertExitCode(t, err, 0)
149+
150+
var nextCmd string
151+
for _, b := range result.Response.Breadcrumbs {
152+
if b.Action == "next" {
153+
nextCmd = b.Cmd
154+
break
155+
}
156+
}
157+
expected := "fizzy activity list --board board-123 --creator user-123 --page 2"
158+
if nextCmd != expected {
159+
t.Errorf("expected next breadcrumb %q, got %q", expected, nextCmd)
160+
}
161+
})
162+
130163
t.Run("requires authentication", func(t *testing.T) {
131164
mock := NewMockClient()
132165
SetTestModeWithSDK(mock)

skills/fizzy/SKILL.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ Want to change something?
113113
| notification | `notification list` | - | - | - | - | `notification tray`, `notification read-all`, `notification settings-show`, `notification settings-update` |
114114
| pin | `pin list` | - | - | - | - | `card pin NUMBER`, `card unpin NUMBER` |
115115
| webhook | `webhook list --board ID`, `webhook deliveries --board ID WEBHOOK_ID` | `webhook show ID --board ID` | `webhook create` | `webhook update ID` | `webhook delete ID` | `webhook reactivate ID` |
116-
| webhook | `webhook list --board ID` | `webhook show ID --board ID` | `webhook create` | `webhook update ID` | `webhook delete ID` | `webhook reactivate ID` |
117116

118117
---
119118

0 commit comments

Comments
 (0)