diff --git a/src/streamlit_app.py b/src/streamlit_app.py index 1cc58f7..2378779 100644 --- a/src/streamlit_app.py +++ b/src/streamlit_app.py @@ -1,4 +1,5 @@ import streamlit as st +from streamlit import components import os import logging import warnings @@ -521,10 +522,27 @@ if st.session_state.error_log: error_text = "\n\n".join([f"File: {path}\nError: {error}" for path, error in st.session_state.error_log.items()]) st.text_area("Error Details", error_text, height=200) - # Add copy button - if st.button("Copy Error Log"): - st.write("Error log copied to clipboard!") - st.session_state.error_log_copied = error_text + # Add copy button with JavaScript to copy to clipboard + copy_button = st.button("Copy Error Log") + if copy_button: + # Create a JavaScript function to copy the text + js_code = f""" + + """ + st.components.v1.html(js_code, height=0) + st.success("✅ Error log copied to clipboard!") # Add clear button if st.button("Clear Error Log"):