fix(gh): show fallback note for filtered body; fix api truncation message#235
Open
polaminggkub-debug wants to merge 1 commit intortk-ai:masterfrom
Open
Conversation
Two fixes in gh_cmd.rs:
1. view_pr() and view_issue(): when filter_markdown_body() returns an
empty string (body contained only badges, images, or HTML comments),
the body was silently skipped. Now shows a note so the user knows
content existed but was filtered.
2. run_api() non-JSON fallback: replaced naive .take(20) + double
iteration with a single pass that shows line count in the truncation
message ("... N more lines"), consistent with the rest of the module.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Problems
Two related issues in `gh_cmd.rs`, same category as the body-display fix from #214.
1. Silent body loss in `view_pr()` and `view_issue()`
When `filter_markdown_body()` removes all content (body contains only badges, images, or HTML comments), the body section is silently skipped — no output, no indication that content existed.
Example body that disappears completely:
```markdown
```
The user sees PR metadata but has no way to know a body was present and filtered.
Fix: Show `(body contained only badges/images/comments)` so the user is aware.
2. Naive `.take(20)` with double iteration in `run_api()`
The non-JSON fallback in `run_api()` used the same naive truncation pattern that #214 fixed for `view_pr`:
Fix: Single pass, message shows exact count: `"... N more lines (use gh api for full output)"`, consistent with `list_prs()` and the rest of the module.
Testing
All 412 existing tests pass.
🤖 Generated with Claude Code