Skip to content

feat(tb-pr): hide drafts in waiting-on-me/author by default, Shift+D toggle#31

Merged
FilipBuhinicek merged 2 commits into
mainfrom
tb-pr-hide-drafts-toggle
May 11, 2026
Merged

feat(tb-pr): hide drafts in waiting-on-me/author by default, Shift+D toggle#31
FilipBuhinicek merged 2 commits into
mainfrom
tb-pr-hide-drafts-toggle

Conversation

@FilipBuhinicek
Copy link
Copy Markdown
Contributor

Summary

  • GitHub's user-review-requested:@me search keeps a PR in the result set even after the author converts it back to draft, so reviewers were seeing WIP cards they shouldn't act on yet. Discussed in Slack with @ilucin — drafts get filtered, with a session toggle.
  • Hide PRs in PrState::Draft from Waiting-on-me and Waiting-on-author by default. DraftMine is unaffected (it exists for drafts).
  • New keybind Shift+D toggles the filter for the current session. Footer hint reflects current state (D=show-drafts / D=hide-drafts), column title shows (N, K draft hidden) so the filter isn't invisible.

Implementation

  • App.hide_drafts: bool (defaults to true).
  • App::visible_prs(col) and App::hidden_draft_count(col) filter on the fly — only WaitingOnMe / WaitingOnAuthor are touched.
  • All rendering, navigation, selection clamping, and selected_pr now go through visible_prs.
  • Toggle resets scroll and clamps selections so we never index past the end of a now-shorter column.

Test plan

  • cargo test --workspace — all green (new tests: filter scope, key toggle resets scroll, clamping after toggling filter on).
  • cargo clippy --workspace -- -D warnings
  • cargo fmt --check
  • Manually run tb-pr tui and verify: a draft PR in Waiting-on-me is hidden by default, column shows (N, 1 draft hidden), Shift+D toggles visibility, footer label flips.

Slack context: thread in DM with @ilucin (2026-05-08 → 2026-05-11). Default chosen "hidden" to fix the originally reported behavior out of the box.

FilipBuhinicek and others added 2 commits May 11, 2026 08:28
…toggle

GitHub's `user-review-requested:@me` search keeps PRs in the list even
after the author converts them back to draft, so reviewers see WIP
cards they shouldn't be acting on yet. Hide drafts from
`waiting_on_me` and `waiting_on_author` by default, and bind Shift+D
to toggle them back on per session. `DraftMine` is unaffected — it
exists for drafts. Column title shows `(N, K draft hidden)` and the
footer surfaces the current toggle state so the filter isn't silent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ndler

Strip multi-line doc comments off `hide_drafts` and `hidden_draft_count`
to match the existing `full_titles` / `help_open` style (no docs on
simple state). Keep one short comment on `visible_prs` for the WHY of
not filtering `DraftMine`. Rework the clamp test to flip the filter via
the `D` key handler instead of writing to the field directly, so the
test exercises the public surface end-to-end.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@FilipBuhinicek FilipBuhinicek marked this pull request as ready for review May 11, 2026 06:41
@FilipBuhinicek FilipBuhinicek marked this pull request as draft May 11, 2026 06:42
@FilipBuhinicek
Copy link
Copy Markdown
Contributor Author

Filter sam postavio da je defaultno ukljucen

image

Kad ga se iskljuci (Vracanje u staro ponasanje)

image

@FilipBuhinicek FilipBuhinicek marked this pull request as ready for review May 11, 2026 06:54
@FilipBuhinicek FilipBuhinicek merged commit 93f52a1 into main May 11, 2026
1 check passed
@FilipBuhinicek FilipBuhinicek deleted the tb-pr-hide-drafts-toggle branch May 11, 2026 07:01
@FilipBuhinicek FilipBuhinicek mentioned this pull request May 11, 2026
1 task
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