pipeworks_mud_mapper.callbacks.validation_callbacks
Validation callbacks for PipeWorks MUD Mapper.
This module provides callbacks for running validation checks on maps and displaying results in a modal dialog. It also writes validation reports to the data/validation/ directory for CI/CD and record-keeping purposes.
Callbacks
update_validate_button_stateEnables/disables the Validate button based on whether a map is loaded.
run_validationRuns all validation checks, opens the results modal, writes report file.
close_validation_modalCloses the validation results modal.
select_room_from_validationHandles clicking on a room ID in validation results to select it on map.
Validation Categories
The validation service checks for three categories of issues:
- Connectivity
Broken exit references (ERROR - blocks export)
Unreachable rooms from spawn (WARNING)
Dead-end rooms with no exits (INFO)
- Consistency
Asymmetric exits (INFO - may be intentional one-way doors)
Direction/coordinate mismatches (WARNING)
- Language
“Upper Landing” problem - vertical words in names that don’t match the navigational direction (INFO)
Severity Levels
ERROR: Must be fixed before export (broken references)
WARNING: Should be reviewed but may be intentional
INFO: Informational - worth noting but likely intentional
See also
-, -, -
Functions
|
Enable/disable the Validate button based on whether a map is loaded. |
|
Run validation checks and display results in modal. |
|
Close the validation results modal. |
|
Handle clicking on a room ID in validation results. |
Module Contents
- pipeworks_mud_mapper.callbacks.validation_callbacks.update_validate_button_state(selected_file)[source]
Enable/disable the Validate button based on whether a map is loaded.
The Validate button is enabled when a map file is loaded (selected-file is not None). This prevents users from attempting to validate when there’s no data to check.
- pipeworks_mud_mapper.callbacks.validation_callbacks.run_validation(n_clicks, zone_data, selected_file)[source]
Run validation checks and display results in modal.
This callback: 1. Converts the zone data to a MapFile model 2. Runs all validation checks via validation_service 3. Writes a validation report to data/validation/ 4. Opens the modal with formatted results
- Parameters:
- Returns:
(modal_is_open, modal_body_children, validation_report_data) - modal_is_open: True to show the modal - modal_body_children: Formatted validation results - validation_report_data: Report dict for storage
- Return type:
- pipeworks_mud_mapper.callbacks.validation_callbacks.close_validation_modal(n_clicks)[source]
Close the validation results modal.
- pipeworks_mud_mapper.callbacks.validation_callbacks.select_room_from_validation(n_clicks_list, id_list)[source]
Handle clicking on a room ID in validation results.
When a user clicks on a room ID in the validation results, this callback: 1. Selects that room on the map 2. Closes the validation modal so the user can see the room