feat: unified facets and quick action menu#10
Merged
itsdevcoffee merged 6 commits intomainfrom Feb 15, 2026
Merged
Conversation
Completes the comprehensive TUI UX overhaul with unified facets model and context-aware quick action menu system. ## Unified Facets Model (Task #5) Plugin List Facets: - Filters: All | Discover | Ready | Installed - Sorts: ↑Name | ↑Updated | ↑Stars - Visual separator (║) between filters and sorts - Tab cycles through all facets, can filter AND sort simultaneously Marketplace List Facets: - Sorts: ↑Plugins | ↑Stars | ↑Name | ↑Updated - Consistent Tab behavior across all views ## Quick Action Menu (Tasks #6-9) Press Space for context-aware quick actions overlay: Plugin List Menu: - [m] Browse Marketplaces - [f] Filter by Marketplace (opens picker) - [s] Sort by (cycles sort modes) - [v] Toggle View (card/slim) - [u] Refresh Cache Plugin Detail Menu (Discoverable): - [i] Copy 2-Step Install (marketplace + plugin commands) - [m] Copy Marketplace Install - [p] Copy Plugin Install - [g] Open on GitHub - [l] Copy GitHub Link Plugin Detail Menu (Installed): - [o] Open Local Directory - [p] Copy Local Path - [g] Open on GitHub - [l] Copy GitHub Link Marketplace List Menu: - [Enter] View Details - [f] Show Plugins from This - [i] Copy Install Command - [g] Open on GitHub ## Features **2-Step Install Copy (Task #8)** - Press 'i' on discoverable plugins - Copies formatted commands with comments: # Step 1: Install marketplace /plugin marketplace add owner/repo # Step 2: Install plugin /plugin install plugin-name@marketplace **Enhanced Marketplace Picker (Task #7)** - Shift+F as alternative trigger (in addition to @ autocomplete) - Pre-fills @ in search box and activates picker - Accessible from quick menu [f] action **Updated Documentation (Task #10)** - Help view updated with Space, Shift+F, 'i' shortcuts - Terminology changed to "facets" throughout - Context notes for each action ## Implementation Details New Components: - internal/ui/quick_menu.go (281 lines) - Complete quick menu system - ViewQuickMenu state for overlay management - Context-aware action generation based on view and plugin state Enhanced Models: - Facet struct for unified filter/sort representation - GetPluginFacets() and GetMarketplaceFacets() methods - NextFacet/PrevFacet for unified Tab navigation - Plugin sort modes with applyPluginSort() logic Testing & Quality (Task #11): - All tests pass (14 test cases) - Build successful - Linter clean (1 pre-existing complexity warning) - Comprehensive implementation log: docs/buzzminson/2026-02-04-tui-ux-improvements-tasks-5-11.md ## Breaking Changes None - all existing functionality preserved, new features are additive.
Applied automated code review cycle with critical bug fixes and comprehensive simplification. Fixes: - Added empty facets guards to prevent division by zero panics - URL validation before exec.Command (validates http/https scheme) - Guard clauses in all facet navigation methods Simplification: - Consolidated facet cycling logic with cycleFacet() helper - Extracted marketplace filtering into focused functions - Unified marketplace sorting with safe stat extraction helpers - Simplified viewport initialization with clampHeight utility - Removed duplicate utility functions across files - Improved code organization and readability Quality Assurance: - All tests passing - Build successful - Linter clean (1 pre-existing complexity warning) - Code reviewed by feature-dev:code-reviewer - Code simplified by code-simplifier:code-simplifier
Previously, plugins were deduplicated by name only, causing plugins with the same name from different marketplaces to be filtered out. Now uses plugin@marketplace as the deduplication key, allowing different plugins with the same name to appear when they're from different sources.
- Add .mcp.json to .gitignore (local MCP server config may contain secrets) - Add cmd/debug-plugins utility for debugging plugin dedup issues
Applied all fixes from maximus code review cycle to address quality, security, and maintainability issues identified before merge. ## Major Fixes **1. Implemented complete plugin sort modes (internal/ui/model.go)** - Fixed stub implementation in applyPluginSort() - PluginSortName: Alphabetical sorting by plugin name - PluginSortUpdated: Sort by marketplace last pushed date (from stats cache) - PluginSortStars: Sort by marketplace GitHub stars (from stats cache) - Graceful fallback to name sorting when stats unavailable - Resolves: Sort modes ↑Updated and ↑Stars now functional **2. Reduced handleListKeys cyclomatic complexity (internal/ui/update.go)** - Refactored monolithic function (complexity 35+) into focused helpers - Extracted 15+ single-purpose functions: - Navigation: handleUpNavigation, handleDownNavigation, handlePageUp, etc. - Actions: handleEnterKey, handleHelpKey, handleMarketplaceBrowser, etc. - Setup: prepareDetailViewport, prepareHelpViewport - Reduced main function complexity from 35+ to ~8 - Resolves: gocyclo linter warning eliminated - Improved testability and maintainability ## Minor Fixes **3. Enhanced KeyMsg synthesis reliability (internal/ui/quick_menu.go)** - Improved ExecuteQuickMenuAction to handle multi-character keys - Proper KeyMsg construction for both single and multi-char keys - Ensures correct Type and Runes fields **4. Added localhost URL validation (internal/ui/update.go)** - Enhanced openURL() security with localhost rejection - Blocks localhost, 127.0.0.1, and [::1] addresses - Prevents potential local exploitation via malicious plugin URLs **5. Documented TOCTOU race condition (internal/config/config.go)** - Added clear documentation explaining negligible risk - Read-only check in trusted local directory - Current implementation acceptable for use case ## Quality Metrics Pre-push checklist results: - ✅ Linter: 0 issues (down from 1 complexity warning) - ✅ Tests: All tests pass (8 packages) - ✅ Build: Successful Changes: +286 insertions, -180 deletions (net +106 lines)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive TUI UX overhaul implementing unified facets (combined filter/sort tabs) and a context-aware quick action menu (Space key overlay). Builds on top of PR #9 (marketplace autocomplete, dynamic filters).
Key Features
Unified Facets Model:
All | Discover | Ready | Installed ║ ↑Name | ↑Updated | ↑Stars↑Plugins | ↑Stars | ↑Name | ↑Updated║separator between filter and sort sectionsQuick Action Menu (Space key):
2-Step Install Copy (i key):
Marketplace Picker Enhancement (Shift+F):
@marketplace autocomplete from the plugin listSame-Name Plugin Fix:
plugin@marketplaceFiles Changed
internal/ui/quick_menu.go- New quick menu systeminternal/ui/model.go- Facet types, navigation, sort logicinternal/ui/view.go- Unified facet rendering, menu overlayinternal/ui/update.go- Space/Shift+F/i key handlersinternal/ui/marketplace_view.go- Facet-based sort tabsinternal/ui/help_view.go- Updated help textinternal/config/config.go- Plugin dedup fixcmd/debug-plugins/- Debug utility for plugin loadingCode Quality
Comprehensive maximus review applied (commit e48c887):
✅ All sort modes fully implemented
✅ Cyclomatic complexity eliminated
✅ Security improvements
Remaining Known Issues (Future PRs)
Test Plan
go test ./...)go build ./cmd/plum)Documentation
Full implementation log:
docs/buzzminson/2026-02-04-tui-ux-improvements-tasks-5-11.md