Skip to content

Apply hide and favorite to all selected sessions#203

Merged
jongio merged 1 commit into
mainfrom
idea/bulk-actions
Jul 3, 2026
Merged

Apply hide and favorite to all selected sessions#203
jongio merged 1 commit into
mainfrom
idea/bulk-actions

Conversation

@jongio

@jongio jongio commented Jul 2, 2026

Copy link
Copy Markdown
Owner

What

With one or more sessions marked using Space, the hide (h) and favorite (*) actions now apply to the whole selection instead of only the cursor session. With no selection active, both keys behave exactly as before.

Closes #196

Why

Space-selection already drives bulk launching (L), but h and * only ever touched sessionList.Selected() (the cursor row). Cleaning up a long list or starring a related group meant repeating the keystroke and re-navigating each time.

How

  • handleHideSession and handleToggleFavorite now check SelectionCount() and route to handleBulkHide / handleBulkFavorite when a selection exists.
  • Batch target state is deterministic:
    • Hide: if any selected session is currently visible, hide the whole set; otherwise unhide it.
    • Favorite: if any eligible (non-hidden) session is not a favorite, favorite the whole eligible set; otherwise unfavorite it.
  • Hidden sessions are skipped when favoriting (matching the existing single-session rule), and a bulk hide drops those sessions from favorites.
  • Config is written once per batch, and the selection is cleared after a bulk hide so hidden rows drop out.

Tests

Added unit tests in internal/tui: bulk hide, unhide when all hidden, mixed-visibility hide, favorite-removal on hide, bulk favorite, unfavorite when all favorited, and skip-hidden favorite. Existing single-session behavior is unchanged and still covered.

  • go build ./..., go vet ./..., go test ./... -count=1, golangci-lint run, and gofumpt -l . all clean.

@jongio jongio self-assigned this Jul 2, 2026
@jongio jongio added the idea Feature idea from the idea pipeline label Jul 2, 2026
Space-selection already drives bulk launching. Route the hide (h) and
favorite (*) actions through the same marked set so a whole selection can
be hidden or starred in one keystroke. With no selection, both keys still
act on the cursor session.

Batch target state is deterministic: hide the set if any member is
visible (else unhide), favorite the eligible set if any member is not a
favorite (else unfavorite). Hidden sessions are skipped when favoriting,
and a bulk hide drops those sessions from favorites. Config is written
once per batch.

Closes #196

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jongio jongio force-pushed the idea/bulk-actions branch from 719470c to 7a922a7 Compare July 3, 2026 02:58
@jongio jongio merged commit 0ac4f83 into main Jul 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

idea Feature idea from the idea pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apply hide and favorite to all multi-selected sessions

1 participant