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 build

+69 -79
+1 -10
flake.nix
··· 76 76 pname = "nottui"; 77 77 version = "dev"; 78 78 duneVersion = "3"; 79 - src = pkgs.fetchFromGitHub { 80 - 81 - owner = "faldor20"; 82 - repo = "nottui"; 83 - rev = "e8d64738c00b22b85d1867414c02c61062fbfc1e"; 84 - sha256 = 85 - "sha256-GgC0KX2LbCEqI3NC26J6e56QO27AFc2cv9Pz/9nQkEc="; 86 - }; 87 - 79 + src = ./forks/nottui/.; 88 80 buildInputs = with ocamlPackages; [ 89 81 lwd 90 82 notty-mine ··· 138 130 139 131 buildPhase = '' 140 132 runHook preBuild 141 - rm -rf ./forks 142 133 dune build -p ${pname} --profile ${profile} ''${enableParallelBuilding:+-j $NIX_BUILD_CORES} 143 134 runHook postBuild 144 135 '';
+68 -69
jj_tui/widget-test/main.ml
··· 23 23 in 24 24 og 25 25 |> Lwd.pure 26 - |> Wd.scroll_area 27 - |> Wd.border_box ~scaling:(`Expand 1) 26 + |> W.Scroll.area 27 + |> W.Box.box 28 28 |>$ Ui.resize ~sh:1 ~mh:1000 29 - |> Wd.size_logger) 29 + |> W.size_logger) 30 30 ; pString "| " 31 31 ] 32 32 ;; ··· 39 39 (let og = 40 40 W.string "123456789000000000000000000000000000000000000000000000000000end" 41 41 in 42 - og |> Lwd.pure |> Wd.scroll_area |> Wd.border_box 43 - (* |>$ Ui.resize ~pad:Wd.neutral_grav ~crop:Wd.neutral_grav *)) 42 + og |> Lwd.pure |> W.Scroll.area |> W.Box.box 43 + (* |>$ Ui.resize ~pad:W.neutral_grav ~crop:W.neutral_grav *)) 44 44 ; "shrinkable" |> pString |>$ Ui.resize ~sw:1 45 45 ] 46 46 ] ··· 57 57 (let og = 58 58 W.string "123456789000000000000000000000000000000000000000000000000000end" 59 59 in 60 - og |> Lwd.pure |> Wd.v_scroll_area |> Wd.border_box_focusable ~focus:focus1 61 - (* |>$ Ui.resize ~pad:Wd.neutral_grav ~crop:Wd.neutral_grav *)) 60 + og |> Lwd.pure |> W.Scroll.v_area |> W.Box.focusable ~focus:focus1 61 + (* |>$ Ui.resize ~pad:W.neutral_grav ~crop:W.neutral_grav *)) 62 62 ; "shrinkable" |> pString |>$ Ui.resize ~sw:1 63 63 ] 64 64 ; pString "demonstrates stretching to max without any other objects" ··· 69 69 in 70 70 og 71 71 |> Lwd.pure 72 - |> Wd.v_scroll_area 73 - |> Wd.border_box_focusable 72 + |> W.Scroll.v_area 73 + |> W.Box.focusable 74 74 |>$ Ui.resize ~pad:Gravity.default ~crop:Gravity.default) 75 75 ] 76 76 ; pString "Same as above but centered" ··· 81 81 in 82 82 og 83 83 |> Lwd.pure 84 - |> Wd.scroll_area 85 - |> Wd.border_box_focusable 86 - |>$ Ui.resize ~pad:Wd.neutral_grav ~crop:Wd.neutral_grav) 84 + |> W.Scroll.area 85 + |> W.Box.focusable 86 + |>$ Ui.resize ~pad:W.neutral_grav ~crop:W.neutral_grav) 87 87 ] 88 88 ; W.hbox 89 89 [ ··· 92 92 in 93 93 og 94 94 |> Lwd.pure 95 - |> Wd.scroll_area 96 - |> Wd.border_box_focusable 95 + |> W.Scroll.area 96 + |> W.Box.focusable 97 97 |>$ Ui.resize ~pad:Gravity.default ~crop:Gravity.default) 98 98 ; "shrinkable" |> pString |>$ Ui.resize ~sw:1 99 99 ] ··· 104 104 in 105 105 og 106 106 |> Lwd.pure 107 - |> Wd.scroll_area 108 - |> Wd.border_box_focusable 107 + |> W.Scroll.area 108 + |> W.Box.focusable 109 109 |>$ Ui.resize ~pad:Gravity.default ~crop:Gravity.default) 110 110 ] 111 111 ; W.hbox ··· 115 115 in 116 116 og 117 117 |> Lwd.pure 118 - |> Wd.scroll_area 119 - |> Wd.border_box_focusable ~scaling:(`Expand 1) 120 - |> Wd.size_logger 118 + |> W.Scroll.area 119 + |> W.Box.focusable 120 + |> W.size_logger 121 121 |>$ Ui.resize ~pad:Gravity.default ~crop:Gravity.default) 122 122 ] 123 123 ; W.hbox ··· 125 125 (let og = 126 126 W.string "123456789000000000000000000000000000000000000000000000000000end" 127 127 in 128 - og |> Lwd.pure |> Wd.scroll_area) 128 + og |> Lwd.pure |> W.Scroll.area) 129 129 ] 130 130 ] 131 131 |>$ Ui.keyboard_area (function ··· 174 174 W.vbox 175 175 [ 176 176 (* 177 - Wd.v_window_stack2 177 + W.v_window_stack2 178 178 [ 179 179 is_focused_widget () 180 180 ; W.string "hi this is the first level" 181 181 |> Lwd.pure 182 - |> Wd.scroll_area 183 - |> Wd.border_box_focusable 184 - ; Wd.v_window_stack2 182 + |> W.Scroll.area 183 + |> W.Box.focusable 184 + ; W.v_window_stack2 185 185 [ 186 186 W.string "hi this is the first level" 187 187 |> Lwd.pure 188 - |> Wd.scroll_area 189 - |> Wd.border_box_focusable 188 + |> W.Scroll.area 189 + |> W.Box.focusable 190 190 ; W.string "hi this is the second level" 191 191 |> Lwd.pure 192 - |> Wd.scroll_area 193 - |> Wd.border_box_focusable ~focus:start 194 - ; Wd.v_window_stack2 192 + |> W.Scroll.area 193 + |> W.Box.focusable ~focus:start 194 + ; W.v_window_stack2 195 195 [ 196 196 W.string "hi this is the first level" 197 197 |> Lwd.pure 198 - |> Wd.scroll_area 199 - |> Wd.border_box_focusable 198 + |> W.Scroll.area 199 + |> W.Box.focusable 200 200 ; W.string "hi this is the second level" 201 201 |> Lwd.pure 202 - |> Wd.scroll_area 203 - |> Wd.border_box_focusable 202 + |> W.Scroll.area 203 + |> W.Box.focusable 204 204 ] 205 205 ] 206 206 ] 207 - ; Wd.v_window_stack2 207 + ; W.v_window_stack2 208 208 [ 209 209 W.string "hi this is the first level" 210 210 |> Lwd.pure 211 - |> Wd.scroll_area 212 - |> Wd.border_box_focusable 211 + |> W.Scroll.area 212 + |> W.Box.focusable 213 213 ; W.string "hi this is the second level" 214 214 |> Lwd.pure 215 - |> Wd.scroll_area 216 - |> Wd.border_box_focusable 215 + |> W.Scroll.area 216 + |> W.Box.focusable 217 217 ] 218 218 *) 219 219 (let attr = A.fg A.blue in ··· 245 245 Ui.vcat [ elem; elem_sw0; elem_sw1; elem_w; elem_mw ] 246 246 |> Ui.resize ~w:15 ~sw:0 247 247 |> Lwd.pure 248 - |> Wd.border_box ~pad_w:0 ~pad_h:0) 248 + |> W.Box.box ~pad_w:0 ~pad_h:0) 249 249 ; (let output = Lwd.var "none" in 250 250 (*A button that responds to the enter keypress*) 251 251 let button ?(focus = Focus.make ()) name = ··· 278 278 let w_5 = 279 279 let focus = Focus.make () in 280 280 Focus.request focus; 281 - Wd.Wip.v_window_stack 281 + W.Wip.v_window_stack 282 282 ~focus 283 283 [ 284 284 is_focused_widget2 285 285 ; is_focused_widget2 286 - ; Wd.Wip.h_window_stack 286 + ; W.Wip.h_window_stack 287 287 [ 288 288 is_focused_widget2 289 289 ; is_focused_widget2 290 - ; Wd.Wip.v_window_stack 290 + ; W.Wip.v_window_stack 291 291 [ 292 292 is_focused_widget2 293 293 ; is_focused_widget2 294 - ; Wd.Wip.h_window_stack 294 + ; W.Wip.h_window_stack 295 295 [ 296 296 is_focused_widget2 297 297 ; is_focused_widget2 298 - ; Wd.Wip.v_window_stack [ is_focused_widget2; is_focused_widget2 ] 298 + ; W.Wip.v_window_stack [ is_focused_widget2; is_focused_widget2 ] 299 299 ] 300 300 ] 301 301 ] 302 - ; Wd.Wip.h_window_stack [ is_focused_widget2 ] 302 + ; W.Wip.h_window_stack [ is_focused_widget2 ] 303 303 ] 304 304 ;; 305 305 ··· 329 329 ;; 330 330 331 331 let w_6 = 332 - let state = Lwd.var W.default_scroll_state in 333 332 W.vbox 334 333 [ 335 334 Ui.vcat [ W.string "hi"; W.string "50"; W.string "there"; W.string "mate" ] 336 335 |> Lwd.pure 337 - |> W.vscroll_area ~change:(fun _ x -> state $= x) ~state:(Lwd.get state) 336 + |> W.Scroll.v_area 338 337 |>$ Ui.resize ~h:2 ~sh:0 339 - ; Wd.h_rule |> Lwd.pure 340 - ; W.file_select ~on_select:(fun x -> ()) () 338 + ; W.h_rule |> Lwd.pure 339 + ; W.Old.file_select ~on_select:(fun x -> ()) () 341 340 ; W.unfoldable 342 341 (W.string "click to unfold" |> Lwd.pure) 343 342 (fun () -> W.string "I'm unfolded" |> Lwd.pure) ··· 345 344 ;; 346 345 347 346 let w_7 = 348 - let state = Lwd.var (W.default_scroll_state, W.default_scroll_state) in 349 347 W.vbox 350 348 [ (* 351 - Wd.Wip.h_window_stack2 349 + W.Wip.h_window_stack2 352 350 [ 353 351 Ui.vcat 354 352 [ ··· 358 356 ; W.string "mate" 359 357 ] 360 358 |> Lwd.pure 361 - |> Wd.scroll_area 359 + |> W.Scroll.area 362 360 |>$ Ui.resize ~mw:15 363 361 ; W.string "|" |> Lwd.pure 364 362 ] 365 - ; Wd.Wip.h_window_stack2 363 + ; W.Wip.h_window_stack2 366 364 [ 367 365 Ui.vcat 368 366 [ ··· 372 370 ; W.string "mate" 373 371 ] 374 372 |> Lwd.pure 375 - |> Wd.v_scroll_area 373 + |> W.Scroll.v_area 376 374 |>$ Ui.resize ~h:2 ~sh:0 377 375 ; W.string "|" |> Lwd.pure 378 376 ] ··· 398 396 `Handled 399 397 | _ -> 400 398 `Unhandled) 401 - |> Wd.border_box_focusable ~focus:topfocus 399 + |> W.Box.focusable ~focus:topfocus 402 400 ; Lwd.get bot 403 401 |>$ W.string 404 402 |>$ Ui.keyboard_area (function ··· 413 411 `Handled 414 412 | _ -> 415 413 `Unhandled) 416 - |> Wd.border_box_focusable 414 + |> W.Box.focusable 417 415 ; Lwd.get last 418 416 |>$ W.string 419 417 |>$ Ui.keyboard_area (function ··· 428 426 `Handled 429 427 | _ -> 430 428 `Unhandled) 431 - |> Wd.border_box_focusable 429 + |> W.Box.focusable 432 430 ] 433 431 |>$ Ui.keyboard_area (function 434 432 | `ASCII 's', _ -> ··· 441 439 (* |> Lwd.observe *) 442 440 (* |> Lwd.quick_sample *) 443 441 (* |> Ui.pp Format.str_formatter; *) 444 - (* pString (Format.flush_str_formatter())|>Wd.v_scroll_area *) 442 + (* pString (Format.flush_str_formatter())|>W.Scroll.v_area *) 445 443 446 444 let w_9 = 447 - let state = Lwd.var (W.default_scroll_state, W.default_scroll_state) in 448 445 let items = 449 446 [ "hi"; "it's"; "meeeeeeeeeeeeeeeeeeeeeeeee" ] 450 - |> List.map (fun item -> Wd.{ data = item; ui = Wd.selectable_item (W.string item) }) 447 + |> List.map (fun item -> W.Lists.{ data = item; ui = W.Lists.selectable_item (W.string item) }) 451 448 |> Lwd.pure 452 449 in 453 450 W.vbox 454 451 [ 455 452 items 456 - |> Wd.selection_list_custom 453 + |> W.Lists.selection_list_custom 457 454 ~on_selection_change:(fun x -> ()) 458 - ~custom_handler:(fun _ _ key -> match key with _ -> `Unhandled) 455 + ~custom_handler:(fun _ key -> match key with _ -> `Unhandled) 459 456 |>$ Ui.resize ~w:10 ~sw:1 460 - |> Wd.border_box_focusable ~pad_h:0 457 + |> W.Box.focusable ~pad_h:0 461 458 ; items 462 - |> Wd.selection_list_custom 459 + |> W.Lists.selection_list_custom 460 + 463 461 ~on_selection_change:(fun x -> ()) 464 - ~custom_handler:(fun _ _ key -> match key with _ -> `Unhandled) 462 + ~custom_handler:(fun _ key -> match key with _ -> `Unhandled) 465 463 |>$ Ui.resize ~w:10 ~sw:1 466 - |> Wd.border_box_focusable ~pad_h:0 464 + |> W.Box.focusable ~pad_h:0 467 465 ; items 468 - |> Wd.selection_list_custom 466 + |> W.Lists.selection_list_custom 467 + 469 468 ~on_selection_change:(fun x -> ()) 470 - ~custom_handler:(fun _ _ key -> match key with _ -> `Unhandled) 469 + ~custom_handler:(fun _ key -> match key with _ -> `Unhandled) 471 470 |>$ Ui.resize ~w:10 ~sw:1 472 - |> Wd.border_box_focusable ~pad_h:0 471 + |> W.Box.focusable ~pad_h:0 473 472 ] 474 473 ;; 475 474