Skip to content

Introduce introjs to show an app #1702

Merged
donyunardi merged 9 commits into
mainfrom
1680_introjs@main
Mar 11, 2026
Merged

Introduce introjs to show an app #1702
donyunardi merged 9 commits into
mainfrom
1680_introjs@main

Conversation

@llrs-roche

Copy link
Copy Markdown
Contributor

Pull Request

Fixes #1680

Uses the first app to show how a teal app works.

WIP: Some ids do not work well.

I couldn't make an app to stop do something and continue on the next step.

@llrs-roche llrs-roche added the core label Mar 2, 2026
@llrs-roche
llrs-roche marked this pull request as ready for review March 6, 2026 13:05
@llrs-roche
llrs-roche requested a review from a team March 6, 2026 13:05
@github-actions

github-actions Bot commented Mar 6, 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%   97
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      54  86.86%   117-129, 178-183, 211, 315-330, 350-354, 372, 409, 527-530, 534-537, 541-544
R/module_session_info.R              18       0  100.00%
R/module_snapshot_manager.R         272       9  96.69%   302-306, 373, 376-378
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                     303      28  90.76%   129, 144-145, 178, 234, 264-284, 314-315
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                   355     355  0.00%    50-753
R/utils.R                           291      49  83.16%   38, 408-457, 545-554
R/validate_inputs.R                  32       0  100.00%
R/validations.R                      58       0  100.00%
R/zzz.R                              20       0  100.00%
TOTAL                              3886     739  80.98%

Diff against main

Filename      Stmts    Miss  Cover
----------  -------  ------  --------
TOTAL             0       0  +100.00%

Results for commit: 41c2cbd

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@github-actions

github-actions Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Unit Tests Summary

  1 files   30 suites   2m 25s ⏱️
452 tests 405 ✅ 47 💤 0 ❌
713 runs  662 ✅ 51 💤 0 ❌

Results for commit 41c2cbd.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
module_session_info 💚 $18.72$ $-1.01$ $0$ $0$ $0$ $0$
shinytest2-disable_report 💀 $0.38$ $-0.38$ $-4$ $-4$ $0$ $0$
shinytest2-disable_src 💀 $0.19$ $-0.19$ $-2$ $-2$ $0$ $0$
shinytest2-show-rcode 💀 $0.28$ $-0.28$ $-3$ $-3$ $0$ $0$
shinytest2-teal_modifiers 💀 $0.56$ $-0.56$ $-7$ $-7$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
module_session_info 💚 $18.70$ $-1.13$ srv_session_info_lockfile_creation_process_is_invoked_for_teal.lockfile.mode_enabled_and_snapshot_is_copied_to_teal_app.lock_and_removed_after_session_ended
shinytest2-decorators 👶 $+0.03$ unnamed
shinytest2-disable_report 💀 $0.10$ $-0.10$ Add_to_report_button_is_not_disabled_by_default.
shinytest2-disable_report 💀 $0.09$ $-0.09$ Report_button_is_active_on_a_nested_module_by_default
shinytest2-disable_report 💀 $0.09$ $-0.09$ Report_button_is_disabled_on_a_module_changed_by_disable_report_
shinytest2-disable_report 💀 $0.09$ $-0.09$ Report_button_is_disabled_on_nested_modules_changed_by_disable_report_
shinytest2-disable_src 💀 $0.10$ $-0.10$ Show_R_Code_button_is_disabled_on_a_module
shinytest2-disable_src 💀 $0.09$ $-0.09$ Show_R_Code_is_disabled_on_nested_modules_changed_with_disable_src
shinytest2-reporter 👶 $+0.01$ unnamed
shinytest2-show-rcode 💀 $0.09$ $-0.09$ e2e_Module_with_Show_R_Code_has_code
shinytest2-show-rcode 💀 $0.09$ $-0.09$ e2e_Module_with_Show_R_Code_has_modal_with_two_dismiss_and_two_copy_to_clipboard_buttons
shinytest2-show-rcode 💀 $0.09$ $-0.09$ e2e_Module_with_Show_R_Code_initializes_with_visible_button
shinytest2-teal_data_module 👶 $+0.01$ unnamed
shinytest2-teal_modifiers 💀 $0.07$ $-0.07$ e2e_add_landing_modal_displays_landing_modal_on_app_startup
shinytest2-teal_modifiers 💀 $0.07$ $-0.07$ e2e_add_landing_modal_modal_can_be_dismissed
shinytest2-teal_modifiers 💀 $0.12$ $-0.12$ e2e_combined_modifiers_displays_all_customizations_when_chained_together
shinytest2-teal_modifiers 💀 $0.07$ $-0.07$ e2e_modify_footer_displays_custom_footer_in_the_app
shinytest2-teal_modifiers 💀 $0.07$ $-0.07$ e2e_modify_header_displays_custom_header_in_the_app
shinytest2-teal_modifiers 💀 $0.07$ $-0.07$ e2e_modify_title_sets_custom_title_in_the_page_title_head_title_displays_custom_favicon_in_the_app
shinytest2-teal_modifiers 💀 $0.08$ $-0.08$ e2e_modify_title_sets_custom_title_in_the_page_title_head_title_displays_custom_title_in_the_app

Results for commit 58dde17

♻️ This comment has been updated with latest results.

@donyunardi donyunardi self-assigned this Mar 9, 2026
@donyunardi

donyunardi commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

I'm trying to add my code as a review but it creates a really long comment section and hard to follow. Therefore, I'll just put my review as a comment.

I think the intro looks good and simple enough, however, I would like to suggest on improving the flow (starting from the teal app title).

Kapture 2026-03-10 at 21 57 22

Here's the full app code:

Code
library(teal)
library(shiny)

app <- init(
  data = teal_data(IRIS = iris, MTCARS = mtcars),
  modules = modules(
    example_module("Module 1"),
    example_module("Module 2")
  ),
  filter = teal_slices(
    teal_slice(dataname = "IRIS", varname = "Species", selected = "virginica")
  )
) |>
  modify_title("My first teal application") |>
  modify_header(tags$div(
    tags$head(
      tags$link(
        rel = "stylesheet",
        href = "https://unpkg.com/intro.js/introjs.css"
      ),
      tags$style(HTML("
      .introjs-tooltip {
        background-color: white !important;
        border: 1px solid #ccc !important;
        border-radius: 5px !important;
        padding: 15px !important;
        box-shadow: 0 4px 6px rgba(0,0,0,0.3) !important;
        min-width: 250px !important;
        max-width: 400px !important;
      }

      .introjs-tooltip {
        z-index: 10000000 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: absolute !important;
      }
      .introjs-overlay {
        z-index: 9999999 !important;
        opacity: 0.8 !important;
      }
      .introjs-helperLayer {
        z-index: 9999998 !important;
      }
      .introjs-tooltipbuttons {
        display: block !important;
      }
      .introjs-button {
        display: inline-block !important;
      }
    ")),
      tags$script(
        src = "https://unpkg.com/intro.js/intro.js"
      ),
      # nolint start line_length_linter.
      tags$script(HTML('
      $(document).on("shiny:connected", function() {
        setTimeout(function() {
          console.log("Starting intro.js tour");
          introJs.tour().setOptions({
            steps: [
              {
                intro: "Welcome! This short tour will walk you through the key features of this teal application. Click Next to get started."
              },
              {
                element: "#teal-header",
                intro: "This is the title of your teal application."
              },
              {
                element: ".teal.dropdown-button",
                intro: "Use this dropdown to switch between available analysis modules."
              },
              {
                element: "#teal-teal_modules-nav-module_1-wrapper > div:first-child > div:first-child",
                intro: "This breadcrumb shows your current location in the app and which analysis module is active."
              },
              {
                element: "#teal-teal_modules-nav-module_1-data_summary_accordion",
                intro: "The Active Data Summary gives you an overview of the datasets currently loaded in the application."
              },
              {
                element: "#teal-teal_modules-nav-module_1-filter_panel-filters-main_filter_accordion",
                intro: "Use the Filter Data area to subset your datasets and refine the data used by each analysis.<br><br><ul><li>Click the <b>+</b> button to add a new column to filter on.</li><li>Select which values to include or exclude from the dataset.</li><li>Click the <b>x</b> button next to a filter to remove it from the dataset.</li></ul>"
              },
              {
                element: "#teal-teal_modules-nav-module_1-teal_module_ui > div.container-fluid.teal-widgets.standard-layout-wrapper > div > div > aside.sidebar",
                intro: "Input parameters for the active analysis are displayed here. Adjust them to update the output."
              },
              {
                element: "#teal-teal_modules-nav-module_1-teal_module_ui > div.container-fluid.teal-widgets.standard-layout-wrapper > div > div > div.main",
                intro: "Plots, tables, and statistics generated by the active analysis are displayed in this area."
              },
              {
                element: "#teal-teal_modules-nav-module_1-add_reporter_wrapper-report_add_wrapper",
                intro: "Happy with the current analysis? Click Add to Report to save it for later export."
              },
              {
                element: "#teal-reporter_menu_container",
                intro: "Open the Report menu to view, edit, organize, and export all analyses you have added to your report."
              },
              {
                element: "#teal-teal_modules-nav-module_1-source_code_wrapper-source_code-button",
                intro: "Click Show R Code to view the underlying R code that generated the current analysis output."
              },
              {
                element: "#teal-snapshot_manager_panel-show_snapshot_manager > span.icon",
                intro: "Use the Snapshot Manager to save your current inputs and settings so you can easily recreate this analysis later."
              },
              {
                element: "#teal-filter_manager_panel-show_filter_manager > span.icon",
                intro: "The Filter Manager shows a matrix of all active filters and which modules each filter is applied to."
              },
              {
                element: "#teal-footer-session_info-sessionInfo-button",
                intro: "Click Session Info to view details about the current R version and loaded packages."
              },
              {
                element: "#teal-footer-session_info-identifier",
                intro: "This app identifier helps support teams locate and diagnose this specific instance of the application.",
              },
              {
                intro: "That\'s the end of the tour! If anything was unclear, feel free to reach out for help.",
                dontShowAgain: true
              },
            ],
            showProgress: true,
            showBullets: false,
            exitOnOverlayClick: false,
            doneLabel: "Done",
            nextLabel: "Next →",
            prevLabel: "← Back"
          }).start();
        }, 2000);
      });
    '))
    ),
    # nolint end.
    h3("My first teal application")
  )) |>
  modify_footer(tags$div(a("Powered by teal", href = "https://insightsengineering.github.io/teal/latest-tag/")))

shinyApp(app$ui, app$server)

@donyunardi
donyunardi requested review from donyunardi and removed request for a team March 11, 2026 04:59

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

See previous comment.

@llrs-roche

Copy link
Copy Markdown
Contributor Author

I saw you unified the introduction about filters, I like that.
I updated the code with the code on the comment.

@donyunardi
donyunardi merged commit 7c0c531 into main Mar 11, 2026
28 checks passed
@donyunardi
donyunardi deleted the 1680_introjs@main branch March 11, 2026 19:49
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 11, 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.

create teal user guide using intro.js

2 participants