feat(command): add CmdContext extensions and new effects
Add new fields to CmdContext for tracking search mode, panel cursors, tile category index, named text buffers, and key information. Add SetBuffer and SetTileCatIdx effects for managing application state. Update TileBar to accept tile_cat_idx parameter for rendering. Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/Qwen3.5-35B-A3B-GGUF:Q5_K_M)
This commit is contained in:
@ -21,11 +21,12 @@ fn axis_display(axis: Axis) -> (&'static str, Color) {
|
||||
pub struct TileBar<'a> {
|
||||
pub model: &'a Model,
|
||||
pub mode: &'a AppMode,
|
||||
pub tile_cat_idx: usize,
|
||||
}
|
||||
|
||||
impl<'a> TileBar<'a> {
|
||||
pub fn new(model: &'a Model, mode: &'a AppMode) -> Self {
|
||||
Self { model, mode }
|
||||
pub fn new(model: &'a Model, mode: &'a AppMode, tile_cat_idx: usize) -> Self {
|
||||
Self { model, mode, tile_cat_idx }
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,8 +34,8 @@ impl<'a> Widget for TileBar<'a> {
|
||||
fn render(self, area: Rect, buf: &mut Buffer) {
|
||||
let view = self.model.active_view();
|
||||
|
||||
let selected_cat_idx = if let AppMode::TileSelect { cat_idx } = self.mode {
|
||||
Some(*cat_idx)
|
||||
let selected_cat_idx = if matches!(self.mode, AppMode::TileSelect) {
|
||||
Some(self.tile_cat_idx)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user