chore: migrate use_container_width → width (Streamlit deprecation)

``use_container_width`` is being removed after 2025-12-31. Streamlit
log was flooding the terminal with the deprecation notice on every
rerun. Mechanical sweep:

  use_container_width=True   →  width="stretch"
  use_container_width=False  →  width="content"

51 call sites across 11 page files + ``app_demo.py``. Also renamed
the ``local_download_button`` helper's ``use_container_width`` kwarg
to ``width`` (default ``"stretch"``); it has no external callers
passing the old name, so this is a safe rename.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-18 22:43:52 +00:00
parent e011c0b6e6
commit 61e63913cb
12 changed files with 54 additions and 54 deletions

View File

@@ -98,7 +98,7 @@ _has_result = st.session_state.get("colmap_result") is not None
with st.expander(f"Preview: {uploaded.name}", expanded=not _has_result):
st.caption(f"{len(df)} rows, {len(df.columns)} columns")
st.dataframe(df.head(10), use_container_width=True)
st.dataframe(df.head(10), width="stretch")
st.divider()
# ---------------------------------------------------------------------------
@@ -165,7 +165,7 @@ with st.expander("Options", expanded=not _has_result):
})
edited = st.data_editor(
initial,
use_container_width=True,
width="stretch",
num_rows="dynamic",
column_config={
"name": st.column_config.TextColumn("Target name"),
@@ -276,7 +276,7 @@ with st.expander("Options", expanded=not _has_result):
})
rename_edited = st.data_editor(
rename_initial,
use_container_width=True,
width="stretch",
column_config={
"source": st.column_config.TextColumn("Source", disabled=True),
"target": st.column_config.TextColumn("Target"),
@@ -304,7 +304,7 @@ with st.expander("Options", expanded=not _has_result):
})
map_edited = st.data_editor(
map_initial,
use_container_width=True,
width="stretch",
column_config={
"source": st.column_config.TextColumn("Source", disabled=True),
"target": st.column_config.SelectboxColumn(
@@ -332,7 +332,7 @@ with st.expander("Options", expanded=not _has_result):
st.divider()
if st.button("Apply Column Mapping", type="primary", use_container_width=True):
if st.button("Apply Column Mapping", type="primary", width="stretch"):
with st.spinner("Mapping..."):
try:
result = map_columns(df, options)
@@ -400,10 +400,10 @@ if result.mapping:
for s, t in result.mapping.items()
],
)
st.dataframe(map_df, use_container_width=True, hide_index=True)
st.dataframe(map_df, width="stretch", hide_index=True)
st.markdown("**Mapped preview (first 10 rows)**")
st.dataframe(result.mapped_df.head(10), use_container_width=True)
st.dataframe(result.mapped_df.head(10), width="stretch")
# ---------------------------------------------------------------------------
# Downloads