Skip to content

Conversation

@valentynkt
Copy link

Summary

Add optional configuration to display starred panes at the top of the picker list, improving navigation for users who actively use the
starring feature.

Changes

  • Add show_starred_first boolean configuration option (default: false)
  • Implement two-tier sorting: starred status, then fuzzy match score
  • Preserve selection when list re-sorts after toggling stars
  • Add comprehensive test coverage (5 new tests)
  • Update README.md with configuration documentation

Technical Details

  • Config parsing: Safe defaults with .unwrap_or(false)
  • Performance: O(n log n) stable sort with O(1) starred lookups (IndexSet)
  • Selection stability: Tracked by pane ID, not index
  • Edge cases: Defensive check for empty display_panes

Backward Compatibility

Disabled by default (show_starred_first: false) to preserve existing behavior.

Closes #50

CleanShot.2025-11-16.at.22.24.52.mp4

valentynkt and others added 2 commits November 16, 2025 21:39
Add optional configuration to display starred panes at the top of the
picker list, improving navigation for users who actively use starring.

Features:
- Add show_starred_first boolean config (default: false for backward compatibility)
- Implement conditional sorting: starred status first, then fuzzy match score
- Add selection preservation when list re-sorts after star toggle
- Add defensive check for empty display_panes edge case
- Include comprehensive test coverage (5 new tests, 38 total passing)
- Update README.md with configuration documentation

Technical details:
- Config parsing with safe defaults (.unwrap_or(false))
- Stable sort preserves fuzzy match ordering within groups
- O(n log n) sorting with O(1) starred status checks via IndexSet
- Selection tracked by pane ID, not index, for stability

Closes shihanng#50

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@shihanng
Copy link
Owner

@valentynkt Hi, thank you for the PR and opening the issue 💜. I played a bit with this PR. But I am not sure if this is a behavior that I can agree on 🤔.

I agree that it will be convenient to allow the option to show starred panes first when showing the full list of panes at the beginning. However, when the user starts searching, we should not prioritize the starred panes because as the user, I would expect the pane that matches my search keyword the best should show up on top regardless of the star status.

Preserve selection when list re-sorts after toggling stars

I also don't quite understand the benefit of this feature. As a user, when I start typing to search, usually I don't care anymore about the current selection mainly because whatever that I am selecting right now is not what I want. Preserving the selected row seems distracting.

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