### Bug description

In a book project with repo actions defined, if a chapter has a TOC, the repo action icon will not appear in the footer if the page is displayed in mobile view.

Chapters without a TOC will display the icon as expected.

### Steps to reproduce

Create a book project:

```
$ quarto create-project mybook --type book
$ quarto preview mybook
```

Edit _quarto.yml so it appears as follows:

```
project:
  type: book

book:
  title: "mybook"
  author: "Norah Jones"
  date: "6/5/2023"
  repo-url: "https://github.com/quarto-dev/quarto-web/"
  repo-actions: [source]
  chapters:
    - index.qmd
    - intro.qmd
    - summary.qmd
    - references.qmd

bibliography: references.bib

format:
  html:
    theme: cosmo
  pdf:
    documentclass: scrreprt
```

When the project re-renders and I navigate the the Preface page, the github "View Source" icon is visible in the TOC.

Switch to mobile view in the newly rendered project (ctrl-shift-m for Firefox)

### Expected behavior

On the Preface page, I expect to see the github icon with "View Source" label in the footer when in mobile view.

### Actual behavior

The github icon on the Preface page is missing.  It appears in the footer on all the other chapter pages in mobile view, because they don't have a TOC.

### Your environment

- Quarto version 1.4.122
- OS: Kubuntu 20.04

### Quarto check output

````
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.2: OK
      Dart Sass version 1.55.0: OK
      Deno version 1.33.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.4.122
      Path: /opt/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.8.10
      Path: /usr/bin/python3
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

      There is an unactivated Python environment in systemd-private-90e163f7653b4f69ae913301b284ec8a-systemd-resolved.service-YMBMlh. Did you forget to activate it?

[✓] Checking R installation...........OK
      Version: 4.2.1
      Path: /usr/lib/R
      LibPaths:
        - /usr/local/lib/R/site-library
        - /usr/lib/R/site-library
        - /usr/lib/R/library
      knitr: 1.37
      rmarkdown: 2.11

[✓] Checking Knitr engine render......OK
````
dragonstyle
2023-06-05T16:36:54Z
blacksqr
bug books triaged-to
open
Repo actions in book proj not visible in mobile view
https://github.com/quarto-dev/quarto-cli/issues/5818