//! Canonical action name constants used by both the default bindings and the UI.
//!
//! Every string that the keymap can emit as an action name is defined here.
//! The UI dispatches on these to decide what to do.

// ── Navigation (within the focused pane) ─────────────────────────────────────

/// Move the selection cursor one step down (repeated `count` times).
pub const NAV_DOWN: &str = "nav.down";
/// Move the selection cursor one step up (repeated `count` times).
pub const NAV_UP: &str = "nav.up";
/// Jump to the first item.
pub const NAV_TOP: &str = "nav.top";
/// Jump to the last item.
pub const NAV_BOTTOM: &str = "nav.bottom";
/// Scroll / page down.
pub const NAV_PAGE_DOWN: &str = "nav.page.down";
/// Scroll / page up.
pub const NAV_PAGE_UP: &str = "nav.page.up";

// ── Pane focus ────────────────────────────────────────────────────────────────

/// Focus the left pane (library tree).
pub const FOCUS_LEFT: &str = "focus.left";
/// Focus the centre pane (reference list).
pub const FOCUS_CENTER: &str = "focus.center";
/// Focus the right pane (reference detail / editor).
pub const FOCUS_RIGHT: &str = "focus.right";
/// Move focus to the next pane (cycles left → centre → right → left).
pub const FOCUS_NEXT: &str = "focus.next";
/// Move focus to the previous pane.
pub const FOCUS_PREV: &str = "focus.prev";

// ── Library tree ──────────────────────────────────────────────────────────────

/// Expand the selected tree node.
pub const TREE_EXPAND: &str = "tree.expand";
/// Collapse the selected tree node.
pub const TREE_COLLAPSE: &str = "tree.collapse";
/// Toggle the selected tree node open/closed.
pub const TREE_TOGGLE: &str = "tree.toggle";

// ── Item actions ──────────────────────────────────────────────────────────────

/// Open the selected item (load PDF, expand library, etc.).
pub const ACTION_OPEN: &str = "action.open";
/// Begin editing the selected item.
pub const ACTION_EDIT: &str = "action.edit";
/// Delete the selected item.
pub const ACTION_DELETE: &str = "action.delete";
/// Create a new item in the current context.
pub const ACTION_NEW: &str = "action.new";

// ── PDF viewer ────────────────────────────────────────────────────────────────

/// Scroll the active PDF viewer to the next page.
pub const PDF_PAGE_NEXT: &str = "pdf.page.next";
/// Scroll the active PDF viewer to the previous page.
pub const PDF_PAGE_PREV: &str = "pdf.page.prev";

// ── Tabs ──────────────────────────────────────────────────────────────────────

/// Cycle to the next tab (wraps around).
pub const TAB_NEXT: &str = "tab.next";
/// Cycle to the previous tab (wraps around).
pub const TAB_PREV: &str = "tab.prev";
/// Close the current tab (no-op on the Library tab).
pub const TAB_CLOSE: &str = "tab.close";

// ── Input modes ───────────────────────────────────────────────────────────────

/// Enter command mode (the `:` prompt).
pub const MODE_COMMAND: &str = "mode.command";
/// Enter search / filter mode (the `/` prompt).
pub const MODE_SEARCH: &str = "mode.search";
/// Return to normal mode (dismiss any prompt, clear pending sequence).
pub const MODE_NORMAL: &str = "mode.normal";
/// Export current view as BibTeX.
pub const MODE_BIBTEX: &str = "mode.bibtex";
