refactor(ui): extract record coordinates error message to constant

Extract the hardcoded error message "Record coordinates cannot be empty"
into a public constant in effect.rs to avoid duplication and improve
maintainability.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf)
This commit is contained in:
Edward Langley
2026-04-15 03:01:30 -07:00
parent 9710fb534e
commit 6f291ccd04

View File

@ -6,6 +6,8 @@ use crate::view::Axis;
use super::app::{App, AppMode};
pub(crate) const RECORD_COORDS_CANNOT_BE_EMPTY: &str = "Record coordinates cannot be empty";
/// A discrete state change produced by a command.
/// Effects know how to apply themselves to the App.
pub trait Effect: Debug {
@ -459,7 +461,7 @@ impl Effect for ApplyAndClearDrill {
app.model.set_cell(orig_key.clone(), value);
} else {
if new_value.is_empty() {
app.status_msg = "Record coordinates cannot be empty".to_string();
app.status_msg = RECORD_COORDS_CANNOT_BE_EMPTY.to_string();
continue;
}
// Rename a coordinate: remove old cell, insert new with updated coord