fix(io): enforce category limit in import wizard

The import wizard now proactively checks the `MAX_CATEGORIES` limit during
the proposal and configuration steps.

Advancing is blocked with a descriptive message if the limit would be
exceeded.

Fixed UI rendering order in `ImportWizardWidget` so messages are correctly
displayed.

Add regression tests for category limit enforcement.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
This commit is contained in:
Edward Langley
2026-06-09 21:43:13 -07:00
parent f0b9227d8f
commit 77a5124d16
2 changed files with 118 additions and 5 deletions
+7 -5
View File
@@ -323,16 +323,18 @@ impl<'a> Widget for ImportWizardWidget<'a> {
"Enter to import, Esc to cancel",
Style::default().fg(Color::DarkGray),
);
if let Some(msg) = &self.wizard.message {
let msg_y = inner.y + inner.height - 1;
buf.set_string(x, msg_y, truncate(msg, w), Style::default().fg(Color::Red));
}
}
WizardStep::Done => {
buf.set_string(x, y, "Import complete!", Style::default().fg(Color::Green));
}
}
// Wizard message (errors, blocked-step explanations) takes the bottom
// line on every step, overriding the key hint while present.
if let Some(msg) = &self.wizard.message {
let msg_y = inner.y + inner.height - 1;
buf.set_string(x, msg_y, truncate(msg, w), Style::default().fg(Color::Red));
}
}
}