Skip to content

Fixes reporter bug where buttons would appear in other tabs when reporter is NULL - #1738

Merged
averissimo merged 8 commits into
mainfrom
1727-fix_reporter2
Sep 17, 2026
Merged

averissimo merged 8 commits into
mainfrom
1727-fix_reporter2

Conversation

@averissimo

Copy link
Copy Markdown
Contributor

Pull Request

Fixes #1727

Alternative approach: #1737

Changes description

  • Remove all elements of "Add to report" in modules, instead of just one

Copilot AI lite review requested due to automatic review settings September 15, 2026 11:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Scope the reporter-control removal to the current server instance to avoid affecting other instances.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Fixes reporter UI cleanup when reporter = NULL, with regression tests and NEWS documentation.

Changes:

  • Remove reporter controls across module tabs.
  • Add end-to-end coverage.
  • Document the fix.
File summaries
File Summary
tests/testthat/test-shinytest2-init.R Adds coverage for reporter control visibility.
R/module_teal.R Removes reporter controls, but the unscoped selector can affect other ui_teal() instances.
NEWS.md Documents the bug fix.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread R/module_teal.R Outdated
@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Unit Tests Summary

  1 files   36 suites   2m 40s ⏱️
487 tests 417 ✅ 70 💤 0 ❌
754 runs  684 ✅ 70 💤 0 ❌

Results for commit 61f9359.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Unit Test Performance Difference

Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
shinytest2-init 👶 $+0.09$ e2e_init_reporter_buttons_is_displayed_when_report_is_non_null
shinytest2-init 👶 $+0.09$ e2e_init_reporter_buttons_is_not_displayed_when_report_is_null

Results for commit 7dd038b

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

badge

Code Coverage Summary

Filename                          Stmts    Miss  Cover    Missing
------------------------------  -------  ------  -------  -----------------------------------------------------------------------------------------------------
R/after.R                            59      21  64.41%   42-52, 64, 69, 77-79, 81-89, 100, 104-105
R/checkmate.R                        24       0  100.00%
R/decorators-helpers.R               59       1  98.31%   113
R/dummy_functions.R                  61       2  96.72%   54, 56
R/include_css_js.R                   11       0  100.00%
R/init.R                            136       0  100.00%
R/module_bookmark_manager.R          99      54  45.45%   78-133
R/module_data_summary.R             177       8  95.48%   40, 50, 205, 236-240
R/module_filter_data.R               64       0  100.00%
R/module_filter_manager.R           210       7  96.67%   119-120, 316, 343, 355, 362-363
R/module_nested_tabs.R              411      42  89.78%   120, 178-183, 211, 315-330, 350-354, 409, 527-530, 534-537, 541-544
R/module_session_info.R              18       0  100.00%
R/module_snapshot_manager.R         276       9  96.74%   315-319, 386, 389-391
R/module_source_code.R               69       0  100.00%
R/module_teal_lockfile.R            131      53  59.54%   45-57, 60-62, 76, 86-88, 100-102, 110-119, 122, 124, 126-127, 142-146, 161-162, 177-186
R/module_teal_reporter.R            122       9  92.62%   60, 77-78, 81, 98, 128, 142, 144, 158
R/module_teal.R                     310      26  91.61%   137, 186, 242, 272-292, 322-323
R/module_transform_data.R           164      25  84.76%   77-81, 85-89, 106, 112, 119-120, 134-138, 188, 273-277
R/module_validate_error.R            73       0  100.00%
R/modules.R                         345      50  85.51%   170-174, 229-232, 332, 339, 353, 472, 570-576, 706-712, 725-733, 748-763, 796, 808-816
R/reporter_previewer_module.R        41      12  70.73%   41, 45, 68-85
R/teal_data_module-eval_code.R       23       0  100.00%
R/teal_data_module-within.R           7       0  100.00%
R/teal_data_module.R                 23       0  100.00%
R/teal_data_utils.R                  49       0  100.00%
R/teal_modifiers.R                   57       0  100.00%
R/teal_slices-store.R                29       0  100.00%
R/teal_slices.R                      48       2  95.83%   153-154
R/teal_transform_module.R            45       0  100.00%
R/TealAppDriver.R                   364     255  29.95%   68-73, 126, 134-163, 194-203, 213, 228-276, 301-576, 604-629, 684, 686-689, 708-722, 739-740, 751-768
R/utils.R                           290      48  83.45%   404-453, 541-550
R/validate_inputs.R                  57       0  100.00%
R/validations.R                      58       0  100.00%
R/zzz.R                              21       0  100.00%
TOTAL                              3931     624  84.13%

Diff against main

Filename             Stmts    Miss  Cover
-----------------  -------  ------  -------
R/module_teal.R         +1       0  +0.03%
R/TealAppDriver.R       +1       0  +0.19%
TOTAL                   +2       0  +0.01%

Results for commit: 61f9359

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

averissimo and others added 3 commits September 15, 2026 14:23
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: André Veríssimo <211358+averissimo@users.noreply.github.com>

@osenan osenan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! Honestly I do not perceive a visual improvement in the alternative approach

@averissimo

Copy link
Copy Markdown
Contributor Author

@osenan You can see on this video, the menu and "add to report" disappear at the start of the app

Comment thread R/module_teal.R
@osenan

osenan commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

@osenan You can see on this video, the menu and "add to report" disappear at the start of the app

I tried myself both PR versions on my machine, but it is only my perception. By the way, did you forget to add a link to a video? The solution works, here and in the alternative approach, I checked myself it works.

@averissimo

averissimo commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

I did @osenan here it is, you can notice that the buttons are rendered in the UI once I refresh the page

Any teal app with reporter = NULL shows this behavior

teal::init(
  data = teal.data::teal_data() |>  within(IRIS <- iris),
  reporter = NULL,
  modules = list(
    teal::example_module(),
    teal::example_module(),
    teal::example_module()
  )
) |> shiny::runApp()
Screencast.From.2026-09-16.14-41-53.mp4

@averissimo
averissimo merged commit 3f8b45f into main Sep 17, 2026
27 of 28 checks passed
@averissimo
averissimo deleted the 1727-fix_reporter2 branch September 17, 2026 13:24
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: init(reporter = NULL) only removed the Add to Report button in the first module

3 participants