//! Conflict resolution command definitions.
//!
//! Commands for navigating and resolving merge conflicts.

use super::super::command::{CommandCategory, CommandDef, CommandId};
use crate::app::Action;

pub fn conflicts_commands() -> Vec<CommandDef> {
    vec![
        CommandDef {
            id: CommandId::ConflictsOnly,
            name: "Conflicts only",
            key: "cf",
            category: CommandCategory::Conflicts,
            description: "Filter to show only conflicted files",
            action_factory: |_| Some(Action::FilterConflictsOnly),
            is_enabled: |_| true,
            keywords: &["conflicts", "only", "filter"],
        },
        CommandDef {
            id: CommandId::ConflictsPopup,
            name: "Conflicts popup",
            key: "cfp",
            category: CommandCategory::Conflicts,
            description: "Show conflicts popup",
            action_factory: |_| Some(Action::ShowConflictsPopup),
            is_enabled: |_| true,
            keywords: &["conflicts", "popup", "show"],
        },
        CommandDef {
            id: CommandId::ConflictNext,
            name: "Next conflict",
            key: "cn",
            category: CommandCategory::Conflicts,
            description: "Jump to next conflict",
            action_factory: |_| Some(Action::StatusNextConflict),
            is_enabled: |_| true,
            keywords: &["conflict", "next"],
        },
        CommandDef {
            id: CommandId::ConflictPrev,
            name: "Prev conflict",
            key: "cp",
            category: CommandCategory::Conflicts,
            description: "Jump to previous conflict",
            action_factory: |_| Some(Action::StatusPrevConflict),
            is_enabled: |_| true,
            keywords: &["conflict", "prev", "previous"],
        },
        CommandDef {
            id: CommandId::ShowConflictsGuided,
            name: "Show conflicts guided",
            key: "cfg",
            category: CommandCategory::Conflicts,
            description: "Show guided conflict resolution",
            action_factory: |_| Some(Action::ShowConflictsGuided),
            is_enabled: |_| true,
            keywords: &["conflicts", "guided", "help"],
        },
    ]
}

