syntax = "proto3";

package scarab.nav.v1;

// The direction of the message
// Client -> Host: UpdateLayout
// Host -> Client: (None for now, maybe future commands)

message UpdateLayout {
  // Unique ID for the window/pane (optional, host can infer from connection)
  string window_id = 1;
  
  // List of interactive zones
  repeated InteractiveElement elements = 2;
}

message InteractiveElement {
  // Unique stable ID for the element (optional, for debugging or stable hints)
  string id = 1;
  
  // Screen coordinates (relative to the terminal window top-left 0,0)
  uint32 x = 2;
  uint32 y = 3;
  uint32 width = 4;
  uint32 height = 5;
  
  // Type of element
  ElementType type = 6;
  
  // Optional: Description for screen readers / accessibility
  string description = 7;
  
  // Optional: Key shortcut hint if the app already has one (e.g. "[q]uit")
  string key_hint = 8;
}

enum ElementType {
  UNSPECIFIED = 0;
  BUTTON = 1;
  INPUT = 2;
  LINK = 3;
  LIST_ITEM = 4;
  TAB = 5;
  TEXT = 6; // Selectable text
}
