devOpifex/leprechaun

Inconsistent UI between test from run after devtools and run after loading library

Closed this issue · 4 comments

Hi, and thanks for this nice package

There seems to be an inconsistency when running an app with devtools::document() ; devtools::load_all() ; run() as described in your quick start guide and running from empty env after library(myapp).

Code to reproduce behavior and screenshot :

behavior 1

# make app as package
usethis::create_package("myapp")
leprechaun::scaffold()
# run it like in quick start from leprechaun doc
devtools::document()
devtools::load_all()
run()

test_with_devtools_run

behavior 2

#then install it
devtools::install()

from a new R session :

library(myapp)
run()

test_with_library_run


My sessionInfo :

> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.3 LTS

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=fr_FR.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=fr_FR.UTF-8        LC_COLLATE=fr_FR.UTF-8    
 [5] LC_MONETARY=fr_FR.UTF-8    LC_MESSAGES=fr_FR.UTF-8   
 [7] LC_PAPER=fr_FR.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C       

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

loaded via a namespace (and not attached):
[1] compiler_4.1.2

If it helps the discussion, it appears that the CSS that is being applied is different in each of the two cases.

Case 1: <h1> only styled by bootstrap
Case 2: CSS rules from R.css

Further investigation suggests that when you install the package, you get a CSS file alongside the 00Index.html for styling the documentation. Your serveAssets functions is listing all CSS files within the package so is picking this up.

Ah, thank you!

No problem