Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@therealtinhtute
Copy link
Contributor

No description provided.

Replace simple numbered menu with fzf fuzzy finder for dramatically
improved package selection experience.

## New Features

**fzf Integration:**
- Fuzzy search across all installed packages
- Multi-select with Tab key (select multiple packages at once)
- Live preview pane showing package details (type, name, version, size)
- Color-coded by package manager (APT=Blue, Snap=Magenta, Flatpak=Green, AppImage=Yellow)
- Auto-installs fzf if not present (via apt or GitHub)

**Enhanced UI:**
- Rounded border with styled header
- Real-time search as you type
- Preview pane (40% width) with package metadata
- Visual markers for selected packages (✓)
- Pointer indicator (▶) for current selection

**Improved Keyboard Navigation:**
- ↑↓ or j/k: Navigate list
- Tab: Toggle current selection
- Shift+Tab: Toggle + move up
- Ctrl+A: Select all packages
- Ctrl+D: Deselect all packages
- Enter: Confirm selection and proceed
- Esc: Cancel operation

**Performance Benefits:**
- Instant filtering with fuzzy matching
- No scrolling through hundreds of numbered items
- Can handle large package lists efficiently
- Type-ahead search finds packages instantly

## Implementation Details

**format_package_entry():**
- Formats each package with aligned columns
- Color codes by package type
- Shows: [TYPE] name version size

**ensure_fzf():**
- Checks if fzf is installed
- Auto-installs via apt-get if available
- Falls back to GitHub release if needed
- Adds to PATH automatically

**show_app_selector():**
- Prepares formatted display for fzf
- Configures fzf with custom theme and bindings
- Parses selections and returns raw package data
- Confirms before proceeding with uninstallation

## Updated Help & Banner

- Help message now documents fzf features
- Lists all keyboard shortcuts
- Banner indicates "(fzf)" integration
- Installation section mentions auto-install

## Backwards Compatibility

- Falls back gracefully if fzf installation fails
- All existing package scanning logic unchanged
- Same uninstall flow after selection
- System-critical and data-protected package checks intact

## Example Usage

```bash
$ fub uninstall

# Opens fzf interface:
# - Type "chrome" to filter to Chrome packages
# - Press Tab to select Google Chrome
# - Press Tab again to select Chromium
# - Press Enter to confirm
# - Confirm with 'y' to proceed
```

This upgrade makes uninstalling packages much faster and more intuitive,
especially on systems with many installed packages.
@therealtinhtute therealtinhtute merged commit b3b5583 into main Nov 20, 2025
1 check failed
@therealtinhtute therealtinhtute deleted the claude/review-ubuntu-port-files-01RTbeZNrbum4yKMj42mNCWA branch November 20, 2025 14:52
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.

3 participants