Skip to content

fix: show copy-pasteable command in pagination hint#76

Open
devinscodebase wants to merge 7 commits intoresend:mainfrom
devinscodebase:fix/improve-pagination-output
Open

fix: show copy-pasteable command in pagination hint#76
devinscodebase wants to merge 7 commits intoresend:mainfrom
devinscodebase:fix/improve-pagination-output

Conversation

@devinscodebase
Copy link
Contributor

@devinscodebase devinscodebase commented Mar 13, 2026

Closes #19

Before:

More results available. Use --after f4db806f-adcf-471a-a38d-f447b692b783 to fetch the next page.

After:

Fetch the next page:
$ resend broadcasts list --after f4db806f-adcf-471a-a38d-f447b692b783

printPaginationHint now takes a command string so it can print a
copy-pasteable command. Updated all 9 paginated list commands.


Summary by cubic

Show a copy-pasteable next-page command in pagination hints, preserving --limit and choosing --before or --after based on direction; applied to all nine list commands.

printPaginationHint(list, command, { limit, before }) now prints “Fetch the next page:” with $ resend <command> --before|--after <id> using the correct cursor.

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

Copy link

@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.

2 issues found across 10 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/commands/emails/receiving/attachments.ts">

<violation number="1" location="src/commands/emails/receiving/attachments.ts:63">
P2: Pagination hint command drops the user-selected `--limit`, so the advertised copy-paste next-page command can change result pagination.</violation>
</file>

<file name="src/commands/emails/receiving/list.ts">

<violation number="1" location="src/commands/emails/receiving/list.ts:54">
P2: Pagination hint advertises a copy-paste command but drops invocation flags (e.g., `--limit` and global options), so the next-page command may not continue the same request context.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link

@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.

3 issues found across 10 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/commands/emails/list.ts">

<violation number="1" location="src/commands/emails/list.ts:79">
P2: Pagination hint always uses `--after` even when the list was paged with `--before`, so the copy‑pasteable command can switch direction and return the wrong page.</violation>
</file>

<file name="src/commands/emails/receiving/list.ts">

<violation number="1" location="src/commands/emails/receiving/list.ts:54">
P2: Pagination hint always emits `--after` with the last item, so when a user paginates using `--before`, the copy‑paste command is incorrect because the helper is not told the current direction.</violation>
</file>

<file name="src/commands/broadcasts/list.ts">

<violation number="1" location="src/commands/broadcasts/list.ts:55">
P3: Pagination hint always prints a forward `--after <last-id>` command. When the user paged backward with `--before`, the helper has no cursor-direction context and will suggest the wrong command; backward pagination should use `before` with the first item ID.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve pagination output

1 participant