Expand description
Directed graph for focus navigation relationships.
Each node represents a focusable widget identified by a FocusId.
Edges encode navigation direction (up/down/left/right/next/prev).
§Invariants
- Node IDs are unique within the graph.
- Removing a node removes all edges incident on it (both incoming and outgoing).
- Edges reference only nodes that exist in the graph.
- Tab-order traversal visits nodes in ascending
tab_indexorder, breaking ties by insertion order (viaFocusId).
§Complexity
| Operation | Time |
|---|---|
| insert | O(1) |
| remove | O(E) worst case (cleans incoming edges) |
| connect | O(1) |
| navigate | O(1) |
| find_cycle | O(V+E) |
Structs§
- Focus
Graph - Directed graph for focus navigation.
- Focus
Node - A focusable node in the graph.
Enums§
- NavDirection
- Navigation direction for focus traversal.
Type Aliases§
- FocusId
- Unique identifier for a focusable widget.