Skip to content

Add pagination notice when search results are truncated#314

Merged
jeremy merged 2 commits intomainfrom
bc-9679134419
Mar 16, 2026
Merged

Add pagination notice when search results are truncated#314
jeremy merged 2 commits intomainfrom
bc-9679134419

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 16, 2026

Summary

  • Add --all flag to basecamp search, matching the pattern every other list command uses
  • Wire searchResult.Meta.TotalCount to output.TruncationNoticeWithTotal so truncated results show "Showing X of Y results (use --all for complete list)"
  • Update --limit help text (remove stale "0 = all" now that --all exists)
  • Update .surface snapshot for the new flag

Test plan

  • TestSearchTruncationNoticePresent — mock transport returns 5 results with TotalCount=20, assert envelope notice contains "Showing 5 of 20"
  • TestSearchNoTruncationNotice — 5 results with TotalCount=5, assert no notice
  • TestSearchAllAndLimitMutuallyExclusive--all --limit 5 returns usage error
  • Surface snapshot updated, skill drift check passes
  • make test and make test-e2e pass

jeremy added 2 commits March 15, 2026 18:52
Search silently truncated results when --limit was set, unlike every
other list command. Wire up the existing SDK Meta.TotalCount to
output.TruncationNoticeWithTotal so users see "Showing X of Y results"
when results are truncated. Add --all flag for fetching everything,
matching the pattern used by todos, recordings, and other list commands.
Update --limit help text now that --all exists.
Test the search command end-to-end with a mock HTTP transport that
returns configurable result counts and X-Total-Count headers. Covers
truncation notice appearing in the JSON envelope when results are
truncated, absence of notice when all results fit, and --all/--limit
mutual exclusivity error.
@jeremy jeremy requested a review from a team as a code owner March 16, 2026 01:58
Copilot AI review requested due to automatic review settings March 16, 2026 01:58
@github-actions github-actions bot added commands CLI command implementations tests Tests (unit and e2e) enhancement New feature or request 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 3 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 better UX for basecamp search pagination by introducing an --all flag and surfacing a truncation notice when the API reports more results exist than were returned.

Changes:

  • Add --all flag to basecamp search and make it mutually exclusive with --limit.
  • Include truncation notice via output.TruncationNoticeWithTotal(len(results), searchResult.Meta.TotalCount) in the search response envelope.
  • Add tests for truncation notice behavior and update .surface snapshot for the new flag.

Reviewed changes

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

File Description
internal/commands/search.go Adds --all, mutual exclusivity with --limit, and truncation notice wiring using API total count.
internal/commands/search_test.go Introduces tests validating truncation notice presence/absence and flag exclusivity.
.surface Updates surface snapshot to include the new basecamp search --all flag.

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

Comment thread internal/commands/search_test.go
Comment thread internal/commands/search.go
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6daf960802

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/commands/search.go
@jeremy jeremy merged commit a7a6e26 into main Mar 16, 2026
30 checks passed
@jeremy jeremy deleted the bc-9679134419 branch March 16, 2026 05:17
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 tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants