quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.92k stars 322 forks source link

`quarto preview` does not update all pages when project-wide contents change #10392

Open victorrssx opened 3 months ago

victorrssx commented 3 months ago

Bug description

The problem initially occurred at Quarto books that I've been writing. After I make changes to a specific chapter and click 'Render', Quarto renders the document correctly, but RStudio does not show the new file in the viewer pane (the old one remains). It only updates when I stop the background job and render it again.

I tried changing every single piece of the yaml file to track down where the problem was but I was unsuccessful (which gave me a intuinton that the problem was not in that part). So I decided to create a new Quarto book project from scratch and add small changes to see when it would happen again.

Curiously the default Quarto book doesn't have this problem. But when I changed the default _quarto.yaml chapters part (code above), then the problem returned!

micro1ppge_test - RStudio 2024-07-26 12-57-39 (2)

Also I noticed some things:

  1. when _quarto.yaml is modified and changes saved, the document updates automatically
  2. the problem doesn't happen in standalone documents

Steps to reproduce

  1. Create a new Quarto Book project
  2. Create a test.qmd file with one 'Test' h1 header
  3. Change the default _quarto.yaml chapters part to
  chapters:
    - index.qmd

    - part: summary.qmd
      chapters: 
        - test.qmd
  1. Open the test.qmd file and click on 'Render' button to run the current document
  2. Change the header, write some text and render again

After this process only sidebar chapter title and breadcrumb should have changed (at least here)

Expected behavior

Changes should be addressed and displayed in the RStudio viewer panel.

Actual behavior

Changes are effectively made only after stop background job and render the document again.

Your environment

RStudio Edition : Desktop
RStudio Version : 2024.04.2+764
OS Version      : Windows 10 x64
R Version       : 4.4.1

Quarto check output

Quarto 1.5.55
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.2.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.41.0: OK
      Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.5.55
      Path: C:\Users\Victor\AppData\Local\Programs\Quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: (external install)
      Chromium: (not installed)

[>] Checking LaTeX....................OK
      Using: TinyTex
      Path: C:\Users\Victor\AppData\Roaming\TinyTeX\bin\windows\
      Version: 2024

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.10.7
      Path: C:/Users/Victor/AppData/Local/Programs/Python/Python310/python.exe
      Jupyter: 5.7.2
      Kernels: python3

[>] Checking Jupyter engine render....OK

(-) Checking R installation...........Carregando pacotes exigidos: pacman
[>] Checking R installation...........OK
      Version: 4.4.1
      Path: C:/PROGRA~1/R/R-44~1.1
      LibPaths:
        - C:/Users/Victor/AppData/Local/R/win-library/4.4
        - C:/Program Files/R/R-4.4.1/library
      knitr: 1.47
      rmarkdown: 2.27

[>] Checking Knitr engine render......OK
cscheid commented 3 months ago

I don't think this is an RStudio bug. This is a quarto preview bug more generally, where we fail to rerender some parts of the document that are project-wide.

drtingtp commented 3 months ago

I have met the same issue and created a minimal producible repo for it: https://github.com/drtingtp/quarto-cli-issue-10392

Additional information

  1. Setting project > preview > nagivate as false does not disable the auto navigate behaviour.

    _quarto.yml:

    project:
        preview:
            navigate: false
  2. ...

    Actual behavior

    Changes are effectively made only after stop background job and render the document again.

    ...

    For my case, without stopping the preview session, saving the _quarto.yml file will trigger a refresh that renders the preview correctly again.