Show player turns in admin reading view
Build and publish frontend / publish (push) Successful in 57s
Build and publish frontend / publish (push) Successful in 57s
This commit is contained in:
+16
-4
@@ -31,8 +31,10 @@
|
||||
#admin-content article > .admin-story-reply { display: none; }
|
||||
#admin-content .admin-simple-conversation > h2,
|
||||
#admin-content .admin-simple-conversation > p:not(.admin-story-empty),
|
||||
#admin-content .admin-simple-conversation article > :not(.admin-story-reply) { display: none; }
|
||||
#admin-content .admin-simple-conversation article > :not(.admin-story-player):not(.admin-story-reply) { display: none; }
|
||||
#admin-content .admin-simple-conversation article > .admin-story-player,
|
||||
#admin-content .admin-simple-conversation article > .admin-story-reply { display: block; margin-block: .85rem; white-space: pre-wrap; }
|
||||
#admin-content .admin-simple-conversation article > .admin-story-player { font-weight: 650; }
|
||||
#admin-content pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 32rem; overflow: auto; }
|
||||
#admin-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: 1rem; }
|
||||
#player-search { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
|
||||
@@ -717,7 +719,11 @@
|
||||
let showedPlayerInput = false;
|
||||
for (const event of group.events) {
|
||||
const payload = event.payload || {};
|
||||
if (payload.player_message) { adminElement('p', `Spelaren: ${payload.player_message}`, card); showedPlayerInput = true; }
|
||||
if (payload.player_message) {
|
||||
const playerLine = adminElement('p', `Spelaren: ${payload.player_message}`, card);
|
||||
playerLine.className = 'admin-story-player';
|
||||
showedPlayerInput = true;
|
||||
}
|
||||
const reply = payload.reply || payload.npc_reply;
|
||||
if (reply) {
|
||||
const story = adminElement('p', `Berättelsen: ${reply}`, card);
|
||||
@@ -738,9 +744,15 @@
|
||||
}
|
||||
if (!showedPlayerInput) {
|
||||
const failedTurnInput = [...group.interactions].reverse().map(latestPlayerText).find(Boolean);
|
||||
if (failedTurnInput) adminElement('p', `Spelaren: ${failedTurnInput}`, card);
|
||||
if (failedTurnInput) {
|
||||
const playerLine = adminElement('p', `Spelaren: ${failedTurnInput}`, card);
|
||||
playerLine.className = 'admin-story-player';
|
||||
}
|
||||
}
|
||||
for (const message of group.messages) {
|
||||
const playerLine = adminElement('p', `Spelare: ${message.message}`, card);
|
||||
playerLine.className = 'admin-story-player';
|
||||
}
|
||||
for (const message of group.messages) adminElement('p', `Spelarmeddelande: ${message.message}`, card);
|
||||
for (const interaction of group.interactions) {
|
||||
if (!interaction.response) continue;
|
||||
const button = adminElement('button', `AI-svar · ${interaction.prompt_id} · ${interaction.outcome}: ${interaction.response}`, card);
|
||||
|
||||
Reference in New Issue
Block a user