Bugfix/32#42
Conversation
Approaches I tried before this bugfixThese were two approaches I tried by using an
|
| it("checks the empty state component follows slider from id", { | ||
| app <- shinytest2::AppDriver$new(test_slider_app(), name = "slide_tag") | ||
| app$expect_values() | ||
| app$click("toggle_pannel") | ||
| app$expect_values() | ||
| app$stop() | ||
| }) | ||
| }) |
There was a problem hiding this comment.
This test is useless.
- You have not included the snapshots generated by
app$expected_values(), so the tests are not run against the reference, they only generate references. - Even with the snapshots, this test only verifies the values of inputs and outputs, which means that the only thing that you test is if the button was clicked. You are not testing the position of the empty state container.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #42 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 45 45
=========================================
Hits 45 45 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jakubnowicki
left a comment
There was a problem hiding this comment.
Please check my comments.
|
|
||
| The example below showcases the example of using a dynamic trigger slider that changes. | ||
|
|
||
| The function `shiny_emptystate_updatePosition` updates the position of the #container1 after being re-positioned |
There was a problem hiding this comment.
Please make it clear that this function is 1. JS 2. comes withshiny.emptystate.
| resizeObserver.unobserve(elementToReplace); | ||
| } | ||
|
|
||
| function shiny_emptystate_updatePosition(id){ |
There was a problem hiding this comment.
Please change the name of the function to follow camel case, instead of a weird hybrid. updateElementPosition should work here.
|
|
||
| # Introduction | ||
|
|
||
| `shiny.emptystate` is capable of being used for dynamic positioning trigger animations. This is specially interesting when we have UIs that change position and we want to keep the `emptystate` in the appropriate tag |
There was a problem hiding this comment.
| `shiny.emptystate` is capable of being used for dynamic positioning trigger animations. This is specially interesting when we have UIs that change position and we want to keep the `emptystate` in the appropriate tag | |
| `shiny.emptystate` is capable of being used for dynamic positioning trigger animations. This is specially useful when we have UIs that change position and we want to keep the `emptystate` in the appropriate tag |
|
|
||
| # Animation example | ||
|
|
||
| The example below showcases the example of using a dynamic trigger slider that changes. |
There was a problem hiding this comment.
Please explain this in more detail. Also, inform the reader what would happen without the updatePosition function.
| - icon: fa-file-code-o | ||
| href: index.html | ||
| tutorials: | ||
| text: Tutorials |
There was a problem hiding this comment.
The new article is not a tutorial, but a small guide. Change this to "Articles".
|
|
||
| it("checks the empty state component follows slider from id", { | ||
| app <- shinytest2::AppDriver$new(test_slider_app(), name = "slide_tag") | ||
| position_1 <- app$get_html(selector = "#container2") |
There was a problem hiding this comment.
This is not a position, but a full HTML. The variable name is misleading.
| app <- shinytest2::AppDriver$new(test_slider_app(), name = "slide_tag") | ||
| position_1 <- app$get_html(selector = "#container2") | ||
| app$click("toggle_pannel") | ||
| position_2 <- app$get_html(selector = "#container2") |
There was a problem hiding this comment.
This is not a position, but a full HTML. The variable name is misleading.
| position_1 <- app$get_html(selector = "#container2") | ||
| app$click("toggle_pannel") | ||
| position_2 <- app$get_html(selector = "#container2") | ||
| expect_false(position_1 == position_2) |
There was a problem hiding this comment.
As you compare the whole HTML, this may be a false positive (some other parts of HTML will change).
|
|
||
| `shiny.emptystate` is capable of being used for dynamic positioning trigger animations. This is specially interesting when we have UIs that change position and we want to keep the `emptystate` in the appropriate tag | ||
|
|
||
| **Note:** This solution is only available for instant positioning animation. |
There was a problem hiding this comment.
Please include the solution for the animations, provided in the issue comments.

Have you read the Contributing Guidelines?
Issue #32
Changes description
shiny_emptystate_updatePositionthat updates the position of the empty container when the selected tag id is triggeredExample:
Clearly and concisely describe what's in this pull request. Include screenshots, if necessary.