Skip to content

fix(views): enable searching and fix selection flow in TUI lists#773

Open
Sypher845 wants to merge 1 commit intogoharbor:mainfrom
Sypher845:fix/selection-list-filtering
Open

fix(views): enable searching and fix selection flow in TUI lists#773
Sypher845 wants to merge 1 commit intogoharbor:mainfrom
Sypher845:fix/selection-list-filtering

Conversation

@Sypher845
Copy link
Copy Markdown
Contributor

Description

This PR fixes the interactive selection lists where the search filter was not working and the program would close too early when trying to filter.
Kooha-2026-03-26-17-08-14

Type of Change

Please select the relevant type.

  • Bug fix
  • New feature
  • Refactor
  • Documentation update
  • Chore / maintenance

Changes

  • Fixed Search: Enabled the search engine to see item names so the / filter can actually find results.
  • Fixed Selection Flow: Ensured that pressing Enter applies the filter first and only selects the item on a second press, supporting a natural "filter then select" workflow.

Signed-off-by: Sypher845 <suyashpatil845@gmail.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 7.79%. Comparing base (60ad0bd) to head (79fef67).
⚠️ Report is 119 commits behind head on main.

Files with missing lines Patch % Lines
pkg/views/base/selection/model.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             main    #773      +/-   ##
=========================================
- Coverage   10.99%   7.79%   -3.20%     
=========================================
  Files         173     270      +97     
  Lines        8671   13170    +4499     
=========================================
+ Hits          953    1027      +74     
- Misses       7612   12030    +4418     
- Partials      106     113       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@NucleoFusion NucleoFusion left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the TUI selection list behavior so users can filter items by name and don’t accidentally exit the program while applying a filter (addressing #772).

Changes:

  • Enabled Bubble List filtering by returning the item’s string value from FilterValue().
  • Adjusted Enter-key handling so Enter applies the filter first (when filtering), and only selects/quits when not in filtering mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +91 to +92
}
return m, tea.Quit
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

In the non-filtering path, the code calls tea.Quit even when SelectedItem() is nil or not of type Item (i.e., ok == false). That can still exit the TUI with an empty Choice, which upstream turns into "no ... selected" errors (e.g., when a filter yields 0 results). Consider only quitting when an item is successfully selected; otherwise keep the program running (or set an explicit abort state) so the user can adjust the filter instead of exiting with an error.

Suggested change
}
return m, tea.Quit
return m, tea.Quit
}

Copilot uses AI. Check for mistakes.
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.

[bug]: repo list filter by name doesn't work

3 participants