feat(command-palette): add fuzzy model/provider filtering, expose ModelPaletteEntry, and show active model with provider in UI header
- Introduce `ModelPaletteEntry` and re‑export it for external use. - Extend `CommandPalette` with dynamic sources (models, providers) and methods to refresh suggestions based on `:model` and `:provider` prefixes. - Implement fuzzy matching via `match_score` and subsequence checks for richer suggestion ranking. - Add `provider` command spec and completions. - Update UI to display “Model (Provider)” in the header and use the new active model label helper. - Wire catalog updates throughout `ChatApp` (model palette entries, command palette refresh on state changes, model picker integration).
This commit is contained in:
@@ -504,12 +504,9 @@ fn render_header(frame: &mut Frame<'_>, area: Rect, app: &ChatApp) {
|
||||
.fg(theme.focused_panel_border)
|
||||
.add_modifier(Modifier::BOLD),
|
||||
);
|
||||
let provider_span = Span::styled(
|
||||
app.current_provider().to_string(),
|
||||
Style::default().fg(theme.text),
|
||||
);
|
||||
let model_span = Span::styled(
|
||||
app.selected_model().to_string(),
|
||||
let model_label = app.active_model_label();
|
||||
let model_with_provider_span = Span::styled(
|
||||
format!("{} ({})", model_label, app.current_provider()),
|
||||
Style::default()
|
||||
.fg(theme.user_message_role)
|
||||
.add_modifier(Modifier::BOLD),
|
||||
@@ -527,11 +524,8 @@ fn render_header(frame: &mut Frame<'_>, area: Rect, app: &ChatApp) {
|
||||
Line::default(),
|
||||
Line::from(vec![
|
||||
Span::raw(" "),
|
||||
Span::styled("Provider: ", Style::default().fg(theme.placeholder)),
|
||||
provider_span,
|
||||
Span::raw(" "),
|
||||
Span::styled("Model: ", Style::default().fg(theme.placeholder)),
|
||||
model_span,
|
||||
Span::styled("Model (Provider): ", Style::default().fg(theme.placeholder)),
|
||||
model_with_provider_span,
|
||||
]),
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user