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

Need a modal to display errors to TADAShiny users #178

Open
5 tasks
JamesBisese opened this issue Nov 26, 2024 · 1 comment
Open
5 tasks

Need a modal to display errors to TADAShiny users #178

JamesBisese opened this issue Nov 26, 2024 · 1 comment
Assignees

Comments

@JamesBisese
Copy link
Collaborator

JamesBisese commented Nov 26, 2024

Is your feature request related to a problem? Please describe.

There are fatal error conditions that leave the UI unresponsive. At a minimum there needs to be a UI element to display the cause of the error to the developer and possibly to the user (if the error is still untrapped)

Describe the solution you'd like

I'd like a to have an observable for all errors generated by TADA. the TADA code should assign a value to the observable that then triggers displaying an error modal. There should be some way to control the modal content so it is useful during development but can be 'turned down' for users so they get a more bland message with instructions on how to report the problem if they want to.

The modal should be used from shinyWidgets - which is implemented using 'Sweet Alerts'. TADAShiny already uses shinyWidgets.

library(shinyWidgets)

shiny::observeEvent(tadat$error, {
show_alert("Error!", "There is an error and I need to understand how to fix it", type = "error")
})

Describe alternatives you've considered

I imagine that this code already exists or is part of the golem package, I just don't see it being implemented.

shiny::observeEvent(tadat$error, {
 shiny::showModalError(shiny::modalDialog(
    title = "(Fatal Error/User Error/...)",
  paste("An error occurred.  It has this value", tadat$error.UserError)
})

Additional context

There are Fatal Errors and non-Fatal Errors. They each have a different result and so this will get complex
to manage. Some error conditions can be processed so the user basically is forced to 'start over'.
Others are probably not recoverable, and the UI needs to have a best way to display that to the user.

Reminders for TADA contributors addressing this issue

New features and/or edits should include the following work:

  • Create or edit the code.

  • Document all code using line/inline and/or multi-line/block comments
    to describe what is does.

  • Create or edit tests in tests/testthat folder to help prevent and/or
    troubleshoot potential future issues.

  • If your code edits impact other functionality in the shiny
    app, ensure those are updated as well.

  • Run styler::style_pkg(), devtools::document(), and devtools::check()
    and address any new notes or issues before creating a pull request.

@JamesBisese JamesBisese self-assigned this Dec 5, 2024
@JamesBisese
Copy link
Collaborator Author

This is entirely covered under "Need a way to trap errors generated in TADA and prevent them from stopping TADAShiny #179"
LOE included in other ticket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants