From 0833fb1f30c0c3b920157deb882e0e902c3af02a Mon Sep 17 00:00:00 2001 From: soryu Date: Mon, 19 Jan 2026 13:47:32 +0000 Subject: Add interactive TUI browser for tasks, contracts, and files (makima view) (#7) * feat(tui): Implement fuzzy search with real-time filtering and highlighting Adds comprehensive fuzzy search functionality to the TUI browser: ## Fuzzy Matching (fuzzy.rs) - FuzzyMatcher wrapper using SkimMatcherV2 from fuzzy-matcher crate - fuzzy_match() returns score and matched character indices - fuzzy_match_all() supports multi-term search (space-separated) - Recency-aware scoring to boost recent items in results - Unit tests for all matching scenarios ## App State (app.rs) - FilteredItem struct with index, score, and matched_indices - apply_filter() uses fuzzy matching with score-based sorting - match_count() and has_no_matches() helper methods - Results sorted by match score (highest first) ## List View (list_view.rs) - Highlighted matched characters in search results - Yellow bold styling for matched chars - Status icons with color coding ## Search Input (search_input.rs) - Real-time match count display (X/Y matches) - Visual feedback for no matches (red border) - Placeholder text when search is empty - Active search mode indication (yellow border) ## Event Handling (event.rs) - Arrow key navigation while in search mode - Ctrl+K/J for vim-style navigation during search - Delete key support alongside backspace - Ctrl+U to clear search query - Tab toggles preview while searching - Escape clears search and exits search mode Co-Authored-By: Claude Opus 4.5 * Task completion checkpoint * [WIP] Heartbeat checkpoint - 2026-01-19 11:20:34 UTC * Task completion checkpoint * [WIP] Heartbeat checkpoint - 2026-01-19 11:31:19 UTC * Task completion checkpoint * [WIP] Heartbeat checkpoint - 2026-01-19 11:39:07 UTC * fix(tui): Fix module exports and main binary integration - Update mod.rs to properly export app, event, fuzzy, and ui modules - Add run() function for TUI entry point - Fix run_view() to use ViewCommand enum instead of ViewArgs - Fix event handling to use poll_event and handle_key_event Co-Authored-By: Claude Opus 4.5 --------- Co-authored-by: Claude Opus 4.5 --- makima/src/daemon/tui/widgets/preview_pane.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 makima/src/daemon/tui/widgets/preview_pane.rs (limited to 'makima/src/daemon/tui/widgets/preview_pane.rs') diff --git a/makima/src/daemon/tui/widgets/preview_pane.rs b/makima/src/daemon/tui/widgets/preview_pane.rs new file mode 100644 index 0000000..84095d0 --- /dev/null +++ b/makima/src/daemon/tui/widgets/preview_pane.rs @@ -0,0 +1,21 @@ +//! Preview pane widget. + +use ratatui::{ + prelude::*, + widgets::{Block, Borders, Paragraph, Wrap}, +}; + +use crate::daemon::tui::app::App; + +pub fn render(f: &mut Frame, area: Rect, app: &App) { + let content = app + .preview_content + .as_deref() + .unwrap_or("No preview available"); + + let preview = Paragraph::new(content) + .block(Block::default().title(" Preview ").borders(Borders::ALL)) + .wrap(Wrap { trim: true }); + + f.render_widget(preview, area); +} -- cgit v1.2.3