quarto-dev / quarto-dev/quarto-cli
Dashboard: bslib::value_box() ignores `#| expandable: false` and shows Expand button
Nobody has claimed this yet.
- 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):
-
When a cell outputs raw
bslib-HTML,dashboard.luacaptures it intobslibRawOutputsand re-emits it "unharmed". The cell's card options are read viareadOptions(el)/makeCard(...)but applied only to the remaining non-bslibcontent, so#| expandable: falsenever reaches the value box and nodata-expandableattribute is emitted on it. -
In HTML post-processing,
processCardshandles every.card, including thebslibvalue box. With nodata-expandableattribute present,defaultValuedecides: it suppresses the button only for elements with Quarto's own classkValueboxClass("valuebox") or a flow layout. Abslibvalue box usesbslib-value-box, so the check misses and the fallback returnsdashboardMeta.expandable, which defaults totrue, 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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