rstudio / reactlog

Shiny Reactivity Visualizer
http://rstudio.github.io/reactlog
Other
121 stars 9 forks source link

Key combination for Linux users #82

Open jeffreyhanson opened 2 years ago

jeffreyhanson commented 2 years ago

Hi,

Thank you very much for developing the reactlog R package!

The documentation (e.g. https://rstudio.github.io/reactlog/reference/reactlog_show.html) provides the following instructions for opening the reactive log visualization while a Shiny app is running:

At any time you can hit Ctrl+F3 (or for Mac users, Cmd+F3) in your web browser to launch the reactive log visualization.

Based on this wording, I would have expected pressing Crtl+F3 to open the reactive log visualization under all operating systems except for MacOS. However, I found that needed to use the key combination Meta+F3 (in other words, "Windows button"+F3) to open the reactive log visualization on Ubuntu (21.04, using Google Chrome to display the Shiny web app).

I'm not sure if this is the intended (and thus an issue with the documentation) or unintended behavior (and thus an issue with the R code used to specify the key bindings)? I just wanted to report this issue in case it might be helpful. I've tested this using the CRAN version and latest GitHub version of reactlog, and included session details below. Please let me know if there's any further details I can provide (e.g. web browser version)?


Reproducible example

Note that the following R code is not run inside Rstudio.

library(shiny)
library(reactlog)

# tell shiny to log all reactivity
reactlog_enable()

# run a shiny app
app <- system.file("examples/01_hello", package = "shiny")
runApp(app)

# now press Crtl+F3 in web browser
# > nothing happens

# now press Meta+F3 in web browser
# > react log visualization opens

Session information

R version 4.1.1 (2021-08-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 21.04

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
[1] reactlog_1.1.0 shiny_1.6.0    testthat_3.0.2 devtools_2.4.2 usethis_2.0.1 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7        jquerylib_0.1.4   compiler_4.1.1    bslib_0.2.5.1    
 [5] later_1.2.0       prettyunits_1.1.1 remotes_2.4.0     tools_4.1.1      
 [9] digest_0.6.27     pkgbuild_1.2.0    pkgload_1.2.1     jsonlite_1.7.2   
[13] memoise_2.0.0     lifecycle_1.0.0   rlang_0.4.11      cli_3.0.1        
[17] fastmap_1.1.0     withr_2.4.2       desc_1.3.0        fs_1.5.0         
[21] sass_0.4.0        rprojroot_2.0.2   glue_1.4.2        R6_2.5.0         
[25] processx_3.5.2    sessioninfo_1.1.1 callr_3.7.0       purrr_0.3.4      
[29] magrittr_2.0.1    ps_1.6.0          promises_1.2.0.1  ellipsis_0.3.2   
[33] htmltools_0.5.1.1 mime_0.11         xtable_1.8-4      renv_0.13.2      
[37] httpuv_1.6.1      cachem_1.0.5      crayon_1.4.1 
jas1 commented 2 years ago

I could reproduce what Jeffrey mentioned ,

Got a same issue, in linux pressing Ctrl+F3 , try to switch to other workspace,

can we customize the key bindings somehow ? My linux version is: Linux mint 20 , desktop version: xfce

I Used the same Reprex as jeffrey, My system specs are a little different.

R version 4.1.2 (2021-11-01) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Linux Mint 20

Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0 LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=es_AR.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=es_AR.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=es_AR.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] stats graphics grDevices datasets utils methods base

loaded via a namespace (and not attached): [1] Rcpp_1.0.7 RColorBrewer_1.1-2 later_1.3.0 pillar_1.6.4 compiler_4.1.2 targets_0.8.1
[7] tools_4.1.2 digest_0.6.28 lifecycle_1.0.1 tibble_3.1.6 pkgconfig_2.0.3 rlang_0.4.11
[13] igraph_1.2.6 shiny_1.7.1 cli_3.0.1 crosstalk_1.1.1 yaml_2.2.1 xfun_0.26
[19] fastmap_1.1.0 stringr_1.4.0 withr_2.4.2 knitr_1.34 vctrs_0.3.8 htmlwidgets_1.5.4 [25] rprojroot_2.0.2 leaflet_2.0.4.1 tidyselect_1.1.1 glue_1.5.0 data.table_1.14.2 here_1.0.1
[31] R6_2.5.1 processx_3.5.2 fansi_0.5.0 callr_3.7.0 purrr_0.3.4 magrittr_2.0.1
[37] promises_1.2.0.1 codetools_0.2-18 ps_1.6.0 ellipsis_0.3.2 htmltools_0.5.2 xtable_1.8-4
[43] mime_0.11 httpuv_1.6.3 renv_0.14.0 dotenv_1.0.3 utf8_1.2.2 tinytex_0.33
[49] stringi_1.7.4 crayon_1.4.1

schloerke commented 2 years ago

Thank you for the breakdown + reprex!

I'm not sure if this is the intended (and thus an issue with the documentation)

Here is the logic: https://github.com/rstudio/shiny/blob/a8c14dab9623c984a66fcd4824d8d448afb151e7/srcts/src/shiny/reactlog.ts#L7 (Return early if not f3, not ctrl key and not meta key, has shift key, and has alt key)

I believe it is a documentation issue.


Can we customize the key bindings somehow?

No. (I'd like to keep it consistent / not alter the built javascript files. )