Skip to content

Conversation

@tOgg1
Copy link
Owner

@tOgg1 tOgg1 commented Dec 7, 2025

  • Add --stack/-s flag to review all PRs in a stack with h/l navigation
  • Refactor TUI to use callbacks for copy operations (no exit on copy)
  • Show status feedback when copying to clipboard
  • Display PR title and navigation hints in header
  • Fix help text to document C for raw copy vs c/y for LLM format

ztk-id: 43eabb95-282d-40d5-96db-5ef79f59e7da


Note

Adds --stack/-s to review all PRs in a stack with PR navigation and refactors the TUI to use copy callbacks with inline status feedback.

  • Review CLI (cmdReview):
    • Add --stack/-s to fetch and display feedback for all PRs in the stack; navigate PRs with h/l or arrow keys.
    • Support single PR mode via --pr/-p and default current-branch PR; --list prints summaries non-interactively.
    • New shared TUI flow: runReviewTUISingle and list printer printReviewList.
  • TUI (tui.zig):
    • Refactor runInteractive(...) to accept a copy_callback, optional prs list, current PR index, and pr_change_callback; remove Action return enum.
    • Add PRInfo and renderWithPRNav to show PR header, navigation hints, and status messages; keep session open on copy (c/y for LLM, C for raw).
    • Minor layout tweaks (visible height calculation).
  • State/Plumbing:
    • Introduce ReviewTUIState to manage allocator-backed lists, PR context, and shared builders (buildItemsForSummary, prChangeCallback, copyCallback).
  • Help/Docs:
    • Update usage text and examples to document --stack and copy keybindings.

Written by Cursor Bugbot for commit 1275e92. This will update automatically on new commits. Configure here.

- Add --stack/-s flag to review all PRs in a stack with h/l navigation
- Refactor TUI to use callbacks for copy operations (no exit on copy)
- Show status feedback when copying to clipboard
- Display PR title and navigation hints in header
- Fix help text to document C for raw copy vs c/y for LLM format

ztk-id: 43eabb95-282d-40d5-96db-5ef79f59e7da
@tOgg1 tOgg1 force-pushed the ztk/review-tui-improvements/43eabb95 branch from ccaf1f7 to 1275e92 Compare December 7, 2025 16:09
// Track which PR is "current" (top of stack)
if (idx == stk.commits.len - 1) {
current_pr_index = ReviewTUIState.pr_summaries.items.len - 1;
}
Copy link

Choose a reason for hiding this comment

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

Bug: Stack mode starts at wrong PR when top commit skipped

In stack mode, current_pr_index is only updated when idx == stk.commits.len - 1, meaning it only works if the absolute last commit in the stack has a valid open PR. If the top commit is WIP, has no PR, or has a closed PR, current_pr_index remains 0 (the bottom PR) instead of pointing to the topmost valid PR. This causes users to start navigating from the wrong PR in the stack when the top commit is skipped for any reason.

Fix in Cursor Fix in Web

if (copy_callback) |cb| {
cb(list.selected, false);
status_msg = "Copied to clipboard (raw)";
}
Copy link

Choose a reason for hiding this comment

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

Bug: Clipboard success message shown when nothing copied

When the user presses c, y, or C to copy, the status message "Copied to clipboard" is set unconditionally after calling copy_callback. However, if there are no feedback items (empty list), copyCallback returns early without copying anything, but the TUI still displays the success message. This gives misleading feedback to users that content was copied when nothing actually was.

Fix in Cursor Fix in Web

@tOgg1 tOgg1 closed this Dec 7, 2025
@tOgg1 tOgg1 deleted the ztk/review-tui-improvements/43eabb95 branch December 7, 2025 16:43
@tOgg1 tOgg1 restored the ztk/review-tui-improvements/43eabb95 branch December 7, 2025 18:34
@tOgg1 tOgg1 reopened this Dec 7, 2025
current_items = new_items;
list = ListView.init(current_items, visible_height);
}
}
Copy link

Choose a reason for hiding this comment

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

Bug: PR index updated before callback success check

The current_pr_index is modified before checking if pr_change_callback returns valid items. If the callback returns null (e.g., due to a bounds check failure at line 1607 in cli.zig), the index remains changed while current_items and list are not updated. This causes a mismatch where renderWithPRNav displays the header for the new PR index but the list still shows items from the previous PR.

Additional Locations (2)

Fix in Cursor Fix in Web

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.

2 participants