Add a button to copy a hand's situation as an AI prompt
Reviews and replays get a "copy for AI" button that builds a text describing the hand (stacks, positions, actions, pots, board, revealed cards, result and the site's own judgments) plus questions, ready to paste into an AI chat. Hidden opponent cards are left out so the evaluation is based only on what Hero could see. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3ddb0996e0
commit
d5ef2d310f
10 files changed
+294
-3
No files matched your search
@@ -107,6 +107,7 @@
|
||||
|
||||
/* リプレイ */
|
||||
.rv-note { margin-top: 10px; font-size: 13px; background: var(--panel); border-radius: 10px; padding: 8px 10px; }
|
||||
.rv-copy { width: 100%; margin-top: 10px; }
|
||||
.rv-board-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; background: var(--felt-dark); border-radius: 12px; padding: 10px; }
|
||||
.rv-board { display: flex; gap: 3px; }
|
||||
.rv-pot { font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
|
||||
|
||||
+13
-1
@@ -369,11 +369,23 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="rv-streets">${STREETS.map((st) => `<div class="rv-street"><span>${STREET_SHORT[st]}</span><b class="score-${scoreClass(h.streetScores[st])}">${h.streetScores[st] == null ? '—' : h.streetScores[st]}</b></div>`).join('')}</div>
|
||||
${allInHtml(h)}`;
|
||||
${allInHtml(h)}
|
||||
<button type="button" class="btn btn-dark rv-copy" id="replay-copy">🤖 AIに質問する用にコピー</button>`;
|
||||
$('replay-copy').addEventListener('click', () => copyHandPrompt(h));
|
||||
$('replay-log').innerHTML = logHtml(h);
|
||||
renderStep();
|
||||
}
|
||||
|
||||
// ハンドの状況を、AI に貼り付けて「自分の判断は良かったか」を質問できる文章にしてコピーする
|
||||
async function copyHandPrompt(h) {
|
||||
const url = `/api/reviews/${encodeURIComponent(session.id)}/hands/${h.number}/prompt`;
|
||||
try {
|
||||
if (await App.copyText(() => api('GET', url).then((d) => d.text))) toast('コピーしました。AI のチャットに貼り付けて質問できます');
|
||||
} catch (err) {
|
||||
toast(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
function allInHtml(h) {
|
||||
const a = h.hero.allIn;
|
||||
if (!a) return '';
|
||||
|
||||
Reference in new issue
Block a user