gitbutlerapp/gitbutler · critical
no searchable columns
Error message
no searchable columns
What it means
A developer panic in the fuzzy picker renderer: `render` assumes every item row exposes at least one searchable column and calls `.expect("no searchable columns")` on the first row's column metadata. If the item type's `columns(SearchableToken(()))` implementation returns no column with `searchable.is_some()`, the picker cannot filter and panics.
Solutions
- Fix the item's `columns(SearchableToken(()))` implementation so at least one column returns `searchable: Some(...)`.
- Add a unit test asserting every picker item type yields a searchable column.
- Check recent changes to the specific picker's item struct — this panic appears immediately after such edits.
- As a hardening measure, validate the items list when constructing the picker instead of panicking during render.
Example fix
// before
impl TableData for MyItem {
fn columns(&self, _: SearchableToken(())) -> impl IntoIterator<Item = Column<MyItem, ()>> {
[Column::new("Name", self.name.clone())] // no searchable marker
}
}
// after
[Column::new("Name", self.name.clone()).searchable(|item| item.name.clone())] Defensive patterns
Strategy: validation
Validate before calling
fn validate_searchable<T: TableData>(items: &[T]) -> bool {
items.first().map_or(true, |it| {
it.columns(SearchableToken(())).into_iter().any(|c| c.searchable.is_some())
})
} Prevention
- Always mark at least one column searchable in every picker item's `columns()` impl.
- Add a unit test that every picker item type yields a searchable column.
- Validate the picker configuration at construction time, not during render.
When it happens
Trigger: Opening/refreshing the fuzzy picker with an item list whose `SearchableToken` column implementation defines no searchable column — typically after adding a new picker item type or modifying an existing `columns()` impl and forgetting to mark a column searchable.
Common situations: A newly added picker mode (e.g. new command or branch list) whose column definitions omit `searchable: Some(...)`; a refactor that changed column ordering or dropped the searchable marker; empty/placeholder items with zero columns.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- line should have been highlighted by now
- anchor is always present in the order at this point
- commits cannot be moved to the merge base
- FuzzyPickerItem::columns must return a searchable column
- prefiltered
AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18).
Data as JSON: /api/errors/15e71be450e6bb37.
Report an issue: GitHub.
Appendix: source
Thrown at crates/but/src/command/legacy/status/tui/fuzzy_picker.rs:118
let input_height: u16 = 1;
let col_widths = self
.items
.iter()
.map(|item| item.columns(SearchableToken(())))
.map(|cols| {
cols.into_iter()
.map(|col| col.text.width())
.collect::<Vec<_>>()
})
.collect::<Vec<_>>();
// assume the searchable column is at the same index on every row
let searchable_col_idx = self.items[0]
.columns(SearchableToken(()))
.into_iter()
.position(|col| col.searchable.is_some())
.expect("no searchable columns");
// assume each row contains the same number of columns
let num_cols = col_widths[0].len();
let column_spacing = 2;
let mut col_constraints = (0..num_cols)
.map(|n| col_widths.iter().map(|c| &c[n]).collect::<Vec<_>>())
.map(|col| col.iter().copied().max().unwrap())
.map(|&width| Constraint::Length(width as u16))
.collect::<Vec<_>>();
for (i, constraint) in col_constraints.iter_mut().enumerate() {
if i == searchable_col_idx {
*constraint = Constraint::Min(1);
break;
}
}
View on GitHub (pinned to 58e5313667)