tenseleyflow/fackr / dedbbc1

Browse files

fix: fuss mode respects terminal height

When both fuss mode and terminal are visible, fuss mode now only renders
above the terminal instead of using full screen height. This prevents
visual artifacts where fuss mode content would render into the terminal
area.

- Add max_rows parameter to render_fuss
- Calculate available height based on terminal start row
Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
dedbbc1f13acd6e6c9133e1e4ad892648daf1e9f
Parents
424dab2
Tree
ae37b40

2 changed files

StatusFile+-
M src/editor/state.rs 8 1
M src/render/screen.rs 4 1
src/editor/state.rsmodified
@@ -1662,7 +1662,13 @@ impl Editor {
16621662
 
16631663
         // Render fuss mode sidebar if active
16641664
         if self.workspace.fuss.active {
1665
-            let visible_rows = self.screen.rows.saturating_sub(2) as usize;
1665
+            // When terminal is visible, fuss mode should only render above it
1666
+            let max_fuss_rows = if self.terminal.visible {
1667
+                Some(self.terminal.render_start_row(self.screen.rows))
1668
+            } else {
1669
+                None
1670
+            };
1671
+            let visible_rows = max_fuss_rows.unwrap_or(self.screen.rows).saturating_sub(2) as usize;
16661672
             self.workspace.fuss.update_viewport(visible_rows);
16671673
 
16681674
             if let Some(ref tree) = self.workspace.fuss.tree {
@@ -1677,6 +1683,7 @@ impl Editor {
16771683
                     &repo_name,
16781684
                     branch.as_deref(),
16791685
                     self.workspace.fuss.git_mode,
1686
+                    max_fuss_rows,
16801687
                 )?;
16811688
             }
16821689
         }
src/render/screen.rsmodified
@@ -893,9 +893,12 @@ impl Screen {
893893
         repo_name: &str,
894894
         branch: Option<&str>,
895895
         git_mode: bool,
896
+        max_rows: Option<u16>,
896897
     ) -> Result<()> {
897898
         let width = width as usize;
898
-        let text_rows = self.rows.saturating_sub(1) as usize;
899
+        // Use max_rows if provided (e.g., when terminal is visible), otherwise use full height
900
+        let available_rows = max_rows.unwrap_or(self.rows);
901
+        let text_rows = available_rows.saturating_sub(1) as usize;
899902
         let hint_rows = if hints_expanded { 4 } else { 1 };
900903
         // Header line + separator + optional git mode line
901904
         let header_rows = if git_mode { 3 } else { 2 };