Conversation
|
BTW, I'm working on the failing tests. |
|
I still have some tests to fix, but PTAL at the unresolved comment above and LMKWYT! The changes are grouped here: ...though it maybe be easier to just read the commits above, as they're pretty well isolated. |
Sweet, all looks good to me! |
…ix a margin bug for st.markdown inside st.container inside st.columns.
|
@tconkling : I have no idea how to update these Custom Component tests... I tried locally but they fail and it's unclear why. Is there a trick for these? (I also don't know why they're failing when I didn't touch them anything related to them! Perhaps they were never updated to the latest fonts a few months ago?) |
|
I'll take a look. I don't think it's an issue with tests not being properly updated in the past, because other CircleCI runs are succeeding on these tests. I wonder if perhaps some CSS changes in this PR are affecting something about the component iframe's frame? |
|
YES!!!! All tests pass! Merging before Cypress changes its mind. |
📚 Context
Many months ago, I was working on visual updates for Streamlit and found that
Block.tsxneeded a little cleaning up. I proposed this on Slack and was OKed to pursue it. At the time, I sent out an early PR to show the work I was talking about #3583 , but never finished it. So this is me finally doing the last bit of work on that.What kind of change does this PR introduce?
🧠 Description of Changes
This is mostly a refactor of
Block.tsxinto several React components, rather than 1 component plus several bespoke functions. This way we end up with a more canonical React-style code, with better use of React's DOM diffing, no need to passkeys around, and (I think!) much easier to read.This also makes it so we only ever need an
<AutoSizer>component when we have a<VerticalBlock>, because that's the only kind of component that holds Streamlit elements directly (and elements are the only things that need to know their widths, so they need the autosizer).This also cleans up the way we used to insert vertical padding between consecutive elements in an app. This vertical space used to live all over the place (forms, expandable, containers, blocks) but now it's been unified to only live at StyledVerticalBlock.
Finally, this removes a stray parenthesis in
ThemedApp.tsxRevised:
Insert screenshot of your updated UI/code here
Current:
Insert screenshot of existing UI/code here
🧪 Testing Done
🌐 References
Does this depend on other work, documents, or tickets?
Nope.
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.