diff --git a/src/apps/core.rs b/src/apps/core.rs index 19a6480..af97902 100644 --- a/src/apps/core.rs +++ b/src/apps/core.rs @@ -59,6 +59,17 @@ impl Default for App { } impl App { + /// Render the application UI and manage terminal cursor visibility and position for SSID/password popups. + /// + /// When an SSID or password popup is visible, this sets the terminal cursor to the popup's input position + /// and enables cursor blinking; otherwise it hides the cursor and disables blinking. + /// + /// # Examples + /// + /// ```no_run + /// // Assuming `app` is an initialized `App` and `frame` is a mutable `ratatui::Frame`: + /// // app.draw(&mut frame); + /// ``` fn draw(&self, frame: &mut Frame) { frame.render_widget(self, frame.area()); @@ -83,6 +94,15 @@ impl App { } } + /// Mark the application to exit by setting its internal exit flag. + /// + /// # Examples + /// + /// ``` + /// let mut app = App::default(); + /// app.exit(); + /// assert!(app.app_state.exit); + /// ``` fn exit(&mut self) { self.app_state.exit = true; } @@ -157,4 +177,4 @@ impl App { fn reset_selection(&mut self) { self.selected = 0; } -} +} \ No newline at end of file diff --git a/src/apps/core/widget.rs b/src/apps/core/widget.rs index e75a366..c9744ce 100644 --- a/src/apps/core/widget.rs +++ b/src/apps/core/widget.rs @@ -30,12 +30,11 @@ const HELP_TEXT: [&str; 12] = [ ]; impl Widget for &App { - /// Render the application's terminal UI into the provided drawing area buffer. + /// Render the application's terminal UI into the provided drawing area. /// - /// This draws the main network table and, depending on internal flags and state, - /// overlays the saved-connections list, help menu, delete-confirmation popup, - /// hidden-SSID input popup, password input popup, and status popup. Cursor - /// visibility and blinking are adjusted as needed for input popups. + /// Draws the main network table and, depending on the app's flags and state, + /// conditionally overlays the saved-connections list, help menu, delete-confirmation + /// popup, hidden-SSID input popup, password input popup, and status popup. /// /// # Examples /// @@ -279,4 +278,4 @@ impl Widget for &App { status_paragraph.render(status_area, buf); } } -} +} \ No newline at end of file