Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add teal app modifiers and deprecate init args #1440

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

vedhav
Copy link
Contributor

@vedhav vedhav commented Jan 7, 2025

Closes #1310

Changes

  • The title, header, and footer are soft deprecated in favor of using add_title, add_header, add_footer, and add_landing_popup
  • Adds a new add_custom_server modifier to add custom server logic to the main shiny app.
  • Reverts the usage of landing_popup_module to the previous way by passing it inside the modules

Example app with the new app modifiers.

devtools::load_all("teal")

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 = "setosa")
  )
) |>
  add_title("Custom title") |>
  add_header(
    tags$div(
      h3("Header with a button that can be observed!"),
      actionButton("notify", "Show notification")
    )
  ) |>
  add_footer("Custom footer") |>
   add_landing_popup(
      content = "Popup content",
      buttons = modalButton("Proceed")
   ) |>
  add_custom_server(function(input, output, session) {
    observeEvent(input$notify, {
      showNotification("Yes, the button works!")
    })
  })

shinyApp(app$ui, app$server)

@vedhav vedhav added the core label Jan 7, 2025
Copy link
Contributor

github-actions bot commented Jan 7, 2025

Unit Tests Summary

  1 files   27 suites   2m 34s ⏱️
275 tests 213 ✅ 62 💤 0 ❌
438 runs  376 ✅ 62 💤 0 ❌

Results for commit 65a7e10.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
module_teal 💔 $147.40$ $+2.99$ $0$ $0$ $0$ $0$
shinytest2-data_summary 💚 $49.72$ $-49.65$ $-1$ $+6$ $0$ $0$
shinytest2-decorators 💚 $21.67$ $-21.64$ $-7$ $+2$ $0$ $0$
shinytest2-filter_panel 💚 $41.18$ $-41.14$ $-2$ $+3$ $0$ $0$
shinytest2-init 💚 $26.54$ $-26.50$ $-14$ $+3$ $0$ $0$
shinytest2-landing_popup 💚 $43.49$ $-43.43$ $-6$ $+5$ $0$ $0$
shinytest2-module_bookmark_manager 💚 $34.20$ $-34.15$ $0$ $+4$ $0$ $0$
shinytest2-modules 💚 $37.61$ $-37.56$ $-1$ $+4$ $0$ $0$
shinytest2-reporter 💚 $66.50$ $-66.43$ $-3$ $+5$ $0$ $0$
shinytest2-show-rcode 💚 $10.33$ $-10.32$ $-6$ $+1$ $0$ $0$
shinytest2-teal_data_module 💚 $47.44$ $-47.37$ $-2$ $+6$ $0$ $0$
shinytest2-teal_slices 💚 $60.53$ $-60.51$ $-16$ $+2$ $0$ $0$
shinytest2-utils 💚 $10.15$ $-10.14$ $-3$ $+1$ $0$ $0$
shinytest2-wunder_bar 💚 $21.15$ $-21.12$ $-2$ $+2$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
module_teal 💔 $17.19$ $+1.88$ creation_process_is_invoked_for_teal.lockfile.mode_enabled_and_snapshot_is_copied_to_teal_app.lock_and_removed_after_session_ended
shinytest2-data_summary 💚 $8.49$ $-8.49$ e2e_data_summary_just_list_the_unfilterable_objects_at_the_bottom_when_provided
shinytest2-data_summary 💚 $8.15$ $-8.14$ e2e_data_summary_table_displays_datasets_by_names_order_if_no_join_keys
shinytest2-data_summary 💚 $7.98$ $-7.96$ e2e_data_summary_table_displays_datasets_by_topological_sort_of_join_keys
shinytest2-data_summary 💚 $9.35$ $-9.34$ e2e_data_summary_table_does_not_list_unsupported_objects
shinytest2-data_summary 💚 $7.76$ $-7.74$ e2e_data_summary_table_is_displayed_with_2_columns_data_without_keys
shinytest2-data_summary 💚 $7.99$ $-7.98$ e2e_data_summary_table_is_displayed_with_3_columns_for_data_with_join_keys
shinytest2-decorators 💚 $11.12$ $-11.10$ e2e_module_with_decorator_UI_and_output_is_modified_interactively_upon_changes_in_decorator
shinytest2-decorators 💚 $10.55$ $-10.54$ e2e_module_with_decorator_where_server_fails_shows_shiny_error_message
shinytest2-filter_panel 💚 $15.47$ $-15.46$ e2e_filtering_a_module_specific_filter_is_not_refected_in_other_unshared_modules
shinytest2-filter_panel 💚 $15.66$ $-15.65$ e2e_filtering_a_module_specific_filter_is_reflected_in_other_shared_module
shinytest2-filter_panel 💚 $10.04$ $-10.03$ e2e_module_content_is_updated_when_data_is_filtered_in_filter_panel
shinytest2-init 💚 $8.01$ $-8.00$ e2e_init_creates_UI_containing_specified_title_favicon_header_and_footer
shinytest2-init 💚 $8.25$ $-8.24$ e2e_teal_app_initializes_with_no_errors
shinytest2-init 💚 $10.28$ $-10.27$ e2e_teal_app_initializes_with_sessionInfo_modal
shinytest2-landing_popup 💚 $8.30$ $-8.29$ e2e_app_with_customized_landing_popup_module_creates_modal_containing_specified_title_content_and_buttons
shinytest2-landing_popup 💚 $8.09$ $-8.08$ e2e_app_with_default_landing_popup_module_creates_modal_containing_a_button
shinytest2-landing_popup 💚 $8.29$ $-8.28$ e2e_teal_app_with_landing_popup_module_initializes_with_no_errors
shinytest2-landing_popup 💚 $8.08$ $-8.07$ e2e_when_customized_button_in_landing_popup_module_is_clicked_it_redirects_to_a_certain_page
shinytest2-landing_popup 💚 $10.72$ $-10.71$ e2e_when_default_landing_popup_module_is_closed_it_shows_the_underlying_teal_app
shinytest2-module_bookmark_manager 💚 $7.95$ $-7.93$ bookmark_manager_button_is_not_rendered_by_default
shinytest2-module_bookmark_manager 💚 $7.98$ $-7.97$ bookmark_manager_button_is_not_rendered_when_enableBookmarking_url_
shinytest2-module_bookmark_manager 💚 $7.98$ $-7.97$ bookmark_manager_button_is_rendered_when_enableBookmarking_server_
shinytest2-module_bookmark_manager 💚 $10.29$ $-10.28$ bookmark_manager_button_shows_modal_with_url_containing_state_id_when_clicked
shinytest2-modules 💚 $8.17$ $-8.16$ e2e_all_the_nested_teal_modules_are_initiated_as_expected
shinytest2-modules 💚 $10.00$ $-9.99$ e2e_filter_panel_only_shows_the_data_supplied_using_datanames
shinytest2-modules 💚 $10.04$ $-10.02$ e2e_filter_panel_shows_all_the_datasets_when_datanames_is_all
shinytest2-modules 💚 $9.41$ $-9.39$ e2e_the_module_server_logic_is_only_triggered_when_the_teal_module_becomes_active
shinytest2-reporter 💚 $17.91$ $-17.89$ e2e_adding_a_report_card_in_a_module_adds_it_in_the_report_previewer_tab
shinytest2-reporter 💚 $18.39$ $-18.37$ e2e_reporter_does_not_show_the_secondary_column_that_shows_filter_panel
shinytest2-reporter 💚 $13.62$ $-13.61$ e2e_reporter_previewer_module_do_not_show_data_summary_nor_filter_panel
shinytest2-reporter 💚 $8.01$ $-7.98$ e2e_reporter_tab_is_created_when_a_module_has_reporter
shinytest2-reporter 💚 $8.57$ $-8.56$ e2e_reporter_tab_is_not_created_when_a_module_has_no_reporter
shinytest2-show-rcode 💚 $10.33$ $-10.32$ e2e_teal_app_initializes_with_Show_R_Code_modal
shinytest2-teal_data_module 💚 $8.22$ $-8.21$ e2e_teal_data_module_gets_removed_after_successful_data_load_when_once_TRUE
shinytest2-teal_data_module 💚 $11.67$ $-11.65$ e2e_teal_data_module_inputs_change_teal_data_object_that_is_passed_to_teal_main_UI
shinytest2-teal_data_module 💚 $7.65$ $-7.64$ e2e_teal_data_module_is_still_visible_after_successful_data_load_when_once_FALSE
shinytest2-teal_data_module 💚 $5.33$ $-5.32$ e2e_teal_data_module_shows_validation_errors
shinytest2-teal_data_module 💚 $8.97$ $-8.95$ e2e_teal_data_module_will_have_a_delayed_load_of_datasets
shinytest2-teal_data_module 💚 $5.61$ $-5.59$ e2e_teal_data_module_will_make_other_tabs_inactive_before_successful_data_load
shinytest2-teal_slices 💚 $23.42$ $-23.41$ e2e_teal_slices_filters_are_initialized_when_global_filters_are_created
shinytest2-teal_slices 💚 $37.11$ $-37.10$ e2e_teal_slices_filters_are_initialized_when_module_specific_filters_are_created
shinytest2-utils 💚 $10.15$ $-10.14$ e2e_show_hide_hamburger_works_as_expected
shinytest2-wunder_bar 💚 $10.51$ $-10.49$ wunder_bar_srv_clicking_filter_icon_opens_filter_manager_modal
shinytest2-wunder_bar 💚 $10.64$ $-10.63$ wunder_bar_srv_clicking_snapshot_icon_opens_snapshot_manager_modal

Results for commit ece008e

♻️ This comment has been updated with latest results.

@vedhav vedhav marked this pull request as draft January 7, 2025 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move landing popup feature back to the modules argument
1 participant