terminal user interface to jujutsu. Focused on speed and clarity
9
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix single pane mode issue when opening popups

+8 -6
+8 -6
jj_tui/bin/jj_ui.ml
··· 114 114 (** Makes a UI element responsive to terminal width and focus state 115 115 - When focused: shows at full width if terminal is wide enough, or fills terminal if narrow 116 116 - When unfocused: shows at normal width if terminal is wide enough, or collapses if narrow *) 117 - let responsive_view ?(shrunk_width=0) ?(shrink_on= `Focus) ui = 117 + let responsive_view ?(shrunk_width=0) ?(shrink_on= `Focus) ~focus ui = 118 118 let$* w, h = Lwd.get Vars.term_width_height in 119 - let$ ui = ui in 119 + let$ ui = ui 120 + and$ focus = focus|>Focus.status in 120 121 121 122 let should_shrink = match shrink_on with 122 - | `Focus -> Ui.has_focus ui 123 - | `Unfocus -> not (Ui.has_focus ui) 123 + | `Focus -> focus|>Focus.has_focus 124 + | `Unfocus -> not (focus|>Focus.has_focus) 125 + 124 126 in 125 127 let threhold=(Lwd.peek Vars.config).single_pane_width_threshold in 126 128 if should_shrink ··· 174 176 ~mw:1000) 175 177 |> W.Box.focusable ~focus:branch_focus ~pad_h:0 ~pad_w:1 176 178 ] 177 - |> responsive_view ~shrunk_width:0 179 + |> responsive_view ~focus:summary_focus ~shrink_on:`Unfocus ~shrunk_width:0 178 180 ; (*Right side summary/status/fileinfo view*) 179 181 (let ui = 180 182 Show_view.render summary_focus ··· 184 186 |> W.on_focus ~focus:summary_focus (Ui.resize ~sw:3 ~mw:1000) 185 187 |> W.Box.focusable ~focus:summary_focus ~pad_h:0 ~pad_w:1 186 188 in 187 - responsive_view ~shrunk_width:0 ui) 189 + responsive_view ~focus:summary_focus ~shrunk_width:0 ui) 188 190 ] 189 191 (*These outer prompts can popup and show them selves over the main view*) 190 192 |> W.Overlay.text_prompt ~char_count:true ~show_prompt_var:ui_state.show_prompt