No preview strip: «+ Add as variation» at the end of the line being shown
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
CI / macos-build (push) Waiting to run

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
vrubelroman 2026-10-25 03:22:51 +03:00
parent 6d3d393e25
commit f03a0d2a4b
4 changed files with 60 additions and 60 deletions

View file

@ -39,6 +39,8 @@ pub struct NotationResponse {
pub nag: Option<(NodeId, Nag)>,
/// The editor's «Done» or «Cancel».
pub editor: Option<EditorOutcome>,
/// The engine line shown on the board goes into the game as a variation.
pub insert_preview: bool,
}
#[derive(Clone, Copy, Debug)]
@ -553,6 +555,18 @@ fn mark_block(ui: &mut Ui, n: &Notation, id: NodeId, mark: &Mark, out: &mut Nota
if mark.best_san.len() > visible {
ui.label(RichText::new("…").weak());
}
// The line being stepped through on the board: added from here (there is
// no separate strip for it).
if shown.is_some()
&& ui
.small_button(tr("+ Add as variation"))
.on_hover_text(tr(
"Puts the line into the game as a variation (Ctrl+Z to undo)",
))
.clicked()
{
out.insert_preview = true;
}
});
});
}