Skip to content

Conversation

@webmatze
Copy link
Owner

@webmatze webmatze commented Aug 22, 2025

Summary

Extends the existing search and filter functionality (currently available for installed models via /) to the
installable models list when using the install feature (i key). Users can now search and filter through the Ollama
registry models during installation, making it much easier to find specific models.

Changes Made

Core Functionality

  • New App Mode: Added InstallSelectModelFilter mode for handling filter input during model installation
  • Registry Filter State: Extended AppState with registry-specific filter fields:
    • filtered_registry_models: Vec
    • registry_filter_input: String
    • is_registry_filtered: bool
    • registry_filter_cursor_pos: usize

Key Features

  • Unified Filter System: Consistent filtering experience between installed and registry models
  • Real-time Search: Filter updates as you type, with immediate visual feedback
  • Filter Persistence: Filter state maintained during registry model browsing
  • Visual Indicators: Shows filtered count in dialog title (filtered: X/Y models)

User Interface

  • Filter Input: Dedicated filter input area with cursor visualization
  • Status Messages: Clear feedback about filter state and results
  • Help Integration: Updated help screen with install mode filter instructions

Usage

  1. Press i to enter install mode
  2. Press / to start filtering registry models
  3. Type to search/filter models in real-time
  4. Use standard navigation:
    - Enter: Confirm filter and return to model selection
    - Esc: Cancel filter and clear it
    - Ctrl+C: Clear current filter input
    - Arrow keys: Navigate cursor in filter input
  5. Navigate filtered results with ↑/↓ or j/k
  6. Select model and proceed with installation as before

Technical Implementation

Files Modified

  • src/app.rs (+89 lines): Registry filter state and methods
  • src/handlers.rs (+70 lines): Key handling for registry filter mode
  • src/ui.rs (+80 lines): UI rendering for registry filter input and updated dialogs

Key Methods Added

  • get_current_registry_models(): Returns filtered or full registry model list
  • apply_registry_filter(): Applies current filter to registry models
  • clear_registry_filter(): Resets registry filter state
  • registry_filter_input_char(): Handles character input for filter
  • registry_filter_input_backspace(): Handles backspace in filter input

Testing

  • ✅ Builds successfully with cargo build --release
  • ✅ All existing functionality preserved
  • ✅ Filter behavior consistent with installed models filter
  • ✅ No breaking changes to existing workflows

Demo

The filter functionality mirrors the existing installed models filter:

  • Enter filter mode with /
  • Real-time filtering as you type
  • Visual cursor in input field
  • Clear filter state indicators

@webmatze webmatze changed the title Adds filter to install model screen Add Search/Filter Functionality to Installable Models Aug 22, 2025
@webmatze webmatze self-assigned this Aug 22, 2025
@webmatze webmatze added the enhancement New feature or request label Aug 22, 2025
@webmatze webmatze requested a review from Copilot August 22, 2025 00:32

This comment was marked as outdated.

@webmatze webmatze requested a review from Copilot August 22, 2025 09:11
Copy link
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 adds search/filter functionality to the installable models list when using the install feature, extending the existing filter capabilities that were previously only available for installed models. This makes it much easier for users to find specific models when browsing the Ollama registry.

Key changes:

  • Added new InstallSelectModelFilter app mode for handling filter input during model installation
  • Extended AppState with registry-specific filter fields and methods
  • Added comprehensive key handling for registry model filtering with real-time search

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/app.rs Adds registry filter state fields and methods for applying, clearing, and managing filter input
src/handlers.rs Implements key event handling for registry filter mode with navigation and input management
src/ui.rs Updates UI to display filter input area and filtered model counts in install dialogs

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@webmatze webmatze merged commit 08f5a68 into main Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants