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 {
1662
 
1662
 
1663
         // Render fuss mode sidebar if active
1663
         // Render fuss mode sidebar if active
1664
         if self.workspace.fuss.active {
1664
         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;
1666
             self.workspace.fuss.update_viewport(visible_rows);
1672
             self.workspace.fuss.update_viewport(visible_rows);
1667
 
1673
 
1668
             if let Some(ref tree) = self.workspace.fuss.tree {
1674
             if let Some(ref tree) = self.workspace.fuss.tree {
@@ -1677,6 +1683,7 @@ impl Editor {
1677
                     &repo_name,
1683
                     &repo_name,
1678
                     branch.as_deref(),
1684
                     branch.as_deref(),
1679
                     self.workspace.fuss.git_mode,
1685
                     self.workspace.fuss.git_mode,
1686
+                    max_fuss_rows,
1680
                 )?;
1687
                 )?;
1681
             }
1688
             }
1682
         }
1689
         }
src/render/screen.rsmodified
@@ -893,9 +893,12 @@ impl Screen {
893
         repo_name: &str,
893
         repo_name: &str,
894
         branch: Option<&str>,
894
         branch: Option<&str>,
895
         git_mode: bool,
895
         git_mode: bool,
896
+        max_rows: Option<u16>,
896
     ) -> Result<()> {
897
     ) -> Result<()> {
897
         let width = width as usize;
898
         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;
899
         let hint_rows = if hints_expanded { 4 } else { 1 };
902
         let hint_rows = if hints_expanded { 4 } else { 1 };
900
         // Header line + separator + optional git mode line
903
         // Header line + separator + optional git mode line
901
         let header_rows = if git_mode { 3 } else { 2 };
904
         let header_rows = if git_mode { 3 } else { 2 };