diff --git a/app.py b/app.py index 92e000c..a19f40e 100644 --- a/app.py +++ b/app.py @@ -76,11 +76,18 @@ with col1: st.warning("Keine .xlsx-Dateien im input/-Ordner gefunden.") selected_input = None else: - selected_input = st.selectbox( - "Input-Datei wählen:", - options=[""] + input_files, - format_func=lambda x: "– Bitte wählen –" if x == "" else x, - ) + # Bei nur einer Datei: automatisch selektieren (keine Leerauswahl) + if len(input_files) == 1: + selected_input = st.selectbox( + "Input-Datei wählen:", + options=input_files, + ) + else: + selected_input = st.selectbox( + "Input-Datei wählen:", + options=[""] + input_files, + format_func=lambda x: "– Bitte wählen –" if x == "" else x, + ) if selected_input: input_path = Path(app_config.input_dir) / selected_input @@ -157,11 +164,18 @@ with col2: real_templates = [t for t in template_files if not t.startswith("~")] if not real_templates: real_templates = template_files - selected_template = st.selectbox( - "Template wählen:", - options=[""] + real_templates, - format_func=lambda x: "– Bitte wählen –" if x == "" else x, - ) + # Bei nur einem Template: automatisch selektieren (keine Leerauswahl) + if len(real_templates) == 1: + selected_template = st.selectbox( + "Template wählen:", + options=real_templates, + ) + else: + selected_template = st.selectbox( + "Template wählen:", + options=[""] + real_templates, + format_func=lambda x: "– Bitte wählen –" if x == "" else x, + ) if selected_template: # Nur validieren wenn sich das Template geändert hat