/**
 * Panel system type definitions and constants.
 *
 * Defines the panel position taxonomy (sidebar, left, center-top, center-left,
 * center-main, center-bottom, overlay), the PanelDefinition interface that every
 * panel must conform to, and the PANEL_IDS constants used throughout the codebase
 * for type-safe panel references. Also declares the default toolbar order and the
 * maximum number of panels that can have keyboard shortcuts.
 */
import { ReactNode } from 'react'

// Panel position types
export type PanelPosition =
  | 'sidebar'      // Left edge, always visible area
  | 'left'         // Left of center content (explorer)
  | 'center-top'   // Above terminals (file viewer in top mode)
  | 'center-left'  // Left of terminals (file viewer in left mode)
  | 'center-main'  // Main terminal area
  | 'center-bottom'// Below main terminal
  | 'right'        // Right edge (tutorial/guide panel)
  | 'overlay'      // Replaces center content (settings)

// Panel definition
export interface PanelDefinition {
  id: string
  name: string
  icon: ReactNode
  position: PanelPosition | PanelPosition[]  // Can support multiple positions
  defaultVisible: boolean
  defaultInToolbar: boolean  // Whether it shows in toolbar by default
  resizable?: boolean
  minSize?: number
  maxSize?: number
  // For panels that need special handling
  isGlobal?: boolean  // Not per-session (like sidebar, settings)
}

// Panel IDs as constants for type safety
export const PANEL_IDS = {
  SIDEBAR: 'sidebar',
  EXPLORER: 'explorer',
  FILE_VIEWER: 'fileViewer',
  AGENT: 'agent',
  SETTINGS: 'settings',
  TUTORIAL: 'tutorial',
} as const

export type PanelId = typeof PANEL_IDS[keyof typeof PANEL_IDS]

// Default toolbar order
export const DEFAULT_TOOLBAR_PANELS: string[] = [
  PANEL_IDS.SIDEBAR,
  PANEL_IDS.EXPLORER,
  PANEL_IDS.FILE_VIEWER,
  PANEL_IDS.TUTORIAL,
  PANEL_IDS.AGENT,
  PANEL_IDS.SETTINGS,
]

// Max panels that can have keyboard shortcuts
export const MAX_SHORTCUT_PANELS = 5
