diff --git a/src/gui/components.py b/src/gui/components.py index 0a54324..8946ce1 100644 --- a/src/gui/components.py +++ b/src/gui/components.py @@ -422,21 +422,33 @@ def match_group_card( f"{', '.join(differing_cols)}" ) - # Status + # Status + surviving rows preview if len(checked) == 0: st.warning("Select at least one row to keep.") - elif len(checked) == n_rows: - st.caption("Keeping all rows (no duplicates removed)") - elif len(checked) == 1: - st.caption( - f"Merging into Row {checked[0] + 1}, " - f"removing {n_rows - 1} row(s)" - ) else: - st.caption( - f"Keeping {len(checked)} rows, " - f"removing {n_rows - len(checked)}" - ) + if len(checked) == n_rows: + st.caption("Keeping all rows (no duplicates removed)") + elif len(checked) == 1: + st.caption( + f"Merging into Row {checked[0] + 1}, " + f"removing {n_rows - 1} row(s)" + ) + else: + st.caption( + f"Keeping {len(checked)} rows, " + f"removing {n_rows - len(checked)}" + ) + + # Build preview of surviving rows with edits applied + checked_positions = [ + i for i, idx in enumerate(group.row_indices) + if idx in checked + ] + preview = edited.iloc[checked_positions].drop( + columns=["Keep"], + ).reset_index(drop=True) + st.markdown("**Surviving rows preview:**") + st.dataframe(preview, use_container_width=True, hide_index=True) # Confirm def _on_confirm(