tix-tracker 0.12.0

A terminal issue tracker: markdown + YAML frontmatter issues with a kanban TUI and CLI
Documentation
#[allow(clippy::wildcard_imports)]
use super::*;

/// The centered prompt box of the confirm-delete dialog, sized to the frame.
/// Shared by `render` (drawing) and `confirm_delete_buttons` (hit regions) so
/// the pointer geometry cannot drift from what is drawn.
pub(in crate::app) fn confirm_delete_prompt(area: Rect) -> Rect {
    let prompt_w = 40.min(area.width);
    let prompt_h = 4;
    let prompt_x = area.x + (area.width.saturating_sub(prompt_w)) / 2;
    let prompt_y = area.y + (area.height.saturating_sub(prompt_h)) / 2;
    Rect::new(prompt_x, prompt_y, prompt_w, prompt_h)
}

/// The matched cell rectangles of the Yes and No buttons inside a
/// confirm-delete prompt, matching the `"  [Yes]   [No]  "` row's columns.
/// `(yes, no)`.
pub(in crate::app) fn confirm_delete_buttons(prompt: Rect) -> (Rect, Rect) {
    let yes = Rect::new(prompt.x + 3, prompt.y + 3, 5, 1);
    let no = Rect::new(prompt.x + 10, prompt.y + 3, 4, 1);
    (yes, no)
}

/// The issue action menu as an overlay: the board stays visible underneath and
/// the menu floats at a clamped popup position. See
/// [`App::handle_action_menu_key`] for routing.
pub(in crate::app) fn render_action_menu(
    app: &App,
    f: &mut ratatui::Frame,
    area: Rect,
    _return_to: &Mode,
) {
    render_board(app, f, area, commandbar::MODE_BOARD);
    if let Some(menu) = app.action_menu.as_ref() {
        menu.render(f, area);
    }
}