Skip to content

fix: restore pre-#3682 visibility semantics - #4376

Merged
cpsievert merged 1 commit into
mainfrom
followup-revert-checkvisibility
Apr 28, 2026
Merged

cpsievert merged 1 commit into
mainfrom
followup-revert-checkvisibility

Conversation

@cpsievert

Copy link
Copy Markdown
Collaborator

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:

  • visible if the element has non-zero size
  • hidden only when the element or an ancestor has display: none

Why

Downstream Playwright coverage in py-shiny found regressions in existing behavior alongside the new observer coverage:

  • busy indicator state
  • dynamic destroy/status stabilization
  • module output update expectations

Restoring the old visibility semantics preserves the observer refactor while avoiding the hidden-state behavior change.

Implementation

  • remove the checkVisibility() branch from isVisible()
  • rebuild shiny.js and shiny.min.js

Notes

A browser-native visibility concept may still be useful, but it should likely be introduced separately from .clientdata_output_*_hidden semantics rather than replacing the historical Shiny behavior implicitly.

Copilot AI 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.

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 from isVisible() and reverts to the prior recursive visibility logic.
  • Rebuilds the generated inst/www/shared/shiny.js and inst/www/shared/shiny.min.js bundles 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.

@cpsievert
cpsievert merged commit 719f3c8 into main Apr 28, 2026
16 checks passed
@cpsievert
cpsievert deleted the followup-revert-checkvisibility branch April 28, 2026 21:07
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

Successfully merging this pull request may close these issues.

2 participants