UI: grey ribbon entries, search results and Solve that miss what they need

The ribbon buttons, drop-down rows, command search and the title bar's Solve read
Session::availability: greyed, with what is missing (and where to get it) in the tooltip.
Starting such an entry opens no form; the status bar names what is missing. ui.toolbar
reports each entry's `enabled` and `unavailable`, ui.inspect the Solve button's.

Fixes #220

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
jyvikoandClaude Opus 5.5 authored and Irakli Kourtis committed 2026-10-14 18:43:29 -04:00
1 parent e0d5adba23
commit 8409101483
7 files changed
+114 -37

No files matched your search

+4 -2
View File
@@ -421,8 +421,8 @@ impl ModelApp {
/// Solve every step (`solve.run`) in the background; the results come up when it is done.
pub fn solve_all(&mut self) {
if self.session.model.steps().is_empty() {
self.set_status("Nothing to solve: the model has no steps (Steps › Step, or open a sample from Help › Samples)", true);
if let Some(u) = self.unavailable("solve.run") {
self.set_status(u.to_string(), true);
return;
}
let n = self.session.model.steps().len();
@@ -1232,6 +1232,8 @@ mod tests {
app.services.pick_save = Some(Box::new(|_: &str, _: &[Filter]| -> Option<String> { panic!("a picker opened") }));
app.start_programmatic("file.open").unwrap();
assert_eq!(app.dialog.as_ref().map(|d| d.command), Some("file.open"));
// A deck needs a model to write.
app.run("file.sample", json!({"name": "cantilever"})).unwrap();
app.start_programmatic("deck.write.abaqus").unwrap();
assert_eq!(app.dialog.as_ref().map(|d| d.command), Some("deck.write"));
// In-window choices are not pickers: they behave as a click.