Skip to content

Commit 7bfc6ef

Browse files
authored
fix(web): add edit and delete experiment functionality (#8)
* feat(web): add parameter and scenario comparison helpers Add _params_equal() for numeric-tolerant dict comparison and _scenarios_equal() for effective-parameter comparison that strips metadata keys and merges global defaults before diffing. * feat(web): add delete experiment functionality Add delete_experiment() pure function and show_delete_experiment_dialog() with confirmation UI. Includes 4 unit tests covering directory deletion, result file cleanup, and error cases for None/missing paths. * feat(web): add update experiment with smart result invalidation Add update_experiment() with 3-tier invalidation strategy: - No-op: nothing changed, preserve all results - Targeted: only changed/removed scenarios invalidated - Full: global parameter changes invalidate all results Includes _delete_scenario_files(), _invalidate_all_results(), and _invalidate_changed_scenarios() helpers. Handles directory rename on name change with collision detection. 11 unit tests cover name/description/parameter changes, no-op detection, collision errors, and scenario-level invalidation. * feat(web): add edit experiment modal and header action buttons Add show_edit_experiment_modal() dialog with pre-filled forms for name, description, global parameters, and dynamic scenario list. Reuses network_config_form(), distribution_config_form(), and simulation_params_form() components with edit-scoped key prefixes. Modify header layout to [6,4] split with [2,1,1] action sub-columns for Analyze, Edit, and Delete buttons. Icon-only coloring: green (Analyze), orange (Edit), red (Delete) with nowrap text. Includes session state lifecycle management with stale-guard detection to prevent state leaks on dialog X-close.
1 parent 32a59bd commit 7bfc6ef

3 files changed

Lines changed: 1299 additions & 30 deletions

File tree

0 commit comments

Comments
 (0)