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
@@ -475,6 +475,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 直前のハンドの状況を、AI に貼り付けて質問できる文章にしてコピーする
|
||||
async function copyHandPrompt(r) {
|
||||
if (!r || !r.sessionId || !r.last) return;
|
||||
const url = `/api/reviews/${encodeURIComponent(r.sessionId)}/hands/${r.last.number}/prompt`;
|
||||
try {
|
||||
if (await App.copyText(() => App.api('GET', url).then((d) => d.text))) toast('コピーしました。AI のチャットに貼り付けて質問できます');
|
||||
} catch (err) {
|
||||
toast(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
const openReview = () => { $('review-modal').hidden = false; };
|
||||
$('review-open').addEventListener('click', openReview);
|
||||
$('review-show').addEventListener('click', openReview);
|
||||
@@ -486,6 +497,7 @@
|
||||
$('review-modal').hidden = true;
|
||||
emit('table:next');
|
||||
};
|
||||
$('review-copy').addEventListener('click', () => copyHandPrompt(state && state.review));
|
||||
$('review-next').addEventListener('click', nextHand);
|
||||
$('review-modal-next').addEventListener('click', nextHand);
|
||||
|
||||
|
||||
Reference in new issue
Block a user