Skip to content

Conversation

@sei40kr
Copy link

@sei40kr sei40kr commented Dec 10, 2025

Summary

This PR adds an interactive fuzzy finder picker component for branch and commit selection:

  • Fuzzy matching with real-time filtering
  • Keyboard navigation (↓/↑, Ctrl-n/p)
  • Select/Cancel with Enter/Esc/Ctrl-c
  • Visual highlighting of matched characters

Implementation Details

  • New picker module with fuzzy matching logic
  • ui/picker for rendering the picker interface
  • Configurable keybinds and styling via config.toml
  • Test coverage for core picker functionality

Test Plan

  • Unit tests (only for state)

🤖 Generated with Claude Code

@sei40kr
Copy link
Author

sei40kr commented Dec 10, 2025

Since app.rs has become quite complex, it might be a good idea to adopt ratatui's component pattern.

layout_span(layout, (state.prompt_text.as_ref().into(), prompt_style));
layout_span(layout, (" › ".into(), Style::new().cyan().dim()));
layout_span(layout, (state.input_state.value().into(), Style::new()));
layout_span(layout, (CARET.into(), Style::new()));
Copy link
Author

Choose a reason for hiding this comment

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

I want to change the caret shape to indicate that it is in input mode.

@sei40kr sei40kr force-pushed the feat/interactive-picker branch 2 times, most recently from 305af73 to f0d61e0 Compare December 11, 2025 14:17
@sei40kr sei40kr changed the title feat: add interactive picker for branch and commit selection feat: add interactive picker Dec 11, 2025
@sei40kr sei40kr marked this pull request as ready for review December 11, 2025 14:29
@sei40kr sei40kr force-pushed the feat/interactive-picker branch 2 times, most recently from 1cb919e to cc0754c Compare December 11, 2025 14:31
@sei40kr
Copy link
Author

sei40kr commented Dec 11, 2025

Testing Note

This PR adds the picker component itself, but it's not integrated into any operations yet. To test the picker functionality in action, please check out #470 which converts branch operations to use this picker:

gh pr checkout 470
cargo run

Then try branch operations like:

  • b b - Checkout branch (uses picker)
  • b x - Delete branch (uses picker)

You'll be able to see the fuzzy filtering, navigation, and selection in action.

Implement an interactive fuzzy finder picker component:
- Fuzzy matching with real-time filtering
- Keyboard navigation (↓/↑, Ctrl-n/p)
- Select with Enter, cancel with Esc/Ctrl-c
- Visual highlighting of matched characters

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@sei40kr sei40kr force-pushed the feat/interactive-picker branch from cc0754c to 948ad2d Compare December 12, 2025 02:59
@altsem
Copy link
Owner

altsem commented Dec 12, 2025

I just wanted to leave some answer at least. I'm a bit busy with other things, but I think this (and the search functionality too) are nice additions to Gitu. I'll try find some time to review and test this properly soon

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