2424from rich .console import Console , Group
2525from rich .layout import Layout
2626from rich .live import Live
27- from rich .measure import Measurement
2827from rich .panel import Panel
2928from rich .progress import BarColumn , Progress , TextColumn , TimeRemainingColumn
3029from typer import Option , Typer
@@ -95,7 +94,7 @@ def generate_tables_renderable() -> Group:
9594# ----- Progress + Layout helpers ----- #
9695
9796
98- def make_layout (progress : Progress , tables : Group , console : Console ) -> Layout :
97+ def make_layout (progress : Progress , tables : Group ) -> Layout :
9998 """
10099 Create the main UI layout with the progress bar above the table,
101100 dynamically matching the table width (or console width if resized).
@@ -106,21 +105,10 @@ def make_layout(progress: Progress, tables: Group, console: Console) -> Layout:
106105 The Rich Progress instance for the countdown.
107106 table_renderable : Group
108107 The Group containing the task and cluster panels.
109- console : Console
110- The console, used for width fallback.
111108 """
112- # Compute max width among all panels in the Group
113- table_width : int = max ( # we add +2 for panel padding/borders
114- Measurement .get (console , console .options , panel .renderable ).maximum # ty:ignore[unresolved-attribute]
115- for panel in tables .renderables
116- )
117-
118- # Add panel borders and padding (2 for border + 2 for padding)
119- panel_width : int = min (table_width + 4 , console .width )
120-
121109 layout = Layout ()
122110 layout .split_column (
123- Layout (Panel ( progress , title = "time to Next HTCondor Query" , padding = ( 0 , 1 ), width = panel_width ) , size = 3 ),
111+ Layout (progress , size = 3 ),
124112 Layout (tables , ratio = 1 ),
125113 )
126114 return layout
@@ -171,7 +159,7 @@ def main(
171159 progress .update (task_id , total = wait , completed = 0 )
172160
173161 # We start rendering our layout with progress + table
174- layout : Layout = make_layout (progress , tables , console )
162+ layout : Layout = make_layout (progress , tables )
175163 live .update (layout )
176164
177165 # Now we need to update the progress bar until
0 commit comments