From 21a45d530980619cc1de59bde69b76857d73a459 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Thu, 19 Mar 2026 09:44:20 -0700 Subject: [PATCH] add comment on App --- src/tui.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/tui.zig b/src/tui.zig index fef0091..bdc0229 100644 --- a/src/tui.zig +++ b/src/tui.zig @@ -192,6 +192,16 @@ pub const OptionsRow = struct { contract: ?zfin.OptionContract = null, }; +/// Root widget for the interactive TUI. Implements the vaxis `vxfw.Widget` +/// interface via `widget()`, which wires `typeErasedEventHandler` and +/// `typeErasedDrawFn` as callbacks. Passed to `vxfw.App.run()` as the +/// top-level widget; vaxis drives the event loop, calling back into App +/// for key/mouse/init events and for each frame's draw. +/// +/// Owns all application state: the active tab, cached data for each tab, +/// navigation/scroll positions, input mode, and a reference to the +/// `DataService` for fetching financial data. Tab-specific rendering and +/// data loading are delegated to the `tui/*_tab.zig` modules. pub const App = struct { allocator: std.mem.Allocator, config: zfin.Config,