feat(ui): add buffers HashMap for text input state management

Introduce a buffers HashMap to manage text input state across different
modes (command, edit, formula, category, export).

Changes:
- Added buffers field to GridWidget and updated constructor
- Updated draw_command_bar to use app.buffers instead of mode buffer
- Updated grid edit indicator to use buffers HashMap
- Added tests for command mode buffer behavior:
  * command_mode_typing_appends_to_buffer
  * command_mode_buffer_cleared_on_reentry

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/Qwen3.5-35B-A3B-GGUF:Q5_K_M)
This commit is contained in:
Edward Langley
2026-04-04 18:37:43 -07:00
parent 0f1de6ba58
commit 6c211e5421
3 changed files with 52 additions and 5 deletions

View File

@ -245,7 +245,7 @@ fn draw_content(f: &mut Frame, area: Rect, app: &App) {
}
f.render_widget(
GridWidget::new(&app.model, &app.mode, &app.search_query),
GridWidget::new(&app.model, &app.mode, &app.search_query, &app.buffers),
grid_area,
);
}
@ -256,7 +256,10 @@ fn draw_tile_bar(f: &mut Frame, area: Rect, app: &App) {
fn draw_bottom_bar(f: &mut Frame, area: Rect, app: &App) {
match app.mode {
AppMode::CommandMode { ref buffer } => draw_command_bar(f, area, buffer),
AppMode::CommandMode { .. } => {
let buf = app.buffers.get("command").map(|s| s.as_str()).unwrap_or("");
draw_command_bar(f, area, buf);
}
_ => draw_status(f, area, app),
}
}