@@ -770,11 +770,11 @@ fn test_dev_hold_across_execute_requests() {
770770fn test_positron_simple_plot ( ) {
771771 let frontend = DummyArkFrontend :: lock ( ) ;
772772 frontend. open_ui_comm ( ) ;
773- frontend. set_buffer_ui_events ( true ) ;
774773
775774 frontend. send_execute_request ( "plot(1:10)" , ExecuteRequestOptions :: default ( ) ) ;
776775 frontend. recv_iopub_busy ( ) ;
777776 frontend. recv_iopub_execute_input ( ) ;
777+ frontend. recv_iopub_ui_prompt_state ( ) ;
778778 frontend. recv_iopub_idle ( ) ;
779779 frontend. recv_shell_execute_reply ( ) ;
780780
@@ -787,11 +787,11 @@ fn test_positron_simple_plot() {
787787fn test_positron_multiple_plots ( ) {
788788 let frontend = DummyArkFrontend :: lock ( ) ;
789789 frontend. open_ui_comm ( ) ;
790- frontend. set_buffer_ui_events ( true ) ;
791790
792791 frontend. send_execute_request ( "plot(1:10)\n plot(2:20)" , ExecuteRequestOptions :: default ( ) ) ;
793792 frontend. recv_iopub_busy ( ) ;
794793 frontend. recv_iopub_execute_input ( ) ;
794+ frontend. recv_iopub_ui_prompt_state ( ) ;
795795 frontend. recv_iopub_idle ( ) ;
796796 frontend. recv_shell_execute_reply ( ) ;
797797
@@ -810,16 +810,16 @@ fn test_positron_multiple_plots() {
810810fn test_positron_par_multi_panel ( ) {
811811 let frontend = DummyArkFrontend :: lock ( ) ;
812812 frontend. open_ui_comm ( ) ;
813- frontend. set_buffer_ui_events ( true ) ;
814813
815814 let code = "par(mfrow = c(2, 1))\n plot(1:10)\n plot(2:20)" ;
816815 frontend. send_execute_request ( code, ExecuteRequestOptions :: default ( ) ) ;
817816 frontend. recv_iopub_busy ( ) ;
818817 frontend. recv_iopub_execute_input ( ) ;
819818
820- // Panel update arrives directly on IOPub (before idle )
819+ // Panel update arrives on IOPub (from on_did_execute_request )
821820 let update = frontend. recv_iopub_comm_msg ( ) ;
822821
822+ frontend. recv_iopub_ui_prompt_state ( ) ;
823823 frontend. recv_iopub_idle ( ) ;
824824 frontend. recv_shell_execute_reply ( ) ;
825825
@@ -837,7 +837,6 @@ fn test_positron_par_multi_panel() {
837837fn test_positron_layout_multi_plot ( ) {
838838 let frontend = DummyArkFrontend :: lock ( ) ;
839839 frontend. open_ui_comm ( ) ;
840- frontend. set_buffer_ui_events ( true ) ;
841840
842841 let code = r#"
843842plt2 = function() {
@@ -851,9 +850,10 @@ plt2()
851850 frontend. recv_iopub_busy ( ) ;
852851 frontend. recv_iopub_execute_input ( ) ;
853852
854- // Second panel update (direct IOPub )
853+ // Second panel update (from on_did_execute_request )
855854 let update = frontend. recv_iopub_comm_msg ( ) ;
856855
856+ frontend. recv_iopub_ui_prompt_state ( ) ;
857857 frontend. recv_iopub_idle ( ) ;
858858 frontend. recv_shell_execute_reply ( ) ;
859859
@@ -870,7 +870,6 @@ plt2()
870870fn test_positron_dev_hold_suppresses ( ) {
871871 let frontend = DummyArkFrontend :: lock ( ) ;
872872 frontend. open_ui_comm ( ) ;
873- frontend. set_buffer_ui_events ( true ) ;
874873
875874 let code = r#"
876875invisible(dev.hold())
@@ -881,6 +880,7 @@ invisible(dev.flush())
881880 frontend. send_execute_request ( code, ExecuteRequestOptions :: default ( ) ) ;
882881 frontend. recv_iopub_busy ( ) ;
883882 frontend. recv_iopub_execute_input ( ) ;
883+ frontend. recv_iopub_ui_prompt_state ( ) ;
884884 frontend. recv_iopub_idle ( ) ;
885885 frontend. recv_shell_execute_reply ( ) ;
886886
@@ -897,7 +897,6 @@ invisible(dev.flush())
897897fn test_positron_dev_hold_across_requests ( ) {
898898 let frontend = DummyArkFrontend :: lock ( ) ;
899899 frontend. open_ui_comm ( ) ;
900- frontend. set_buffer_ui_events ( true ) ;
901900
902901 // Hold and plot without flushing. No plot comm should open.
903902 frontend. send_execute_request (
@@ -906,13 +905,15 @@ fn test_positron_dev_hold_across_requests() {
906905 ) ;
907906 frontend. recv_iopub_busy ( ) ;
908907 frontend. recv_iopub_execute_input ( ) ;
908+ frontend. recv_iopub_ui_prompt_state ( ) ;
909909 frontend. recv_iopub_idle ( ) ;
910910 frontend. recv_shell_execute_reply ( ) ;
911911
912912 // Flush in a separate request. The held plot should now appear.
913913 frontend. send_execute_request ( "invisible(dev.flush())" , ExecuteRequestOptions :: default ( ) ) ;
914914 frontend. recv_iopub_busy ( ) ;
915915 frontend. recv_iopub_execute_input ( ) ;
916+ frontend. recv_iopub_ui_prompt_state ( ) ;
916917 frontend. recv_iopub_idle ( ) ;
917918 frontend. recv_shell_execute_reply ( ) ;
918919
@@ -930,13 +931,13 @@ fn test_positron_dev_hold_across_requests() {
930931fn test_positron_sequential_plots ( ) {
931932 let frontend = DummyArkFrontend :: lock ( ) ;
932933 frontend. open_ui_comm ( ) ;
933- frontend. set_buffer_ui_events ( true ) ;
934934
935935 for i in 1 ..=3 {
936936 let code = format ! ( "plot({i}:10)" ) ;
937937 frontend. send_execute_request ( & code, ExecuteRequestOptions :: default ( ) ) ;
938938 frontend. recv_iopub_busy ( ) ;
939939 frontend. recv_iopub_execute_input ( ) ;
940+ frontend. recv_iopub_ui_prompt_state ( ) ;
940941 frontend. recv_iopub_idle ( ) ;
941942 frontend. recv_shell_execute_reply ( ) ;
942943
@@ -953,7 +954,6 @@ fn test_positron_sequential_plots() {
953954fn test_positron_graphics_device_swap ( ) {
954955 let frontend = DummyArkFrontend :: lock ( ) ;
955956 frontend. open_ui_comm ( ) ;
956- frontend. set_buffer_ui_events ( true ) ;
957957
958958 let code = r#"
959959plot(1:10)
@@ -964,6 +964,7 @@ invisible(dev.off())
964964 frontend. send_execute_request ( code, ExecuteRequestOptions :: default ( ) ) ;
965965 frontend. recv_iopub_busy ( ) ;
966966 frontend. recv_iopub_execute_input ( ) ;
967+ frontend. recv_iopub_ui_prompt_state ( ) ;
967968 frontend. recv_iopub_idle ( ) ;
968969 frontend. recv_shell_execute_reply ( ) ;
969970
@@ -977,7 +978,6 @@ invisible(dev.off())
977978fn test_positron_loop_plots ( ) {
978979 let frontend = DummyArkFrontend :: lock ( ) ;
979980 frontend. open_ui_comm ( ) ;
980- frontend. set_buffer_ui_events ( true ) ;
981981
982982 let code = r#"
983983for (i in 1:3) {
@@ -987,6 +987,7 @@ for (i in 1:3) {
987987 frontend. send_execute_request ( code, ExecuteRequestOptions :: default ( ) ) ;
988988 frontend. recv_iopub_busy ( ) ;
989989 frontend. recv_iopub_execute_input ( ) ;
990+ frontend. recv_iopub_ui_prompt_state ( ) ;
990991 frontend. recv_iopub_idle ( ) ;
991992 frontend. recv_shell_execute_reply ( ) ;
992993
@@ -1006,7 +1007,6 @@ for (i in 1:3) {
10061007fn test_positron_par_overflow_to_new_page ( ) {
10071008 let frontend = DummyArkFrontend :: lock ( ) ;
10081009 frontend. open_ui_comm ( ) ;
1009- frontend. set_buffer_ui_events ( true ) ;
10101010
10111011 let code = r#"
10121012par(mfrow = c(3, 1))
@@ -1020,10 +1020,11 @@ par(mfrow = c(1, 1))
10201020 frontend. recv_iopub_busy ( ) ;
10211021 frontend. recv_iopub_execute_input ( ) ;
10221022
1023- // Panels 2 and 3 update the first page (direct IOPub, before idle )
1023+ // Panels 3 and 4 update the first page (from before.plot.new during R eval )
10241024 let update1 = frontend. recv_iopub_comm_msg ( ) ;
10251025 let update2 = frontend. recv_iopub_comm_msg ( ) ;
10261026
1027+ frontend. recv_iopub_ui_prompt_state ( ) ;
10271028 frontend. recv_iopub_idle ( ) ;
10281029 frontend. recv_shell_execute_reply ( ) ;
10291030
@@ -1048,33 +1049,36 @@ par(mfrow = c(1, 1))
10481049fn test_positron_dev_hold_flush_interactive ( ) {
10491050 let frontend = DummyArkFrontend :: lock ( ) ;
10501051 frontend. open_ui_comm ( ) ;
1051- frontend. set_buffer_ui_events ( true ) ;
10521052
10531053 // Hold
10541054 frontend. send_execute_request ( "invisible(dev.hold())" , ExecuteRequestOptions :: default ( ) ) ;
10551055 frontend. recv_iopub_busy ( ) ;
10561056 frontend. recv_iopub_execute_input ( ) ;
1057+ frontend. recv_iopub_ui_prompt_state ( ) ;
10571058 frontend. recv_iopub_idle ( ) ;
10581059 frontend. recv_shell_execute_reply ( ) ;
10591060
10601061 // Draw first plot (held, no comm should open)
10611062 frontend. send_execute_request ( "plot(1:10)" , ExecuteRequestOptions :: default ( ) ) ;
10621063 frontend. recv_iopub_busy ( ) ;
10631064 frontend. recv_iopub_execute_input ( ) ;
1065+ frontend. recv_iopub_ui_prompt_state ( ) ;
10641066 frontend. recv_iopub_idle ( ) ;
10651067 frontend. recv_shell_execute_reply ( ) ;
10661068
10671069 // Draw over it (still held)
10681070 frontend. send_execute_request ( "abline(1, 2)" , ExecuteRequestOptions :: default ( ) ) ;
10691071 frontend. recv_iopub_busy ( ) ;
10701072 frontend. recv_iopub_execute_input ( ) ;
1073+ frontend. recv_iopub_ui_prompt_state ( ) ;
10711074 frontend. recv_iopub_idle ( ) ;
10721075 frontend. recv_shell_execute_reply ( ) ;
10731076
10741077 // Flush - the combined plot should now appear
10751078 frontend. send_execute_request ( "invisible(dev.flush())" , ExecuteRequestOptions :: default ( ) ) ;
10761079 frontend. recv_iopub_busy ( ) ;
10771080 frontend. recv_iopub_execute_input ( ) ;
1081+ frontend. recv_iopub_ui_prompt_state ( ) ;
10781082 frontend. recv_iopub_idle ( ) ;
10791083 frontend. recv_shell_execute_reply ( ) ;
10801084
0 commit comments