Skip to content

Redesign and change position of reporter options#1562

Merged
vedhav merged 41 commits into
mainfrom
redesign-ui-ux@main
Jul 24, 2025
Merged

Redesign and change position of reporter options#1562
vedhav merged 41 commits into
mainfrom
redesign-ui-ux@main

Conversation

@vedhav

@vedhav vedhav commented Jul 14, 2025

Copy link
Copy Markdown
Contributor

Companion of insightsengineering/teal.reporter#360
Closes #1539

In this PR:

  • reporter menu accessible as a dropdown with preview, downlaod, load and reset buttons
  • reporter_previewer_module to be deprecated and download args like global_knitr rmd_yaml_args, rmd_output etc. will be controlled by options
  • Introduced .teal_navbar to create a navigation bar and .teal_navbar_menu to create a dropdown menu.

@vedhav vedhav added the core label Jul 14, 2025
@github-actions

github-actions Bot commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

Unit Tests Summary

  1 files   25 suites   2m 3s ⏱️
260 tests 210 ✅ 50 💤 0 ❌
445 runs  395 ✅ 50 💤 0 ❌

Results for commit ebe959d.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
module_teal 💔 $97.75$ $+4.22$ $-1$ $0$ $0$ $0$
report_previewer_module 💀 $0.04$ $-0.04$ $-8$ $0$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
module_teal 💀 $0.24$ $-0.24$ receives_one_report_previewer_module_when_any_module_contains_reporter_argument
report_previewer_module 💀 $0.00$ $-0.00$ report_previewer_module_default_label_is_Report_previewer_
report_previewer_module 💀 $0.01$ $-0.01$ report_previewer_module_does_not_accept_server_args_out_of_formals_teal.reporter_reporter_previewer_srv_
report_previewer_module 💀 $0.01$ $-0.01$ report_previewer_module_has_specific_classes
report_previewer_module 💀 $0.01$ $-0.01$ report_previewer_module_throws_error_if_label_is_not_string
report_previewer_module 💀 $0.01$ $-0.01$ report_previewer_module_throws_no_error_and_stores_label_if_label_is_string

Results for commit 169dd5c

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

badge

Code Coverage Summary

Filename                          Stmts    Miss  Cover    Missing
------------------------------  -------  ------  -------  ---------------------------------------------------------------------------------------------------------------------------------------------
R/checkmate.R                        24       0  100.00%
R/dummy_functions.R                  67      11  83.58%   46, 48, 90-98
R/include_css_js.R                   11      11  0.00%    12-37
R/init.R                            146     100  31.51%   137-158, 188-196, 206-235, 238-239, 246-255, 258-267, 270-279, 283-293, 295
R/landing_popup_module.R             34      34  0.00%    22-57
R/module_bookmark_manager.R         153     122  20.26%   47-58, 78-133, 138-139, 151, 198, 233-310
R/module_data_summary.R             177      10  94.35%   25-26, 40, 50, 205, 236-240
R/module_filter_data.R               64       2  96.88%   22-23
R/module_filter_manager.R           229      56  75.55%   56-61, 72-81, 89-94, 107-111, 116-117, 290-313, 339, 366, 378, 385-386
R/module_init_data.R                 74       6  91.89%   38-43
R/module_nested_tabs.R              363     206  43.25%   68-98, 125, 140-320, 352, 470-473, 477-480, 484-487, 502, 536, 589-592
R/module_session_info.R              18       7  61.11%   35-41
R/module_snapshot_manager.R         265     194  26.79%   89-94, 103-112, 120-144, 163-164, 181-204, 208-223, 225-232, 239-269, 273, 277-281, 283-289, 292-305, 308-316, 346-360, 363-374, 377-391, 404
R/module_teal_data.R                149      76  48.99%   43-149
R/module_teal_lockfile.R            131      69  47.33%   33-37, 45-57, 60-62, 76, 86-88, 92-96, 100-102, 110-119, 122, 124, 126-127, 142-146, 161-162, 177-186, 196-201
R/module_teal_with_splash.R          33      33  0.00%    24-61
R/module_teal.R                     206      84  59.22%   50-115, 133, 144-145, 186, 204-220, 222
R/module_transform_data.R           116       7  93.97%   20, 46, 130-134
R/modules.R                         291      53  81.79%   174-178, 233-236, 360-380, 388, 394, 571-577, 590-598, 613-628, 661, 674
R/reporter_previewer_module.R        40      40  0.00%    22-84
R/show_rcode_modal.R                 31      31  0.00%    17-49
R/tdata.R                            14      14  0.00%    19-61
R/teal_data_module-eval_code.R       24       0  100.00%
R/teal_data_module-within.R           7       0  100.00%
R/teal_data_module.R                 20       0  100.00%
R/teal_data_utils.R                  10       0  100.00%
R/teal_modifiers.R                   71      71  0.00%    26-214
R/teal_reporter.R                    70       8  88.57%   69, 77-82, 131-132, 135, 152
R/teal_slices-store.R                29       0  100.00%
R/teal_slices.R                      63       0  100.00%
R/teal_transform_module.R            45       0  100.00%
R/TealAppDriver.R                   385     385  0.00%    57-772
R/utils.R                           283      60  78.80%   400-449, 497-508, 529-538
R/validate_inputs.R                  32       0  100.00%
R/validations.R                      58      37  36.21%   118-406
R/zzz.R                              16      12  25.00%   4-19
TOTAL                              3749    1739  53.61%

Diff against main

Filename                         Stmts    Miss  Cover
-----------------------------  -------  ------  -------
R/init.R                            +4      +4  -0.89%
R/module_bookmark_manager.R         -8      -8  +1.01%
R/module_filter_manager.R           -1      -1  +0.33%
R/module_nested_tabs.R              -3      -9  +1.99%
R/module_snapshot_manager.R        +49     +48  -5.61%
R/module_teal.R                    +43     +27  -5.81%
R/modules.R                         -6       0  -0.37%
R/reporter_previewer_module.R      +21     +38  -89.47%
R/utils.R                          +33     +22  -6.00%
R/zzz.R                             +1      +1  -1.67%
TOTAL                             +133    +122  -1.67%

Results for commit: ebe959d

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@averissimo

Copy link
Copy Markdown
Contributor

Not sure if it fits here, but the module$path of reporter is not updated so the data-value is set to "temporary label"

image

I'm applying the following patch on #1559 as this is picked by e2e tests, but it also fits in this PR

diff --git a/R/reporter_previewer_module.R b/R/reporter_previewer_module.R
index 19b707b34..758c1736c 100644
--- a/R/reporter_previewer_module.R
+++ b/R/reporter_previewer_module.R
@@ -43,6 +43,7 @@ reporter_previewer_module <- function(label = "Report previewer", server_args =
   # This is to prevent another module being labeled "Report previewer".
   class(module) <- c(class(module), "teal_module_previewer")
   module$label <- label
+  module$path <- label
   attr(module, "teal_bookmarkable") <- TRUE
   module
 }

Comment thread R/module_teal.R Outdated
vedhav and others added 14 commits July 15, 2025 14:54
- use preview_report_button_ui/srv
- deprecate reporter_previewer_module
Target: `redesign-ui-ux@main` branch

### Changes description

- Add count number to the "Module" navigation label

### Screenshots

#### More than 1 module

<img width="429" height="182" alt="image"
src="https://github.com/user-attachments/assets/b427e118-5bc1-4d3f-b811-90936b5bd7ba"
/>

<img width="666" height="408" alt="image"
src="https://github.com/user-attachments/assets/364e8353-9bc9-45b8-99dc-fc876ec8e999"
/>

#### 1 module

<img width="666" height="408" alt="image"
src="https://github.com/user-attachments/assets/c124786d-e180-4294-a9d4-7c9a720d86aa"
/>

### Example code

```r
pkgload::load_all("../teal.reporter") # branch: redesign-ui-ux
pkgload::load_all("../teal") # branch: module_count@redesign-ui-ux@main

init(
  data = teal_data(iris = iris, bla = list(123)),
  modules = modules(
    example_module("yada"), 
    modules(
      label = "label",
      example_module(), 
      example_module(), 
      modules(
        label = "label2",
        example_module()
      )
    ), 
    example_module()
  )
) |> runApp()
```
@vedhav
vedhav force-pushed the redesign-ui-ux@main branch from d8485a6 to 8292330 Compare July 23, 2025 09:20
vedhav and others added 5 commits July 23, 2025 16:33
Refurnishing the code in module_teal and module_teal_module

- Renamed `ui/srv_teal_module` to `.ui/srv_teal_module` as wrapper
`ui/srv_teal_module` module
- Introduced a wrapper module `ui/srv_teal_module` which gathers all
nav-link(s) and tab-pane(s) and initialize input$active_module_id.
"Wrapper module" returns fully functional navigation bar with switchable
tabs
- Output from "wrapper module" (`ui_teal_module`) returns a navbar to
`ui_teal` where stuff can be appended/inserted to.

---------

Co-authored-by: vedhav <vedhaviyash4@gmail.com>
Comment thread NAMESPACE
Comment thread NEWS.md Outdated
vedhav and others added 2 commits July 24, 2025 11:58
Co-authored-by: Dawid Kałędkowski <dawid.kaledkowski@gmail.com>
Signed-off-by: Vedha Viyash <49812166+vedhav@users.noreply.github.com>
@vedhav
vedhav force-pushed the redesign-ui-ux@main branch from d837ff6 to a383aa5 Compare July 24, 2025 06:42
@vedhav
vedhav enabled auto-merge (squash) July 24, 2025 06:59

@gogonzo gogonzo 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.

Ready to go after resolving comments. Thanks Vedha 🥳

@llrs-roche llrs-roche 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.

I checked the code and left some comments. Feel free to resolve them to be able to merge this as I didn't really review well the PR and the UI on the deployed apps look good that is the really important change :D

Comment thread NEWS.md
Comment thread R/module_teal.R
Comment thread R/reporter_previewer_module.R Outdated
Comment thread NAMESPACE
@vedhav
vedhav merged commit feced71 into main Jul 24, 2025
28 checks passed
@vedhav
vedhav deleted the redesign-ui-ux@main branch July 24, 2025 09:13
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 24, 2025
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.

[Question]: When to show "Report Previewer" tab?

4 participants