From 8c6e95d720b88ab30ef3695dd7c85ff2bb17d5d3 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Fri, 15 May 2026 15:37:09 -0700 Subject: [PATCH 1/3] respect theme `mar` overrides by user --- R/tinyplot.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/tinyplot.R b/R/tinyplot.R index f27cf80f..e15b1193 100644 --- a/R/tinyplot.R +++ b/R/tinyplot.R @@ -995,6 +995,7 @@ tinyplot.default = function( .bp = environment(.h)[["base_par"]] if (is.list(.bp)) .tpars = modifyList(.tpars, .bp) } + if (!is.null(.tpars[["mar"]])) .theme_mar = .tpars[["mar"]] # Detect outer-legend sides (order: bottom, left, top, right). .lgnd_pos = settings$legend_args[["x"]] From 3d8bbdd111e095867cbe8e6ab3933c85551924e5 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Fri, 15 May 2026 15:37:30 -0700 Subject: [PATCH 2/3] claude tweak (unrelated) --- CLAUDE.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index bc7f0b67..ea650582 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -143,8 +143,11 @@ Non-snapshot tests (logical assertions, error checks, etc.) run fine on any plat This is a known quirk — don't worry about these specific persistent failures. However, if you see more than ~3 snapshot failures, something real is likely broken and needs investigation. ### Running Tests + +The canonical test workflow is to open the devcontainer and run `make testall`. Do not attempt to run the full test suite outside the devcontainer — snapshot tests will fail due to font/rendering differences, and even non-snapshot tests may pull in snapshot comparisons. + ```bash -# Via Makefile +# Via Makefile (inside devcontainer) make testall # Run all tests make testone testfile="inst/tinytest/test-legend.R" # Run single test file From ac57cf8158c6dcc97b7c3cd0af7892205fa94e32 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Fri, 15 May 2026 15:44:16 -0700 Subject: [PATCH 3/3] add test --- .../tinytheme_dynmar_mar_override.svg | 80 +++++++++++++++++++ inst/tinytest/test-tinytheme.R | 9 +++ 2 files changed, 89 insertions(+) create mode 100644 inst/tinytest/_tinysnapshot/tinytheme_dynmar_mar_override.svg diff --git a/inst/tinytest/_tinysnapshot/tinytheme_dynmar_mar_override.svg b/inst/tinytest/_tinysnapshot/tinytheme_dynmar_mar_override.svg new file mode 100644 index 00000000..94c2b225 --- /dev/null +++ b/inst/tinytest/_tinysnapshot/tinytheme_dynmar_mar_override.svg @@ -0,0 +1,80 @@ + + + + + + + + + + + + + +Custom mar override +Index +0:10 + + + + + + +2 +4 +6 +8 +10 + + + + + + + +0 +2 +4 +6 +8 +10 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inst/tinytest/test-tinytheme.R b/inst/tinytest/test-tinytheme.R index f71f8338..9584c772 100644 --- a/inst/tinytest/test-tinytheme.R +++ b/inst/tinytest/test-tinytheme.R @@ -178,3 +178,12 @@ f = function() { plt_add(type = "b") } expect_snapshot_plot(f, label = "ephemeral_default_theme_add") + +# User mar override respected under dynmar (#587) +f = function() { + tinytheme("dynamic", mar = c(5, 5, 5, 5)) + plt(0:10, main = "Custom mar override") + box("inner", lty = 2) + tinytheme() +} +expect_snapshot_plot(f, label = "tinytheme_dynmar_mar_override")