arnaudmiribel / streamlit-extras

Discover, try, install and share Streamlit re-usable bits we call "extras"!
https://extras.streamlit.app
Apache License 2.0
669 stars 117 forks source link

Update data-testid as we recently changed it with a migration from Enzyme to React-Testing-Library needs #197

Closed willhuang1997 closed 8 months ago

willhuang1997 commented 8 months ago

The Streamlit team updated the data-testid and as a result, 1.28.0 streamlit release doesn't work with streamlit-extras as the data-testid changed. I tested it locally and looks like changing the data-testid, as i suspected, fixed the problem.

Screenshot 2023-11-01 at 4 10 28 PM
netlify[bot] commented 8 months ago

Deploy Preview for phenomenal-crepe-0effec ready!

Name Link
Latest commit 026349eed79bb5693070ff5156b51baacb66495d
Latest deploy log https://app.netlify.com/sites/phenomenal-crepe-0effec/deploys/6543d86e4720d10008c54b52
Deploy Preview https://deploy-preview-197--phenomenal-crepe-0effec.netlify.app/extras/metric_cards
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

willhuang1997 commented 8 months ago

Hey @willhuang1997 thanks a ton for submitting this! Is there any way that this fix could also work with prior streamlit versions? As is, it would only work with >= 1.28

Currently, we're not pinning streamlit to be the latest with streamlit-extras. Let me know what you think

Probably just a more inclusive CSS pattern to include both would just work. Don't think there would be conflicts

@arnaudmiribel Hey that's a good point. Thanks for mentioning that. I adjusted the PR to include streamlit versions <= 1.27.2 too by just adding the data-testid only. I tested that it works locally by installing streamlit==1.27.0 and 1.28.0 and checking that the metric style cards are showing the right color.