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.26% 94.28% +0.01%
==========================================
Files 47 47
Lines 2617 2623 +6
==========================================
+ Hits 2467 2473 +6
Misses 150 150 ☔ 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: |
|
@copilot Can you group the dependabot alerts ? |
Added
|
|
@copilot You should rebase on main. Also, can you start a new development version - bump the version number to 2.8.0.dev0 and add an entry in the changelog ? Finally you need to fix the CI (update the pixi lock file and commit it). |
|
@copilot the CI failed. It says Can you make sure to activate |
Done in commit d450efe:
Note: Warning 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: mwouts <29915202+mwouts@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mwouts/itables/sessions/eccc1a94-61aa-4f60-82a1-59e02ab8e50e Co-authored-by: mwouts <29915202+mwouts@users.noreply.github.com>
Co-authored-by: mwouts <29915202+mwouts@users.noreply.github.com>
…te pixi.lock Agent-Logs-Url: https://github.com/mwouts/itables/sessions/39b6c6f6-fbd7-47b9-a729-1620918a2288 Co-authored-by: mwouts <29915202+mwouts@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mwouts/itables/sessions/ed1095a0-50a9-4e39-8c26-de4e4d3c9929 Co-authored-by: mwouts <29915202+mwouts@users.noreply.github.com>
b7ed6a0 to
6694a26
Compare
|
I have reported the issue with |
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 & Housekeeping
pyproject.toml: Added[tool.streamlit.component]manifest entry; updatedensured-targetsfor the new output filenamesapps/streamlit/itables_app.py: ReplacedMarshallComponentException(v1-only) withStreamlitAPIException.github/dependabot.yml: Added Dependabot configuration with grouped updates for pip, each npm package directory, and GitHub Actionssrc/itables/version.py: Bumped version to2.8.0.dev0docs/changelog.md: Added2.8.0 (unreleased)entry for this migrationpixi.lock: Updated to reflect the new development versionOriginal prompt
st.components.v2#511💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.