Feuille du maître : écarts lus dans le classement, phrase sans redite du titre, plateau à la hauteur en paysage
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
84086900d1
commit
7c88b3ba76
@@ -124,7 +124,10 @@ export function createAdviceView(options: AdviceViewOptions): AdviceView {
|
||||
element(sheet, "p", {
|
||||
id: "explain-phrase",
|
||||
className: "explain-phrase",
|
||||
text: words.phrase,
|
||||
// Le titre dit déjà le coup du maître : la phrase ne le répète pas.
|
||||
text: words.phrase.startsWith(`${words.title}. `)
|
||||
? words.phrase.slice(words.title.length + 2)
|
||||
: words.phrase,
|
||||
});
|
||||
|
||||
const body = element(sheet, "div", { className: "explain-body" });
|
||||
@@ -337,18 +340,25 @@ export function createAdviceView(options: AdviceViewOptions): AdviceView {
|
||||
}
|
||||
};
|
||||
if (advice.kind === "move") {
|
||||
const best = advice.best.equity;
|
||||
const listed = advice.ranking.map((move, i) => ({ move, rank: i + 1 }));
|
||||
// Les écarts du classement se lisent par rapport à son premier
|
||||
// coup ; votre coup, s'il n'y figure pas, avec l'écart de
|
||||
// l'analyse du coup joué.
|
||||
const first = advice.ranking[0]?.equity ?? advice.best.equity;
|
||||
const listed = advice.ranking.map((move, i) => ({
|
||||
move,
|
||||
rank: i + 1,
|
||||
loss: move.equity - first,
|
||||
}));
|
||||
if (!advice.ranking.some((m) => m.notation === advice.played.notation)) {
|
||||
listed.push({ move: advice.played, rank: advice.rank });
|
||||
listed.push({ move: advice.played, rank: advice.rank, loss: advice.equityLoss });
|
||||
}
|
||||
for (const { move, rank } of listed) {
|
||||
for (const { move, rank, loss } of listed) {
|
||||
const mine = move.notation === advice.played.notation;
|
||||
row(
|
||||
[
|
||||
String(rank),
|
||||
mine ? `${move.notation} ${ADVICE_TEXTS.you}` : move.notation,
|
||||
formatEquity(move.equity - best),
|
||||
formatEquity(loss),
|
||||
],
|
||||
mine,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user