quarto-dev / quarto-dev/quarto-cli

Dashboard: bslib::value_box() ignores `#| expandable: false` and shows Expand button

Open
#14,719 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug dashboards
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

I have:
  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide
Bug description

In a format: dashboard document, a cell that outputs a bslib component such as bslib::value_box() shows an "Expand" (full-screen) button in the bottom-right corner even when the cell sets #| expandable: false. A Quarto-native value box, or a plain plot(), correctly honours the option and shows no button.

Reported in discussion #14714. Root cause traced below.

Steps to reproduce
---
format: dashboard
---

## Column

```{r}
#| expandable: false
bslib::value_box(title = "x", value = 1, theme = "primary")
```
Actual behavior

The value box renders with an "Expand" button; #| expandable: false has no effect.

Root cause (against v1.9.38, SHA 6ebb5db80eb542ac76189c3d7c33ae6f654b93d2):

  1. When a cell outputs raw bslib- HTML, dashboard.lua captures it into bslibRawOutputs and re-emits it "unharmed". The cell's card options are read via readOptions(el)/makeCard(...) but applied only to the remaining non-bslib content, so #| expandable: false never reaches the value box and no data-expandable attribute is emitted on it.

  2. In HTML post-processing, processCards handles every .card, including the bslib value box. With no data-expandable attribute present, defaultValue decides: it suppresses the button only for elements with Quarto's own class kValueboxClass ("valuebox") or a flow layout. A bslib value box uses bslib-value-box, so the check misses and the fallback returns dashboardMeta.expandable, which defaults to true, injecting Quarto's own Expand button (kExpandBtnHtml).

Because the button is Quarto's, passing full_screen = FALSE to bslib::value_box() does not remove it.

Expected behavior

#| expandable: false on a cell that outputs a bslib::value_box() (or any bslib card) should suppress the Expand button, matching the behaviour of Quarto-native value boxes.

Your environment
  • OS: Ubuntu 24.04
  • bslib: 0.11.0.9000

(Environment as reported in discussion #14714.)

Quarto check output

Quarto 1.9.38 (as reported in discussion #14714). Root cause verified against source at tag v1.9.38 and reproduces on main. Full quarto check output was not provided by the original reporter.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproducer in the issue, then read dashboard.lua around bslibRawOutputs and format-dashboard-card.ts around processCards/defaultValue, along with format-dashboard-shared.ts. Verify the dashboard output for a bslib::value_box() cell using #| expandable: false; done means the Quarto Expand button is absent, matching a native value box.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, r, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.