diff --git a/src/epicc/__main__.py b/src/epicc/__main__.py index 3ff4dc5..efd831d 100644 --- a/src/epicc/__main__.py +++ b/src/epicc/__main__.py @@ -31,6 +31,114 @@ load_styles() initialize_state() +# Normalize action-row button alignment (button vs popover trigger) +st.markdown( + """ + + """, + unsafe_allow_html=True, +) + all_models = get_all_models() model_registry: dict[str, BaseSimulationModel] = {m.human_name(): m for m in all_models} @@ -107,16 +215,12 @@ render_validation_error(selected_label, exc, container=param_col) has_input_errors = True - # Reset and Save Parameters buttons side by side - button_col1, button_col2 = st.columns(2) - # Reset Parameters button def _handle_reset() -> None: model_label = cast(str, selected_label) # Safe because we checked above reset_parameters_to_defaults( model_defaults_flat, params, model_label, param_specs=active_model.parameter_specs ) - # Reset scenarios back to model defaults default_scenarios = active_model.default_scenarios if default_scenarios: reset_scenario_state( @@ -124,12 +228,17 @@ def _handle_reset() -> None: default_scenarios, active_model.scenario_parameter_specs or {}, ) - - with button_col1: - st.button("Reset Parameters", on_click=_handle_reset, width='stretch') - - # Save Parameters button (only enabled when parameters are valid) - with button_col2: + + # Force both controls into the same keyed row for CSS alignment + with st.container(key="param-actions-row"): + button_col1, button_col2 = st.columns(2, gap="small", vertical_alignment="top") + + button_col1.button( + "Reset Parameters", + on_click=_handle_reset, + use_container_width=True, + ) + if typed_params is not None: render_parameter_export_modal( active_model.human_name(), @@ -138,11 +247,19 @@ def _handle_reset() -> None: container=button_col2, ) else: - st.button("Save Parameters", disabled=True, width='stretch', help="Fix parameter errors first") + button_col2.button( + "Save Parameters", + disabled=True, + use_container_width=True, + help="Fix parameter errors first", + ) st.divider() run_clicked = st.button( - "Run Simulation", disabled=has_input_errors, width='stretch', type='primary' + "Run Simulation", + disabled=has_input_errors, + use_container_width=True, + type="primary", ) with result_col: @@ -170,5 +287,4 @@ def _handle_reset() -> None: renderer.render(None, hint=_HINT) st.divider() - render_pdf_export_button(container=result_col) - + render_pdf_export_button(container=result_col) \ No newline at end of file diff --git a/src/epicc/model/models/tb_isolation.yaml b/src/epicc/model/models/tb_isolation.yaml index 7f0819b..8876f4c 100644 --- a/src/epicc/model/models/tb_isolation.yaml +++ b/src/epicc/model/models/tb_isolation.yaml @@ -327,10 +327,14 @@ report: direct isolation costs, lost productivity, and the long-term costs of secondary TB infections. +