Repository navigation
fix: restore pre-#3682 visibility semantics - #4376
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Restores Shiny’s historical client-side “hidden” semantics for .clientdata_output_*_hidden after the observer refactor in #3682, avoiding behavior changes caused by Element.checkVisibility() for transiently boxless/script-only outputs.
Changes:
- Removes the
checkVisibility()fast-path fromisVisible()and reverts to the prior recursive visibility logic. - Rebuilds the generated
inst/www/shared/shiny.jsandinst/www/shared/shiny.min.jsbundles to reflect the updated logic.
Reviewed changes
Copilot reviewed 2 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| srcts/src/utils/index.ts | Removes checkVisibility() usage from isVisible() to restore legacy visibility semantics. |
| inst/www/shared/shiny.js | Updates built JS bundle to match the restored isVisible() behavior. |
| inst/www/shared/shiny.min.js | Updates minified bundle to remove checkVisibility() usage and match restored semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a follow-up to #3682, which replaced jQuery event-driven output info updates with per-output observers.
That change also switched Shiny's visibility helper to
Element.checkVisibility(). In practice, that changes the meaning of "hidden" for clientdata/output handling in ways that break existing downstream behavior for outputs that are active but transiently boxless or script-only.This PR restores the prior recursive visibility behavior:
display: noneWhy
Downstream Playwright coverage in py-shiny found regressions in existing behavior alongside the new observer coverage:
Restoring the old visibility semantics preserves the observer refactor while avoiding the hidden-state behavior change.
Implementation
checkVisibility()branch fromisVisible()shiny.jsandshiny.min.jsNotes
A browser-native visibility concept may still be useful, but it should likely be introduced separately from
.clientdata_output_*_hiddensemantics rather than replacing the historical Shiny behavior implicitly.