Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Feb 23, 2021

Closes #2585.

Per the linked issue, previous attempts at using data-stale were causing a snapshot failure. The reason was that Block components have a transition on opacity, so even after data-stale turns false, the element is still in the process of gaining opacity. I fixed this with .invoke("css", "opacity", "1").

Why this wasn't a problem when we were using the .stale-element class, I don't know.

@ghost ghost marked this pull request as ready for review February 25, 2021 18:22
@ghost ghost self-requested a review February 25, 2021 18:22
<Maybe enable={enable} key={key}>
<StyledElementContainer
data-stale={isStale}
data-stale={!!isStale}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it need to be cast to bool?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the test we assume the value is either "true" or "false" (e.g. .should("have.attr", "data-stale", "false") so I didn't want it to print values like null or undefined. I didn't investigate where isStale comes from though, not sure if it's already guaranteed to be a bool.

@ghost ghost merged commit bebf7b9 into streamlit:develop Feb 25, 2021
@ghost ghost deleted the remove-stale-element branch February 25, 2021 20:01
tconkling added a commit that referenced this pull request Mar 1, 2021
* develop: (29 commits)
  Update bug_report.md
  Refactor CodeBlock.tsx (#2814)
  Remove copy button for empty codeblocks (#2808)
  Add image format deprecation config with expiration (#2865)
  Remove unneeded "use_column_width=True" from our doc examples (#2692)
  Extend our st.cache MagicMock handling logic to Mock (#2846)
  save work (#2862)
  Remove .stale-element class (#2848)
  Release 0.77 (#2849)
  Fix watchdog import failure (#2856)
  🔥 Fully remove `format` param from st.image (#2637)
  Don't memoize config._server_headless (#2858)
  hide empty columns on mobile (#2756)
  st.beta_secrets (#2757)
  `watch_file` utility function (#2851)
  Align st.beta_columns  (#2811)
  Update "showErrorDetails" config description and docs (#2841)
  Pause Dependabot updates for non-security-related issues (#2840)
  client.showTracebacks -> showErrorDetails (per product) (#2837)
  Color picker - show value (#2817)
  ...
This pull request was closed.
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.

Review/fix st.pyplot E2E test

1 participant