From 2971d699423e2f28f2686b098cb5dbf9a705038e Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Mon, 26 Oct 2026 20:38:32 +0800 Subject: feat(tui): add object focus traversal and link activation --- src/tui/document_view.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/tui/document_view.hh') diff --git a/src/tui/document_view.hh b/src/tui/document_view.hh index 587f419..5f5e331 100644 --- a/src/tui/document_view.hh +++ b/src/tui/document_view.hh @@ -46,6 +46,13 @@ enum class ViewMotion : std::uint8_t PanRight }; +enum class FocusResult : std::uint8_t +{ + Empty, + Moved, + Wrapped +}; + // One tab's reading state. It owns the logical snapshot; screen rows are caches. // Keyboard, mouse and host navigation all use the same layout/source mappings. class DocumentView @@ -70,6 +77,9 @@ public: void wheel( int steps ); bool locate( const DocumentPoint& point ); std::optional focused_target() const; + // Browse/field-editor routing owns mode eligibility; this follows the shared order. + FocusResult focus( bool backward ); + const Link* focused_link() const; void draw( Frame& frame, CellPoint origin ) const; private: -- cgit v1.2.3