diff options
| author | soryu <soryu@soryu.co> | 2026-05-18 01:21:30 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-18 01:21:30 +0100 |
| commit | f240675da99bc7705e473b8f70a2628812aa4c10 (patch) | |
| tree | 3ee2d24b431ccb8cd1a3013c86b34a5782a3e224 /makima/src/daemon/tui/widgets/search_input.rs | |
| parent | 0d996cf7590e3e52f424859c7d6f0e68640f119e (diff) | |
| download | soryu-master.tar.gz soryu-master.zip | |
The contracts table, supervisor task type, and all their backing
machinery have been inert for several PRs. The directives system reads
its own active contract body for spec text, and PR #135 removed the
last LLM surface that spawned supervisors.
This PR wipes the dead surface in one shot — the user authorised a DB
wipe, so the migration drops every legacy table with CASCADE rather
than carrying forward stub rows. Net change: −12k LOC across handlers,
repository, state, models, the TUI, and the listen module.
What's gone:
- contracts, contract_chat_*, contract_events, contract_repositories,
contract_type_templates tables.
- supervisor_states, supervisor_heartbeats tables.
- mesh_chat_conversations, mesh_chat_messages tables.
- tasks.contract_id/is_supervisor/supervisor_task_id/supervisor_worktree_task_id columns.
- directive_steps.contract_id/contract_type columns.
- files.contract_id/contract_phase columns.
- history_events.contract_id/phase columns.
- The Contract/Supervisor/MeshChat handler + model + repository
surface, plus the daemon TUI views that read them.
- The standalone listen.rs websocket handler (orphaned with the LLM).
What stays:
- mesh_supervisor handler: trimmed to just the questions + orders
backchannel used by `makima directive ask` / `create-order` (kept
the URL prefix for CLI client compat).
- directive_documents (the user-facing "contracts" surface).
- pending_questions in-memory state for the directive Ask flow.
cargo check, cargo test --lib (68 passed), tsc, and vite build all
clean.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'makima/src/daemon/tui/widgets/search_input.rs')
| -rw-r--r-- | makima/src/daemon/tui/widgets/search_input.rs | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/makima/src/daemon/tui/widgets/search_input.rs b/makima/src/daemon/tui/widgets/search_input.rs deleted file mode 100644 index 311b4f0..0000000 --- a/makima/src/daemon/tui/widgets/search_input.rs +++ /dev/null @@ -1,82 +0,0 @@ -//! Search input widget with match count and visual feedback. - -use ratatui::{ - prelude::*, - widgets::{Block, Borders, Paragraph}, -}; - -use crate::daemon::tui::app::{App, InputMode, ViewMode}; - -/// Color for the search bar when there are no matches -const NO_MATCH_COLOR: Color = Color::Red; -/// Color for the search bar when actively searching -const SEARCH_ACTIVE_COLOR: Color = Color::Yellow; - -pub fn render(f: &mut Frame, area: Rect, app: &App) { - let view_label = match app.view_mode { - ViewMode::Tasks => "Tasks", - ViewMode::Contracts => "Contracts", - ViewMode::Files => "Files", - }; - - let (matched, total) = app.match_count(); - let has_no_matches = app.has_no_matches(); - let is_searching = matches!(app.input_mode, InputMode::Search); - let has_query = !app.search_query.is_empty(); - - // Determine border style based on state - let border_style = if has_no_matches { - Style::default().fg(NO_MATCH_COLOR) - } else if is_searching { - Style::default().fg(SEARCH_ACTIVE_COLOR) - } else { - Style::default() - }; - - // Build the search input content - let search_text = if app.search_query.is_empty() { - if is_searching { - " Type to search...".to_string() - } else { - " Press / to search".to_string() - } - } else { - format!(" {}", app.search_query) - }; - - // Build the title with match count - let title = if has_query { - if has_no_matches { - format!(" 🔍 Search [{}] - No matches ", view_label) - } else { - format!(" 🔍 Search [{}] - {}/{} matches ", view_label, matched, total) - } - } else { - format!(" 🔍 Search [{}] ", view_label) - }; - - // Create input text with appropriate style - let text_style = if app.search_query.is_empty() && !is_searching { - Style::default().fg(Color::DarkGray) - } else if has_no_matches { - Style::default().fg(NO_MATCH_COLOR) - } else { - Style::default() - }; - - let input = Paragraph::new(Span::styled(search_text, text_style)).block( - Block::default() - .title(title) - .borders(Borders::ALL) - .border_style(border_style), - ); - - f.render_widget(input, area); - - // Show cursor in search mode - if is_searching { - // Calculate cursor position based on actual search query length - let cursor_x = area.x + app.search_query.len() as u16 + 2; - f.set_cursor_position(Position::new(cursor_x, area.y + 1)); - } -} |
