Migrate ITables Streamlit component to st.components.v2#521
Draft
Migrate ITables Streamlit component to st.components.v2#521
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #521 +/- ##
==========================================
- Coverage 94.06% 93.71% -0.35%
==========================================
Files 47 47
Lines 2560 2563 +3
==========================================
- Hits 2408 2402 -6
- Misses 152 161 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thank you for making this pull request. Did you know? You can try it on Binder: Also, the version of ITables developed in this PR is available as a wheel artifact 📦 for easy installation. A conda package is also available for easy installation: |
Co-authored-by: mwouts <29915202+mwouts@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Transition ITables' streamlit component to st.components.v2
Migrate ITables Streamlit component to st.components.v2
Mar 7, 2026
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.
ITables' Streamlit integration was using the v1 custom component API. This migrates it to
st.components.v2, which renders inline (no iframe) and uses a cleaner function-based lifecycle.Frontend (
packages/itables_for_streamlit/)src/index.cssstreamlit-component-lib→@streamlit/component-v2-lib(types only — v2 runtime is provided by the Streamlit host)index.tsxfrom event-based v1 (RENDER_EVENT/setComponentValue/setFrameHeight) to a v2FrontendRendererdefault export that creates the table on mount and returns a cleanup functionPython (
src/itables/streamlit.py)declare_component(name, path=...)→components.v2.component(name, js=..., css=..., isolate_styles=False)isolate_styles=Falsekeeps styles in the main DOM — required for DataTables popups/fixed-header elements that are appended todocument.bodydata={"dt_args": ..., "other_args": ...}; return type isBidiComponentResult(dict-like, backwards-compatible access viaresult["selected_rows"]orresult.selected_rows)Config
pyproject.toml: Added[tool.streamlit.component]manifest entry; updatedensured-targetsfor the new output filenamesapps/streamlit/itables_app.py: ReplacedMarshallComponentException(v1-only) withStreamlitAPIExceptionWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
docs.streamlit.io/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
st.components.v2#511💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.